From ed49e63d95ca85ad3f8dc4529706a30f283e7192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Fri, 25 Nov 2022 00:45:32 +0100 Subject: [PATCH] [nitter] set 'hlsPlayback' cookie --- gallery_dl/extractor/nitter.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gallery_dl/extractor/nitter.py b/gallery_dl/extractor/nitter.py index 975a8216..dc597653 100644 --- a/gallery_dl/extractor/nitter.py +++ b/gallery_dl/extractor/nitter.py @@ -20,12 +20,16 @@ class NitterExtractor(BaseExtractor): archive_fmt = "{tweet_id}_{num}" def __init__(self, match): + self.cookiedomain = self.root.partition("://")[2] BaseExtractor.__init__(self, match) self.user = match.group(match.lastindex) def items(self): videos = self.config("videos", True) - ytdl = (videos == "ytdl") + if videos: + ytdl = (videos == "ytdl") + videos = True + self._cookiejar.set("hlsPlayback", "on", domain=self.cookiedomain) for tweet_html in self.tweets(): tweet = self._tweet_from_html(tweet_html)