mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-13 20:53:06 +00:00
Improve 5736d79172
This commit is contained in:
parent
3166e6840c
commit
2b24afa6d7
@ -411,6 +411,9 @@ def validate_options(opts):
|
|||||||
if opts.download_archive is not None:
|
if opts.download_archive is not None:
|
||||||
opts.download_archive = expand_path(opts.download_archive)
|
opts.download_archive = expand_path(opts.download_archive)
|
||||||
|
|
||||||
|
if opts.ffmpeg_location is not None:
|
||||||
|
opts.ffmpeg_location = expand_path(opts.ffmpeg_location)
|
||||||
|
|
||||||
if opts.user_agent is not None:
|
if opts.user_agent is not None:
|
||||||
opts.headers.setdefault('User-Agent', opts.user_agent)
|
opts.headers.setdefault('User-Agent', opts.user_agent)
|
||||||
if opts.referer is not None:
|
if opts.referer is not None:
|
||||||
@ -920,7 +923,6 @@ def _real_main(argv=None):
|
|||||||
# We may need ffmpeg_location without having access to the YoutubeDL instance
|
# We may need ffmpeg_location without having access to the YoutubeDL instance
|
||||||
# See https://github.com/yt-dlp/yt-dlp/issues/2191
|
# See https://github.com/yt-dlp/yt-dlp/issues/2191
|
||||||
if opts.ffmpeg_location:
|
if opts.ffmpeg_location:
|
||||||
opts.ffmpeg_location = expand_path(opts.ffmpeg_location)
|
|
||||||
FFmpegPostProcessor._ffmpeg_location.set(opts.ffmpeg_location)
|
FFmpegPostProcessor._ffmpeg_location.set(opts.ffmpeg_location)
|
||||||
|
|
||||||
with YoutubeDL(ydl_opts) as ydl:
|
with YoutubeDL(ydl_opts) as ydl:
|
||||||
|
@ -988,8 +988,8 @@ def _parse_browser_specification(browser_name, profile=None, keyring=None, conta
|
|||||||
raise ValueError(f'unsupported browser: "{browser_name}"')
|
raise ValueError(f'unsupported browser: "{browser_name}"')
|
||||||
if keyring not in (None, *SUPPORTED_KEYRINGS):
|
if keyring not in (None, *SUPPORTED_KEYRINGS):
|
||||||
raise ValueError(f'unsupported keyring: "{keyring}"')
|
raise ValueError(f'unsupported keyring: "{keyring}"')
|
||||||
if profile is not None and _is_path(profile):
|
if profile is not None and _is_path(expand_path(profile)):
|
||||||
profile = os.path.expanduser(profile)
|
profile = expand_path(profile)
|
||||||
return browser_name, profile, keyring, container
|
return browser_name, profile, keyring, container
|
||||||
|
|
||||||
|
|
||||||
|
@ -762,7 +762,7 @@ def sanitized_Request(url, *args, **kwargs):
|
|||||||
|
|
||||||
|
|
||||||
def expand_path(s):
|
def expand_path(s):
|
||||||
"""Expand shell variables and ~"""
|
"""Expand $ shell variables and ~"""
|
||||||
return os.path.expandvars(compat_expanduser(s))
|
return os.path.expandvars(compat_expanduser(s))
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user