From cdcb6691b0a97f70eacc352eea0e0ec32ba7c203 Mon Sep 17 00:00:00 2001 From: you-cant-see-me Date: Tue, 27 May 2025 15:56:48 +0100 Subject: [PATCH 1/2] Fix impersonate option --- app/ytdl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/ytdl.py b/app/ytdl.py index e32892e..f40c0ac 100644 --- a/app/ytdl.py +++ b/app/ytdl.py @@ -299,8 +299,8 @@ class DownloadQueue: 'ignore_no_formats_error': True, 'noplaylist': playlist_strict_mode, 'paths': {"home": self.config.DOWNLOAD_DIR, "temp": self.config.TEMP_DIR}, - **({'impersonate': yt_dlp.networking.impersonate.ImpersonateTarget.from_str(self.config.YTDL_OPTIONS['impersonate'])} if 'impersonate' in self.config.YTDL_OPTIONS else {}), **self.config.YTDL_OPTIONS, + **({'impersonate': yt_dlp.networking.impersonate.ImpersonateTarget.from_str(self.config.YTDL_OPTIONS['impersonate'])} if 'impersonate' in self.config.YTDL_OPTIONS else {}), }).extract_info(url, download=False) def __calc_download_path(self, quality, format, folder): From 6f2a6b94e41b475b982e5126ea5009e7a0a59481 Mon Sep 17 00:00:00 2001 From: you-cant-see-me Date: Tue, 27 May 2025 16:16:37 +0100 Subject: [PATCH 2/2] Fix download with impersonate --- app/ytdl.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/ytdl.py b/app/ytdl.py index f40c0ac..d4955f3 100644 --- a/app/ytdl.py +++ b/app/ytdl.py @@ -55,6 +55,8 @@ class Download: self.output_template_chapter = output_template_chapter self.format = get_format(format, quality) self.ytdl_opts = get_opts(format, quality, ytdl_opts) + if "impersonate" in self.ytdl_opts: + self.ytdl_opts["impersonate"] = yt_dlp.networking.impersonate.ImpersonateTarget.from_str(self.ytdl_opts["impersonate"]) self.info = info self.canceled = False self.tmpfilename = None