1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-09-03 00:25:08 +00:00

[generic] Allow further processing of json_ld URL

Closes #2578
This commit is contained in:
pukkandan
2022-02-02 07:28:01 +05:30
parent d16df59db5
commit 85553414ae
2 changed files with 6 additions and 3 deletions

View File

@ -3815,13 +3815,16 @@ class GenericIE(InfoExtractor):
# Looking for http://schema.org/VideoObject
json_ld = self._search_json_ld(webpage, video_id, default={})
if json_ld.get('url'):
if json_ld.get('url') not in (url, None):
self.report_detected('JSON LD')
if determine_ext(json_ld.get('url')) == 'm3u8':
if determine_ext(json_ld['url']) == 'm3u8':
json_ld['formats'], json_ld['subtitles'] = self._extract_m3u8_formats_and_subtitles(
json_ld['url'], video_id, 'mp4')
json_ld.pop('url')
self._sort_formats(json_ld['formats'])
else:
json_ld['_type'] = 'url_transparent'
json_ld['url'] = smuggle_url(json_ld['url'], {'force_videoid': video_id, 'to_generic': True})
return merge_dicts(json_ld, info_dict)
def check_video(vurl):