From 8dd57beebc8b30321f3df6f28438ef35603bafed Mon Sep 17 00:00:00 2001 From: Jesse Bannon Date: Sun, 27 Nov 2022 23:40:44 -0800 Subject: [PATCH] [BACKEND] Pass deep copy of ytdl_options to yt-dlp (#376) --- src/ytdl_sub/downloaders/downloader.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ytdl_sub/downloaders/downloader.py b/src/ytdl_sub/downloaders/downloader.py index eca70886..4456cdbc 100644 --- a/src/ytdl_sub/downloaders/downloader.py +++ b/src/ytdl_sub/downloaders/downloader.py @@ -189,7 +189,8 @@ class Downloader(DownloadArchiver, Generic[DownloaderOptionsT], ABC): """ download_logger.debug("ytdl_options: %s", str(ytdl_options_overrides)) with Logger.handle_external_logs(name="yt-dlp"): - with ytdl.YoutubeDL(ytdl_options_overrides) as ytdl_downloader: + # Deep copy ytdl_options in case yt-dlp modifies the dict + with ytdl.YoutubeDL(copy.deepcopy(ytdl_options_overrides)) as ytdl_downloader: yield ytdl_downloader @property