mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-07 20:30:41 -05:00
[extractor/youtube] Fix video like count extraction
Support new combined button layout Authored by: coletdjnz
This commit is contained in:
parent
ae1035646a
commit
3ffb2f5bea
1 changed files with 18 additions and 13 deletions
|
@ -3911,7 +3911,12 @@ def process_language(container, base_url, lang_code, sub_name, query):
|
||||||
vpir,
|
vpir,
|
||||||
lambda x: x['videoActions']['menuRenderer']['topLevelButtons'],
|
lambda x: x['videoActions']['menuRenderer']['topLevelButtons'],
|
||||||
list) or []):
|
list) or []):
|
||||||
tbr = tlb.get('toggleButtonRenderer') or {}
|
tbrs = variadic(
|
||||||
|
traverse_obj(
|
||||||
|
tlb, 'toggleButtonRenderer',
|
||||||
|
('segmentedLikeDislikeButtonRenderer', ..., 'toggleButtonRenderer'),
|
||||||
|
default=[]))
|
||||||
|
for tbr in tbrs:
|
||||||
for getter, regex in [(
|
for getter, regex in [(
|
||||||
lambda x: x['defaultText']['accessibility']['accessibilityData'],
|
lambda x: x['defaultText']['accessibility']['accessibilityData'],
|
||||||
r'(?P<count>[\d,]+)\s*(?P<type>(?:dis)?like)'), ([
|
r'(?P<count>[\d,]+)\s*(?P<type>(?:dis)?like)'), ([
|
||||||
|
|
Loading…
Reference in a new issue