Fix two small bugs with media archiving

This commit is contained in:
Logan Williams
2022-07-05 13:30:39 +02:00
parent b99958a894
commit fbb846b8d6
2 changed files with 4 additions and 1 deletions

View File

@@ -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

View File

@@ -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")