diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2023-02-17 16:51:34 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2023-02-17 17:52:23 +0530 |
commit | 45b2ee6f4fae139892a1a4335c269dcbb6671497 (patch) | |
tree | 3cd8e7e643dc0576dcc8e9e87079f015588a06ec /yt_dlp/extractor/cammodels.py | |
parent | a5387729696a5b33f53f60ef06f48e45663b12dd (diff) | |
download | hypervideo-pre-45b2ee6f4fae139892a1a4335c269dcbb6671497.tar.lz hypervideo-pre-45b2ee6f4fae139892a1a4335c269dcbb6671497.tar.xz hypervideo-pre-45b2ee6f4fae139892a1a4335c269dcbb6671497.zip |
Update to ytdl-commit-2dd6c6e
[YouTube] Avoid crash if uploader_id extraction fails
https://github.com/ytdl-org/youtube-dl/commit/2dd6c6edd8e0fc5e45865b8e6d865e35147de772
Except:
* 295736c9cba714fb5de7d1c3dd31d86e50091cf8 [jsinterp] Improve parsing
* 384f632e8a9b61e864a26678d85b2b39933b9bae [ITV] Overhaul ITV extractor
* 33db85c571304bbd6863e3407ad8d08764c9e53b [feat]: Add support to external downloader aria2p
Diffstat (limited to 'yt_dlp/extractor/cammodels.py')
-rw-r--r-- | yt_dlp/extractor/cammodels.py | 39 |
1 files changed, 11 insertions, 28 deletions
diff --git a/yt_dlp/extractor/cammodels.py b/yt_dlp/extractor/cammodels.py index 0509057fc..135b31529 100644 --- a/yt_dlp/extractor/cammodels.py +++ b/yt_dlp/extractor/cammodels.py @@ -1,9 +1,5 @@ from .common import InfoExtractor -from ..utils import ( - ExtractorError, - int_or_none, - url_or_none, -) +from ..utils import int_or_none, url_or_none class CamModelsIE(InfoExtractor): @@ -17,32 +13,11 @@ class CamModelsIE(InfoExtractor): def _real_extract(self, url): user_id = self._match_id(url) - webpage = self._download_webpage( - url, user_id, headers=self.geo_verification_headers()) - - manifest_root = self._html_search_regex( - r'manifestUrlRoot=([^&\']+)', webpage, 'manifest', default=None) - - if not manifest_root: - ERRORS = ( - ("I'm offline, but let's stay connected", 'This user is currently offline'), - ('in a private show', 'This user is in a private show'), - ('is currently performing LIVE', 'This model is currently performing live'), - ) - for pattern, message in ERRORS: - if pattern in webpage: - error = message - expected = True - break - else: - error = 'Unable to find manifest URL root' - expected = False - raise ExtractorError(error, expected=expected) - manifest = self._download_json( - '%s%s.json' % (manifest_root, user_id), user_id) + 'https://manifest-server.naiadsystems.com/live/s:%s.json' % user_id, user_id) formats = [] + thumbnails = [] for format_id, format_dict in manifest['formats'].items(): if not isinstance(format_dict, dict): continue @@ -82,12 +57,20 @@ class CamModelsIE(InfoExtractor): 'quality': -10, }) else: + if format_id == 'jpeg': + thumbnails.append({ + 'url': f['url'], + 'width': f['width'], + 'height': f['height'], + 'format_id': f['format_id'], + }) continue formats.append(f) return { 'id': user_id, 'title': user_id, + 'thumbnails': thumbnails, 'is_live': True, 'formats': formats, 'age_limit': 18 |