Skip to content

Commit

Permalink
[twitter] fix unified cards from search results
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Jan 22, 2022
1 parent 962f6b8 commit 14867da
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gallery_dl/extractor/twitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,11 @@ def _extract_card(self, tweet, files):
if isinstance(bvals, list):
for bval in card["binding_values"]:
if bval["key"] == "unified_card":
bval = bval["value"]["string_value"]
break
else:
bval = bvals["unified_card"]
data = json.loads(bval["value"]["string_value"])
bval = bvals["unified_card"]["string_value"]
data = json.loads(bval)
if data["type"] == "image_carousel_website":
self._extract_media(
tweet, data["media_entities"].values(), files)
Expand Down

0 comments on commit 14867da

Please sign in to comment.