mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-23 06:37:15 +00:00
fix: [telegram module] check username length
This commit is contained in:
parent
0d67ad80d1
commit
3af5c4bafa
1 changed files with 8 additions and 6 deletions
|
@ -51,9 +51,10 @@ def extract_data_from_telegram_url(item_id, item_date, base_url, url_path):
|
||||||
username = url_path[0].lower()
|
username = url_path[0].lower()
|
||||||
username = regex_username.search(username)
|
username = regex_username.search(username)
|
||||||
if username:
|
if username:
|
||||||
username = username[0]
|
username = username[0].replace('/', '')
|
||||||
print('username: {}'.format(username))
|
if len(username) > 5:
|
||||||
telegram.save_item_correlation(username, item_id, item_date)
|
print('username: {}'.format(username))
|
||||||
|
telegram.save_item_correlation(username, item_id, item_date)
|
||||||
elif url_path[0] == 'joinchat':
|
elif url_path[0] == 'joinchat':
|
||||||
invite_hash = regex_join_hash.search(url_path[1])
|
invite_hash = regex_join_hash.search(url_path[1])
|
||||||
if invite_hash:
|
if invite_hash:
|
||||||
|
@ -75,9 +76,10 @@ def extract_data_from_tg_url(item_id, item_date, tg_link):
|
||||||
username = url.query[7:]
|
username = url.query[7:]
|
||||||
username = regex_username.search(username)
|
username = regex_username.search(username)
|
||||||
if username:
|
if username:
|
||||||
username = username[0]
|
username = username[0].replace('/', '')
|
||||||
print('username: {}'.format(username))
|
if len(username) > 5:
|
||||||
telegram.save_item_correlation(username, item_id, item_date)
|
print('username: {}'.format(username))
|
||||||
|
telegram.save_item_correlation(username, item_id, item_date)
|
||||||
elif url.netloc == 'join' and len(url.query) > 7:
|
elif url.netloc == 'join' and len(url.query) > 7:
|
||||||
if url.query[:7] == 'invite=':
|
if url.query[:7] == 'invite=':
|
||||||
invite_hash = url.query[7:]
|
invite_hash = url.query[7:]
|
||||||
|
|
Loading…
Reference in a new issue