]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/toggle.py
Add option `--ignore-no-formats-error`
[yt-dlp.git] / yt_dlp / extractor / toggle.py
index 1e2a2d819c3990db8fcf3252a143f710014acb61..fe18410812885b02b7f66aa4e3b97886ce4d8776 100644 (file)
@@ -7,7 +7,6 @@
 from .common import InfoExtractor
 from ..utils import (
     determine_ext,
-    ExtractorError,
     float_or_none,
     int_or_none,
     parse_iso8601,
@@ -156,10 +155,9 @@ def _real_extract(self, url):
             for meta in (info.get('Metas') or []):
                 if (not self._downloader.params.get('allow_unplayable_formats')
                         and meta.get('Key') == 'Encryption' and meta.get('Value') == '1'):
-                    raise ExtractorError(
+                    self.raise_no_formats(
                         'This video is DRM protected.', expected=True)
-            # Most likely because geo-blocked
-            raise ExtractorError('No downloadable videos found', expected=True)
+            # Most likely because geo-blocked if no formats and no DRM
         self._sort_formats(formats)
 
         thumbnails = []