Cards can have no pic

This commit is contained in:
jeancf 2020-12-18 21:32:26 +01:00
parent 986d902ccd
commit 33342cdfb7

View File

@ -82,12 +82,12 @@ def process_card(card_container):
:return: list with url of image
"""
list = []
link = card_container.get('href')
# Do not extract image for youtube links
image_url = 'https://nitter.net' + card_container.div.div.img.get('src')
list.append(image_url)
logging.debug('Extracted image from card')
img = card_container.div.div.img
if img is not None:
image_url = 'https://nitter.net' + img.get('src')
list.append(image_url)
logging.debug('Extracted image from card')
return list