Compare commits

..

2 Commits

Author SHA1 Message Date
Ganesh910
0b7a1c3b5e made the edited code flake8 compliant 2023-12-13 10:26:51 +05:30
Ganesh910
1e33f1f307 used traverse_obj to fetch like_count 2023-12-13 09:35:13 +05:30

View File

@ -4481,13 +4481,11 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
info[mobj.group('type') + '_count'] = str_to_int(mobj.group('count'))
break
match = re.search(
r'\b(\d+)\b',
vpir['videoActions']['menuRenderer']['topLevelButtons'][0]
['segmentedLikeDislikeButtonViewModel']['likeButtonViewModel']
['likeButtonViewModel']['toggleButtonViewModel']['toggleButtonViewModel']
['defaultButtonViewModel']['buttonViewModel']['accessibilityText'])
info['like_count'] = str_to_int(match.group(1))
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: