mirror of
https://github.com/bellingcat/cisticola.git
synced 2026-06-08 03:18:34 +03:00
Fix two small bugs with media archiving
This commit is contained in:
@@ -24,6 +24,9 @@ class Scraper:
|
||||
|
||||
__version__ = "Scraper 0.0.0"
|
||||
|
||||
cookiestring = os.environ["YOUTUBE_COOKIESTRING"].replace(r'\n', '\n').replace(r'\t', '\t')
|
||||
cookiefilename = 'cookiefile.txt'
|
||||
|
||||
def __init__(self):
|
||||
|
||||
# Initialize client to transfer files to the storage archive
|
||||
|
||||
@@ -70,7 +70,7 @@ class TelegramTelethonScraper(Scraper):
|
||||
message = self.client.get_messages(raw['peer_id']['channel_id'], ids=[raw['id']])
|
||||
|
||||
blob = None
|
||||
if len(message) > 0:
|
||||
if len(message) > 0 and message[0] is not None:
|
||||
blob, output_file_with_ext = self.archive_post_media(message[0])
|
||||
else:
|
||||
logger.warning("No message retrieved")
|
||||
|
||||
Reference in New Issue
Block a user