瀏覽代碼

A few more youtube-dl tweaks

Joseph Turian 3 年之前
父節點
當前提交
dba423a568
共有 2 個文件被更改,包括 4 次插入2 次删除
  1. 2 0
      archivebox/config.py
  2. 2 2
      archivebox/extractors/media.py

+ 2 - 0
archivebox/config.py

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

+ 2 - 2
archivebox/extractors/media.py

@@ -33,7 +33,7 @@ def should_save_media(link: Link, out_dir: Optional[Path]=None, overwrite: Optio
 
 
 @enforce_types
 @enforce_types
 def save_media(link: Link, out_dir: Optional[Path]=None, timeout: int=MEDIA_TIMEOUT) -> ArchiveResult:
 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)
     out_dir = out_dir or Path(link.link_dir)
     output: ArchiveOutput = 'media'
     output: ArchiveOutput = 'media'
@@ -61,7 +61,7 @@ def save_media(link: Link, out_dir: Optional[Path]=None, timeout: int=MEDIA_TIME
                 pass
                 pass
             else:
             else:
                 hints = (
                 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'),
                     *result.stderr.decode().split('\n'),
                 )
                 )
                 raise ArchiveError('Failed to save media', hints)
                 raise ArchiveError('Failed to save media', hints)