mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-08-23 12:58:30 +00:00
[ie/rule34video] Properly fall back to JSON-LD info
This commit is contained in:
parent
7b336d1e73
commit
f44a01bf67
@ -9,6 +9,7 @@
|
|||||||
get_element_html_by_class,
|
get_element_html_by_class,
|
||||||
get_elements_by_class,
|
get_elements_by_class,
|
||||||
int_or_none,
|
int_or_none,
|
||||||
|
merge_dicts,
|
||||||
parse_count,
|
parse_count,
|
||||||
parse_duration,
|
parse_duration,
|
||||||
unescapeHTML,
|
unescapeHTML,
|
||||||
@ -92,8 +93,7 @@ def _real_extract(self, url):
|
|||||||
uploader = clean_html(uploader_link)
|
uploader = clean_html(uploader_link)
|
||||||
uploader_url = extract_attributes(uploader_link or '').get('href')
|
uploader_url = extract_attributes(uploader_link or '').get('href')
|
||||||
|
|
||||||
return {
|
json_ld = traverse_obj(self._search_json_ld(webpage, video_id, default={}), ({
|
||||||
**traverse_obj(self._search_json_ld(webpage, video_id, default={}), ({
|
|
||||||
'title': 'title',
|
'title': 'title',
|
||||||
'view_count': 'view_count',
|
'view_count': 'view_count',
|
||||||
'like_count': 'like_count',
|
'like_count': 'like_count',
|
||||||
@ -101,7 +101,9 @@ def _real_extract(self, url):
|
|||||||
'timestamp': 'timestamp',
|
'timestamp': 'timestamp',
|
||||||
'description': 'description',
|
'description': 'description',
|
||||||
'thumbnail': ('thumbnails', 0, 'url'),
|
'thumbnail': ('thumbnails', 0, 'url'),
|
||||||
})),
|
}))
|
||||||
|
|
||||||
|
return merge_dicts({
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
'title': self._html_extract_title(webpage),
|
'title': self._html_extract_title(webpage),
|
||||||
@ -121,4 +123,4 @@ def _real_extract(self, url):
|
|||||||
'categories': categories,
|
'categories': categories,
|
||||||
'tags': list(map(unescapeHTML, re.findall(
|
'tags': list(map(unescapeHTML, re.findall(
|
||||||
r'<a class="tag_item"[^>]+\bhref="https://rule34video\.com/tags/\d+/"[^>]*>(?P<tag>[^>]*)</a>', webpage))),
|
r'<a class="tag_item"[^>]+\bhref="https://rule34video\.com/tags/\d+/"[^>]*>(?P<tag>[^>]*)</a>', webpage))),
|
||||||
}
|
}, json_ld)
|
||||||
|
Loading…
Reference in New Issue
Block a user