From 0916c22c062f882c5b8260cef9899c0af8159be2 Mon Sep 17 00:00:00 2001 From: admapop Date: Sat, 28 Dec 2024 17:03:59 +0200 Subject: [PATCH 1/2] fix: impersonate property needs to be of the right type and not as it is being passed now via JSON --- app/ytdl.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/ytdl.py b/app/ytdl.py index f169afe..7b992c8 100644 --- a/app/ytdl.py +++ b/app/ytdl.py @@ -7,6 +7,9 @@ import multiprocessing import logging import re + +import yt_dlp.networking +import yt_dlp.networking.impersonate from dl_formats import get_format, get_opts, AUDIO_FORMATS from datetime import datetime @@ -227,6 +230,7 @@ def __extract_info(self, url, playlist_strict_mode): '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, }).extract_info(url, download=False) From bec65c37054983c82a6ccdbbcfd7c551b92105a9 Mon Sep 17 00:00:00 2001 From: admapop Date: Sat, 28 Dec 2024 20:41:22 +0200 Subject: [PATCH 2/2] chore: PR suggestion --- app/ytdl.py | 1 - 1 file changed, 1 deletion(-) diff --git a/app/ytdl.py b/app/ytdl.py index 7b992c8..3434358 100644 --- a/app/ytdl.py +++ b/app/ytdl.py @@ -8,7 +8,6 @@ import logging import re -import yt_dlp.networking import yt_dlp.networking.impersonate from dl_formats import get_format, get_opts, AUDIO_FORMATS from datetime import datetime