Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tubesync/sync/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class YouTubeError(yt_dlp.utils.DownloadError):

def get_yt_opts():
opts = deepcopy(_defaults)
opts.update(dict(logger=log))
cookie_file = settings.COOKIES_FILE
if cookie_file.is_file():
cookie_file_path = str(cookie_file.resolve())
Expand All @@ -65,7 +66,6 @@ def get_channel_id(url):
opts.update({
'skip_download': True,
'simulate': True,
'logger': log,
'extract_flat': True, # Change to False to get detailed info
'check_formats': False,
'playlist_items': '1',
Expand Down Expand Up @@ -149,7 +149,6 @@ def get_image_info(url):
opts.update({
'skip_download': True,
'simulate': True,
'logger': log,
'extract_flat': True, # Change to False to get detailed info
'check_formats': False,
'playlist_items': '1',
Expand Down Expand Up @@ -250,7 +249,6 @@ class NoDefaultValue: pass # a unique Singleton, that may be checked for later
'ignore_no_formats_error': False, # we must fail first to try again with this enabled
'skip_download': True,
'simulate': False,
'logger': log,
'extract_flat': True,
'allow_playlist_files': True,
'check_formats': True,
Expand Down Expand Up @@ -312,6 +310,8 @@ def download_media(
opts = get_yt_opts()
default_opts = yt_dlp.parse_options([]).options
pp_opts = deepcopy(default_opts)
# maintain logging while postprocessors are set-up
pp_opts.logger = opts.get('logger', default_opts.logger)

# We fake up this option to make it easier for the user to add post processors.
postprocessors = opts.get('add_postprocessors', pp_opts.add_postprocessors)
Expand Down