]> jfr.im git - yt-dlp.git/commitdiff
fix motherless main
authorJohn Runyon <redacted>
Sat, 4 May 2024 05:58:32 +0000 (23:58 -0600)
committerJohn Runyon <redacted>
Sun, 7 Jul 2024 14:03:38 +0000 (08:03 -0600)
yt_dlp/extractor/motherless.py

index 86551950b7adf1663bb243e75f3d47928c84b9c0..7542161e2e71b5b384afae53ae9c94d6f00d9bdc 100644 (file)
@@ -112,10 +112,13 @@ def _real_extract(self, url):
         video_id = self._match_id(url)
         webpage = self._download_webpage(url, video_id)
 
-        if any(p in webpage for p in (
+        found_strings = [p for p in (
                 '<title>404 - MOTHERLESS.COM<',
-                ">The page you're looking for cannot be found.<")):
-            raise ExtractorError(f'Video {video_id} does not exist', expected=True)
+                '<title>404 | MOTHERLESS.COM<',
+                ">The page you're looking for cannot be found.<",
+                "File not found. Nothing to see here!") if p in webpage]
+        if found_strings:
+            raise ExtractorError(f'Video {video_id} does not exist ({found_strings})', expected=True)
 
         if '>The content you are trying to view is for friends only.' in webpage:
             raise ExtractorError(f'Video {video_id} is for friends only', expected=True)
@@ -197,6 +200,13 @@ def _real_extract(self, url):
         real_url = self._correct_path(url, item_id)
         webpage = self._download_webpage(real_url, item_id, 'Downloading page 1')
 
+        found_strings = [p for p in (
+                '<title>404 - MOTHERLESS.COM<',
+                '<title>404 | MOTHERLESS.COM<',
+                "File not Found. Nothing to see here!") if p in webpage]
+        if found_strings:
+            raise ExtractorError('Gallery %s does not exist (%s)' % (item_id, found_strings), expected=True)
+
         def get_page(idx):
             page = idx + 1
             current_page = webpage if not idx else self._download_webpage(