mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-07 20:30:41 -05:00
[ie/youtube] Fix like_count
extraction (#8763)
Closes #8759 Authored by: Ganesh910
This commit is contained in:
parent
298230e550
commit
6b5d93b0b0
1 changed files with 7 additions and 8 deletions
|
@ -4480,14 +4480,13 @@ def process_language(container, base_url, lang_code, sub_name, query):
|
|||
if mobj:
|
||||
info[mobj.group('type') + '_count'] = str_to_int(mobj.group('count'))
|
||||
break
|
||||
sbr_tooltip = try_get(
|
||||
vpir, lambda x: x['sentimentBar']['sentimentBarRenderer']['tooltip'])
|
||||
if sbr_tooltip:
|
||||
like_count, dislike_count = sbr_tooltip.split(' / ')
|
||||
info.update({
|
||||
'like_count': str_to_int(like_count),
|
||||
'dislike_count': str_to_int(dislike_count),
|
||||
})
|
||||
|
||||
info['like_count'] = traverse_obj(vpir, (
|
||||
'videoActions', 'menuRenderer', 'topLevelButtons', ...,
|
||||
'segmentedLikeDislikeButtonViewModel', 'likeButtonViewModel', 'likeButtonViewModel',
|
||||
'toggleButtonViewModel', 'toggleButtonViewModel', 'defaultButtonViewModel',
|
||||
'buttonViewModel', 'accessibilityText', {parse_count}), get_all=False)
|
||||
|
||||
vcr = traverse_obj(vpir, ('viewCount', 'videoViewCountRenderer'))
|
||||
if vcr:
|
||||
vc = self._get_count(vcr, 'viewCount')
|
||||
|
|
Loading…
Reference in a new issue