From 7ddfff957ccabe85f04348aeb224d348a89e37e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Mon, 29 Aug 2022 11:56:39 +0200 Subject: [PATCH] [twitter] support "image_website" unified cards (#2875) --- gallery_dl/extractor/twitter.py | 10 ++++++++-- gallery_dl/version.py | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/gallery_dl/extractor/twitter.py b/gallery_dl/extractor/twitter.py index 0df4ea21..cdab0591 100644 --- a/gallery_dl/extractor/twitter.py +++ b/gallery_dl/extractor/twitter.py @@ -208,7 +208,7 @@ class TwitterExtractor(Extractor): else: bval = bvals["unified_card"]["string_value"] data = json.loads(bval) - if data.get("type") == "image_carousel_website": + if data.get("type") in ("image_website", "image_carousel_website"): self._extract_media( tweet, data["media_entities"].values(), files) return @@ -735,7 +735,13 @@ class TwitterTweetExtractor(TwitterExtractor): "options": (("cards", True),), "pattern": r"https://pbs.twimg.com/card_img/\d+/", }), - # unified_card with image_carousel_website + # image_website unified_card (#2875) + ("https://twitter.com/i/web/status/1561674543323910144", { + "options": (("cards", True),), + "pattern": r"https://pbs\.twimg\.com/media/F.+=jpg", + "count": 1, + }), + # image_carousel_website unified_card ("https://twitter.com/doax_vv_staff/status/1479438945662685184", { "options": (("cards", True),), "pattern": r"https://pbs\.twimg\.com/media/F.+=png", diff --git a/gallery_dl/version.py b/gallery_dl/version.py index d12d088f..a799d04c 100644 --- a/gallery_dl/version.py +++ b/gallery_dl/version.py @@ -6,4 +6,4 @@ # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. -__version__ = "1.23.0" +__version__ = "1.23.1-dev"