stream_type

Authored by: bashonly
This commit is contained in:
bashonly 2024-05-05 17:51:24 -05:00
parent 190f3c440a
commit 8516944601
No known key found for this signature in database
GPG Key ID: 783F096F253D15B0
1 changed files with 4 additions and 4 deletions

View File

@ -92,13 +92,13 @@ class YouPornIE(InfoExtractor):
webpage = self._download_webpage(f'https://www.youporn.com/watch/{video_id}', video_id)
definitions = self._search_json(r'\bplayervars\s*:', webpage, 'player vars', video_id)['mediaDefinitions']
def get_format_data(data, type_):
info_url = traverse_obj(data, (lambda _, v: v['format'] == type_, 'videoUrl', {url_or_none}, any))
def get_format_data(data, stream_type):
info_url = traverse_obj(data, (lambda _, v: v['format'] == stream_type, 'videoUrl', {url_or_none}, any))
if not info_url:
return []
return traverse_obj(
self._download_json(info_url, video_id, f'Downloading {type_} info JSON', fatal=False),
lambda _, v: v['format'] == type_ and url_or_none(v['videoUrl']))
self._download_json(info_url, video_id, f'Downloading {stream_type} info JSON', fatal=False),
lambda _, v: v['format'] == stream_type and url_or_none(v['videoUrl']))
formats = []
# Try to extract only the actual master m3u8 first, avoiding the duplicate single resolution "master" m3u8s