mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-04 12:07:12 +01:00
[vimeo] Extract JSON LD (closes #16295)
This commit is contained in:
parent
e7e4a6e0f9
commit
ae1c585cee
@ -16,6 +16,7 @@
|
|||||||
ExtractorError,
|
ExtractorError,
|
||||||
InAdvancePagedList,
|
InAdvancePagedList,
|
||||||
int_or_none,
|
int_or_none,
|
||||||
|
merge_dicts,
|
||||||
NO_DEFAULT,
|
NO_DEFAULT,
|
||||||
RegexNotFoundError,
|
RegexNotFoundError,
|
||||||
sanitized_Request,
|
sanitized_Request,
|
||||||
@ -639,16 +640,18 @@ def is_rented():
|
|||||||
'preference': 1,
|
'preference': 1,
|
||||||
})
|
})
|
||||||
|
|
||||||
info_dict = self._parse_config(config, video_id)
|
info_dict_config = self._parse_config(config, video_id)
|
||||||
formats.extend(info_dict['formats'])
|
formats.extend(info_dict_config['formats'])
|
||||||
self._vimeo_sort_formats(formats)
|
self._vimeo_sort_formats(formats)
|
||||||
|
|
||||||
|
json_ld = self._search_json_ld(webpage, video_id, default={})
|
||||||
|
|
||||||
if not cc_license:
|
if not cc_license:
|
||||||
cc_license = self._search_regex(
|
cc_license = self._search_regex(
|
||||||
r'<link[^>]+rel=["\']license["\'][^>]+href=(["\'])(?P<license>(?:(?!\1).)+)\1',
|
r'<link[^>]+rel=["\']license["\'][^>]+href=(["\'])(?P<license>(?:(?!\1).)+)\1',
|
||||||
webpage, 'license', default=None, group='license')
|
webpage, 'license', default=None, group='license')
|
||||||
|
|
||||||
info_dict.update({
|
info_dict = {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
'timestamp': unified_timestamp(timestamp),
|
'timestamp': unified_timestamp(timestamp),
|
||||||
@ -658,7 +661,9 @@ def is_rented():
|
|||||||
'like_count': like_count,
|
'like_count': like_count,
|
||||||
'comment_count': comment_count,
|
'comment_count': comment_count,
|
||||||
'license': cc_license,
|
'license': cc_license,
|
||||||
})
|
}
|
||||||
|
|
||||||
|
info_dict = merge_dicts(info_dict, info_dict_config, json_ld)
|
||||||
|
|
||||||
return info_dict
|
return info_dict
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user