]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/__init__.py
[extractor/twitter:spaces] Add `release_timestamp` (#7186)
[yt-dlp.git] / yt_dlp / __init__.py
index 9563d784aaf32322f4c215af9a5d55b6ab327cdf..137c9503f62760751caf74f72c6e7fbef421bd84 100644 (file)
@@ -436,6 +436,10 @@ def metadataparser_actions(f):
         elif ed and proto == 'default':
             default_downloader = ed.get_basename()
 
+    for policy in opts.color.values():
+        if policy not in ('always', 'auto', 'no_color', 'never'):
+            raise ValueError(f'"{policy}" is not a valid color policy')
+
     warnings, deprecation_warnings = [], []
 
     # Common mistake: -f best
@@ -894,7 +898,7 @@ def parse_options(argv=None):
         'playlist_items': opts.playlist_items,
         'xattr_set_filesize': opts.xattr_set_filesize,
         'match_filter': opts.match_filter,
-        'no_color': opts.no_color,
+        'color': opts.color,
         'ffmpeg_location': opts.ffmpeg_location,
         'hls_prefer_native': opts.hls_prefer_native,
         'hls_use_mpegts': opts.hls_use_mpegts,