]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[extractor/generic] Extract from LD-JSON last of all
authorSergey M․ <dstftw@gmail.com>
Sat, 26 Aug 2017 20:27:20 +0000 (03:27 +0700)
committerSergey M․ <dstftw@gmail.com>
Sat, 26 Aug 2017 20:31:40 +0000 (03:31 +0700)
Previous sources may contain several formats, e.g. http://tamasha.com/v/PgGZ

youtube_dl/extractor/generic.py

index 49b00b87ee86bc31eec17a2a8712abae01491f44..c81efdc005f848450c91f53b160e9c2da29cd8be 100644 (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