mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-26 02:55:17 +00:00
[extractor/generic] Extract from LD-JSON last of all
Previous sources may contain several formats, e.g. http://tamasha.com/v/PgGZ
This commit is contained in:
parent
1ed4549942
commit
ff17be3ac9
1 changed files with 6 additions and 6 deletions
|
@ -2871,12 +2871,6 @@ def merge_dicts(dict1, dict2):
|
||||||
merged[k] = v
|
merged[k] = v
|
||||||
return merged
|
return merged
|
||||||
|
|
||||||
# Looking for http://schema.org/VideoObject
|
|
||||||
json_ld = self._search_json_ld(
|
|
||||||
webpage, video_id, default={}, expected_type='VideoObject')
|
|
||||||
if json_ld.get('url'):
|
|
||||||
return merge_dicts(json_ld, info_dict)
|
|
||||||
|
|
||||||
# Look for HTML5 media
|
# Look for HTML5 media
|
||||||
entries = self._parse_html5_media_entries(url, webpage, video_id, m3u8_id='hls')
|
entries = self._parse_html5_media_entries(url, webpage, video_id, m3u8_id='hls')
|
||||||
if entries:
|
if entries:
|
||||||
|
@ -2895,6 +2889,12 @@ def merge_dicts(dict1, dict2):
|
||||||
jwplayer_data, video_id, require_title=False, base_url=url)
|
jwplayer_data, video_id, require_title=False, base_url=url)
|
||||||
return merge_dicts(info, info_dict)
|
return merge_dicts(info, info_dict)
|
||||||
|
|
||||||
|
# Looking for http://schema.org/VideoObject
|
||||||
|
json_ld = self._search_json_ld(
|
||||||
|
webpage, video_id, default={}, expected_type='VideoObject')
|
||||||
|
if json_ld.get('url'):
|
||||||
|
return merge_dicts(json_ld, info_dict)
|
||||||
|
|
||||||
def check_video(vurl):
|
def check_video(vurl):
|
||||||
if YoutubeIE.suitable(vurl):
|
if YoutubeIE.suitable(vurl):
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in a new issue