diff --git a/gallery_dl/extractor/twitter.py b/gallery_dl/extractor/twitter.py index 9c9d50528b..e2da94c1ff 100644 --- a/gallery_dl/extractor/twitter.py +++ b/gallery_dl/extractor/twitter.py @@ -765,6 +765,16 @@ def items(self): self.login() return self._users_result(TwitterAPI(self).user_following(self.user)) +class TwitterFollowersExtractor(TwitterExtractor): + """Extractor for followed users""" + subcategory = "followers" + pattern = BASE_PATTERN + r"/(?!search)([^/?#]+)/followers(?!\w)" + example = "https://x.com/USER/followers" + + def items(self): + self.login() + return self._users_result(TwitterAPI(self).user_followers(self.user)) + class TwitterSearchExtractor(TwitterExtractor): """Extractor for Twitter search results""" @@ -1142,6 +1152,10 @@ def __init__(self, extractor): "longform_notetweets_inline_media_enabled": True, "responsive_web_media_download_video_enabled": True, "responsive_web_enhance_cards_enabled": False, + "communities_web_enable_tweet_community_results_fetch" : False, + "creator_subscriptions_quote_tweet_preview_enabled" : False, + "rweb_tipjar_consumption_enabled": False, + "articles_preview_enabled" : False, } def tweet_result_by_rest_id(self, tweet_id): @@ -1342,6 +1356,15 @@ def user_following(self, screen_name): } return self._pagination_users(endpoint, variables) + def user_followers(self, screen_name): + endpoint = "/graphql/gwv4MK0diCpAJ79u7op1Lg/Followers" + variables = { + "userId": self._user_id_by_screen_name(screen_name), + "count": 100, + "includePromotedContent": False, + } + return self._pagination_users(endpoint, variables) + @memcache(keyarg=1) def user_by_rest_id(self, rest_id): endpoint = "/graphql/tD8zKvQzwY3kdx5yz6YmOw/UserByRestId"