1
0
Fork 0
mirror of synced 2024-06-18 18:34:51 +12:00

A few more youtube-dl tweaks

This commit is contained in:
Joseph Turian 2022-09-12 20:36:23 +00:00
parent f5f7aff3b4
commit dba423a568
2 changed files with 4 additions and 2 deletions

View file

@ -149,6 +149,8 @@ CONFIG_SCHEMA: Dict[str, ConfigDefaultDict] = {
'--yes-playlist',
'--continue',
'--ignore-errors',
# This flag doesn't exist in youtube-dl
# only in yt-dlp
'--no-abort-on-error',
'--geo-bypass',
'--add-metadata',

View file

@ -33,7 +33,7 @@ def should_save_media(link: Link, out_dir: Optional[Path]=None, overwrite: Optio
@enforce_types
def save_media(link: Link, out_dir: Optional[Path]=None, timeout: int=MEDIA_TIMEOUT) -> ArchiveResult:
"""Download playlists or individual video, audio, and subtitles using youtube-dl"""
"""Download playlists or individual video, audio, and subtitles using youtube-dl or yt-dlp"""
out_dir = out_dir or Path(link.link_dir)
output: ArchiveOutput = 'media'
@ -61,7 +61,7 @@ def save_media(link: Link, out_dir: Optional[Path]=None, timeout: int=MEDIA_TIME
pass
else:
hints = (
'Got youtube-dl response code: {}.'.format(result.returncode),
'Got youtube-dl (or yt-dlp) response code: {}.'.format(result.returncode),
*result.stderr.decode().split('\n'),
)
raise ArchiveError('Failed to save media', hints)