[BACKEND] Pass deep copy of ytdl_options to yt-dlp (#376)

This commit is contained in:
Jesse Bannon 2022-11-27 23:40:44 -08:00 committed by GitHub
parent 92c9988987
commit 8dd57beebc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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