Browse Source

[extractor/generic] Extract from LD-JSON last of all

Previous sources may contain several formats, e.g. http://tamasha.com/v/PgGZ
master-ytdl-org
Sergey M․ 7 years ago
parent
commit
ff17be3ac9
No known key found for this signature in database GPG Key ID: 2C393E0F18A9236D
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      youtube_dl/extractor/generic.py

+ 6
- 6
youtube_dl/extractor/generic.py View File

@ -2871,12 +2871,6 @@ class GenericIE(InfoExtractor):
merged[k] = v
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
entries = self._parse_html5_media_entries(url, webpage, video_id, m3u8_id='hls')
if entries:
@ -2895,6 +2889,12 @@ class GenericIE(InfoExtractor):
jwplayer_data, video_id, require_title=False, base_url=url)
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):
if YoutubeIE.suitable(vurl):
return True


Loading…
Cancel
Save