diff options
author | Joel Potts <jpotts@redpoints.com> | 2020-09-15 17:16:58 +0200 |
---|---|---|
committer | Joel Potts <jpotts@redpoints.com> | 2020-09-21 11:56:51 +0200 |
commit | b84071c0a914d271b1bee475628150990daae905 (patch) | |
tree | f3fa2d7351386d4d451b1ac8ccaf84a795f57d67 | |
parent | e8c5d40bc840b9e3ec8b4e8070291a64a4fa75b2 (diff) | |
download | hypervideo-pre-b84071c0a914d271b1bee475628150990daae905.tar.lz hypervideo-pre-b84071c0a914d271b1bee475628150990daae905.tar.xz hypervideo-pre-b84071c0a914d271b1bee475628150990daae905.zip |
[youtube] Added 'subscriber_count' to extraction
-rw-r--r-- | youtube_dl/extractor/youtube.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index 02f3ab61a..f0d2a8873 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -39,6 +39,7 @@ from ..utils import ( mimetype2ext, orderedSet, parse_codecs, + parse_count, parse_duration, remove_quotes, remove_start, @@ -2421,6 +2422,14 @@ class YoutubeIE(YoutubeBaseInfoExtractor): video_duration = parse_duration(self._html_search_meta( '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 video_annotations = None if self._downloader.params.get('writeannotations', False): @@ -2558,6 +2567,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor): 'album': album, 'release_date': release_date, 'release_year': release_year, + 'subscriber_count': subscriber_count, } |