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