From: John Runyon Date: Sat, 4 May 2024 05:58:32 +0000 (-0600) Subject: fix motherless X-Git-Url: https://jfr.im/git/yt-dlp.git/commitdiff_plain/13f0f31370edf024148f8468dffd232a1a82756f fix motherless --- diff --git a/yt_dlp/extractor/motherless.py b/yt_dlp/extractor/motherless.py index 86551950b..7542161e2 100644 --- a/yt_dlp/extractor/motherless.py +++ b/yt_dlp/extractor/motherless.py @@ -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 ( '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(