From efaab4fbfa0071403c6e31565527b4d422332823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Wed, 4 Oct 2023 22:59:25 +0200 Subject: [PATCH] [twitter] fix crash due to missing 'source' (#4620) regression caused by 06aaedde --- gallery_dl/extractor/twitter.py | 1 + gallery_dl/version.py | 2 +- test/results/twitter.py | 18 ++++++++---------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/gallery_dl/extractor/twitter.py b/gallery_dl/extractor/twitter.py index 3895c74c..ab5afd0a 100644 --- a/gallery_dl/extractor/twitter.py +++ b/gallery_dl/extractor/twitter.py @@ -451,6 +451,7 @@ class TwitterExtractor(Extractor): "id_str": id_str, "lang": None, "user": user, + "source": "><", "entities": {}, "extended_entities": { "media": [ diff --git a/gallery_dl/version.py b/gallery_dl/version.py index d06d9d6e..ef2afe69 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.26.0" +__version__ = "1.26.1-dev" diff --git a/test/results/twitter.py b/test/results/twitter.py index 4094bc94..fa95a046 100644 --- a/test/results/twitter.py +++ b/test/results/twitter.py @@ -254,10 +254,9 @@ __tests__ = ( "#category": ("", "twitter", "tweet"), "#class" : twitter.TwitterTweetExtractor, - "content": r"""re:Gear up for #PokemonSwordShieldEX with special Mystery Gifts! - -You’ll be able to receive four Galarian form Pokémon with Hidden Abilities, plus some very useful items. It’s our \(Mystery\) Gift to you, Trainers! - + "source" : "Sprinklr", + "content": r"""re:Gear up for #PokemonSwordShieldEX with special Mystery Gifts! \n +You’ll be able to receive four Galarian form Pokémon with Hidden Abilities, plus some very useful items. It’s our \(Mystery\) Gift to you, Trainers! \n ❓🎁➡️ """, }, @@ -482,8 +481,9 @@ You’ll be able to receive four Galarian form Pokémon with Hidden Abilities, p "#comment" : "age-restricted (#2354)", "#category": ("", "twitter", "tweet"), "#class" : twitter.TwitterTweetExtractor, - "#options" : {"syndication": True}, - "#count" : 1, + "#exception": exception.AuthorizationError, + "#options" : {"syndication": True}, + "#count" : 1, "date": "dt:2022-02-13 20:10:09", }, @@ -513,10 +513,8 @@ You’ll be able to receive four Galarian form Pokémon with Hidden Abilities, p "#category": ("", "twitter", "tweet"), "#class" : twitter.TwitterTweetExtractor, - "content": """BREAKING - DEADLY LIES: Independent researchers at Texas A&M University have just contradicted federal government regulators, saying that toxic air pollutants in East Palestine, Ohio, could pose long-term risks. - -The Washington Post writes, "Three weeks after the toxic train derailment in Ohio, an analysis of Environmental Protection Agency data has found nine air pollutants at levels that could raise long-term health concerns in and around East Palestine, according to an independent analysis. - + "content": """BREAKING - DEADLY LIES: Independent researchers at Texas A&M University have just contradicted federal government regulators, saying that toxic air pollutants in East Palestine, Ohio, could pose long-term risks. \n +The Washington Post writes, "Three weeks after the toxic train derailment in Ohio, an analysis of Environmental Protection Agency data has found nine air pollutants at levels that could raise long-term health concerns in and around East Palestine, according to an independent analysis. \n "The analysis by Texas A&M University seems to contradict statements by state and federal regulators that air near the crash site is completely safe, despite residents complaining about rashes, breathing problems and other health effects." Your reaction.""", },