mirror of
https://github.com/bellingcat/cisticola.git
synced 2026-06-08 03:18:34 +03:00
TelegramTelethonScraper: Use channel_id when channel has been previously encountered
This commit is contained in:
@@ -115,6 +115,12 @@ class TelegramTelethonScraper(Scraper):
|
||||
phone = os.environ['TELEGRAM_PHONE']
|
||||
|
||||
with TelegramClient(phone, api_id, api_hash) as client:
|
||||
try:
|
||||
client.get_entity(channel.platform_id)
|
||||
username = channel.platform_id
|
||||
except:
|
||||
logger.info(f"Channel {username} not encountered before")
|
||||
|
||||
for post in client.iter_messages(username):
|
||||
post_url = f'{channel.url}/{post.id}'
|
||||
|
||||
|
||||
@@ -99,12 +99,12 @@ RUMBLE_CHANNEL_KWARGS = {
|
||||
'notes': ''}
|
||||
|
||||
TELEGRAM_CHANNEL_KWARGS = {
|
||||
'name': 'South West Ohio Proud Boys (test)',
|
||||
'platform_id': -1001276612436,
|
||||
'name': 'USA Freedom Convoy (test)',
|
||||
'platform_id': -1001799578085,
|
||||
'category': 'test',
|
||||
'platform': 'Telegram',
|
||||
'url': 'https://t.me/SouthwestOhioPB',
|
||||
'screenname': 'SouthwestOhioPB',
|
||||
'url': 'https://t.me/usafreedomconvoy2022',
|
||||
'screenname': 'usafreedomconvoy2022',
|
||||
'country': 'US',
|
||||
'influencer': None,
|
||||
'public': True,
|
||||
|
||||
Reference in New Issue
Block a user