mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-02 06:27:21 +00:00
Revert "[extractor/pornhub] Remove fetch of /video/get_media for formats"
This reverts commit 9ecbbcd844
.
This commit is contained in:
parent
9ecbbcd844
commit
df8c550abe
|
@ -457,6 +457,18 @@ def add_format(format_url, height=None):
|
||||||
r'/(\d{6}/\d{2})/', video_url, 'upload data', default=None)
|
r'/(\d{6}/\d{2})/', video_url, 'upload data', default=None)
|
||||||
if upload_date:
|
if upload_date:
|
||||||
upload_date = upload_date.replace('/', '')
|
upload_date = upload_date.replace('/', '')
|
||||||
|
if '/video/get_media' in video_url:
|
||||||
|
medias = self._download_json(video_url, video_id, fatal=False)
|
||||||
|
if isinstance(medias, list):
|
||||||
|
for media in medias:
|
||||||
|
if not isinstance(media, dict):
|
||||||
|
continue
|
||||||
|
video_url = url_or_none(media.get('videoUrl'))
|
||||||
|
if not video_url:
|
||||||
|
continue
|
||||||
|
height = int_or_none(media.get('quality'))
|
||||||
|
add_format(video_url, height)
|
||||||
|
continue
|
||||||
add_format(video_url)
|
add_format(video_url)
|
||||||
|
|
||||||
model_profile = self._search_json(
|
model_profile = self._search_json(
|
||||||
|
|
Loading…
Reference in a new issue