mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-26 12:53:12 -06:00
Catch image description sent by Streaming API. Should be enough to fix #449
This commit is contained in:
parent
c048c3ff32
commit
e43ddad678
@ -45,6 +45,10 @@ def process_image_descriptions(entities):
|
|||||||
for media in entities["media"]:
|
for media in entities["media"]:
|
||||||
if media.get("ext_alt_text") != None:
|
if media.get("ext_alt_text") != None:
|
||||||
image_descriptions.append(media.get("ext_alt_text"))
|
image_descriptions.append(media.get("ext_alt_text"))
|
||||||
|
# Tweets retrieved via the Streaming API have a description field in media photos with image description available.
|
||||||
|
elif media.get("description") != None:
|
||||||
|
image_descriptions.append(media.get("description"))
|
||||||
|
|
||||||
idescriptions = ""
|
idescriptions = ""
|
||||||
for image in image_descriptions:
|
for image in image_descriptions:
|
||||||
idescriptions += _("Image description: {}.").format(image)
|
idescriptions += _("Image description: {}.").format(image)
|
||||||
|
Loading…
Reference in New Issue
Block a user