mirror of
http://git.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion/nihilist/darknet-lantern.git
synced 2025-05-16 20:26:58 +00:00
Fix
This commit is contained in:
parent
18b66a1358
commit
484a235b8b
1 changed files with 25 additions and 19 deletions
|
@ -30,15 +30,18 @@ def is_simplex_link_valid(simplex_link: str) -> bool:
|
|||
websocket.send(json.dumps(command))
|
||||
message = websocket.recv()
|
||||
response = json.loads(message)
|
||||
response_type = response['resp']['type']
|
||||
if 'error' in response_type.lower():
|
||||
print(f"Connection to this group {simplex_link} failed. Try again.")
|
||||
try:
|
||||
response_type = response['resp']['type']
|
||||
if 'error' in response_type.lower():
|
||||
print(f"Connection to this group {simplex_link} failed. Try again.")
|
||||
return False
|
||||
elif 'deleted' in response_type.lower():
|
||||
print(f"Connection to this group {simplex_link} failed. Try again.")
|
||||
return False
|
||||
print('[+] Success!',response_type)
|
||||
return True
|
||||
except:
|
||||
return False
|
||||
elif 'deleted' in response_type.lower():
|
||||
print(f"Connection to this group {simplex_link} failed. Try again.")
|
||||
return False
|
||||
print('[+] Success!',response_type)
|
||||
return True
|
||||
|
||||
def check_groups_validity():
|
||||
"""
|
||||
|
@ -53,17 +56,20 @@ def check_groups_validity():
|
|||
websocket.send(json.dumps(command))
|
||||
message = websocket.recv()
|
||||
response = json.loads(message)
|
||||
for i in range(0,len(response['resp']['groups'])):
|
||||
group_name = response['resp']['groups'][i][0]['groupProfile']['displayName']
|
||||
# Description key sometimes are not supplied with .get() KeyError will occur
|
||||
group_descr = response['resp']['groups'][i][0]['groupProfile'].get('description', "No description")
|
||||
last_message_sent = response['resp']['groups'][i][0]['chatTs']
|
||||
# Do something with this data
|
||||
print(f"{group_name}")
|
||||
print(group_descr)
|
||||
print(f"{last_message_sent}\n")
|
||||
# Only date
|
||||
print(last_message_sent.split('T')[0])
|
||||
try:
|
||||
for i in range(0,len(response['resp']['groups'])):
|
||||
group_name = response['resp']['groups'][i][0]['groupProfile']['displayName']
|
||||
# Description key sometimes are not supplied with .get() KeyError will occur
|
||||
group_descr = response['resp']['groups'][i][0]['groupProfile'].get('description', "No description")
|
||||
last_message_sent = response['resp']['groups'][i][0]['chatTs']
|
||||
# Do something with this data
|
||||
print(f"{group_name}")
|
||||
print(group_descr)
|
||||
print(f"{last_message_sent}")
|
||||
# Only date
|
||||
print(f"{last_message_sent.split('T')[0]}\n")
|
||||
except Exception:
|
||||
print("An error occured. Try again.")
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue