mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-07 20:30:41 -05:00
[youtube] Added 'subscriber_count' to extraction
This commit is contained in:
parent
e8c5d40bc8
commit
b84071c0a9
1 changed files with 10 additions and 0 deletions
|
@ -39,6 +39,7 @@
|
||||||
mimetype2ext,
|
mimetype2ext,
|
||||||
orderedSet,
|
orderedSet,
|
||||||
parse_codecs,
|
parse_codecs,
|
||||||
|
parse_count,
|
||||||
parse_duration,
|
parse_duration,
|
||||||
remove_quotes,
|
remove_quotes,
|
||||||
remove_start,
|
remove_start,
|
||||||
|
@ -2421,6 +2422,14 @@ def _extract_count(count_name):
|
||||||
video_duration = parse_duration(self._html_search_meta(
|
video_duration = parse_duration(self._html_search_meta(
|
||||||
'duration', video_webpage, 'video duration'))
|
'duration', video_webpage, 'video duration'))
|
||||||
|
|
||||||
|
# Get Subscriber Count of channel
|
||||||
|
subscriber_count = parse_count(self._search_regex(
|
||||||
|
r'"text":"([\d\.]+\w?) subscribers"',
|
||||||
|
video_webpage,
|
||||||
|
'subscriber count',
|
||||||
|
default=None
|
||||||
|
))
|
||||||
|
|
||||||
# annotations
|
# annotations
|
||||||
video_annotations = None
|
video_annotations = None
|
||||||
if self._downloader.params.get('writeannotations', False):
|
if self._downloader.params.get('writeannotations', False):
|
||||||
|
@ -2558,6 +2567,7 @@ def decrypt_sig(mobj):
|
||||||
'album': album,
|
'album': album,
|
||||||
'release_date': release_date,
|
'release_date': release_date,
|
||||||
'release_year': release_year,
|
'release_year': release_year,
|
||||||
|
'subscriber_count': subscriber_count,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue