diff options
author | Tom-Oliver Heidel <blackjack4494@web.de> | 2020-10-07 05:22:31 +0200 |
---|---|---|
committer | Tom-Oliver Heidel <blackjack4494@web.de> | 2020-10-07 05:22:31 +0200 |
commit | 044ecf795d155ff8bea995fa769a177b0a638a7b (patch) | |
tree | 841fc24affb28fdec2d677d5f5cb557c80e014dd | |
parent | 929eeb1e01e38bb71eb6b2b69e7db41a8f957f24 (diff) | |
parent | b84071c0a914d271b1bee475628150990daae905 (diff) | |
download | hypervideo-pre-044ecf795d155ff8bea995fa769a177b0a638a7b.tar.lz hypervideo-pre-044ecf795d155ff8bea995fa769a177b0a638a7b.tar.xz hypervideo-pre-044ecf795d155ff8bea995fa769a177b0a638a7b.zip |
Merge branch 'feature_subscriber_count' of https://github.com/RedpointsBots/youtube-dl into RedpointsBots-feature_subscriber_count
-rw-r--r-- | youtube_dlc/extractor/youtube.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/youtube_dlc/extractor/youtube.py b/youtube_dlc/extractor/youtube.py index a6b567e83..67bf228a8 100644 --- a/youtube_dlc/extractor/youtube.py +++ b/youtube_dlc/extractor/youtube.py @@ -39,6 +39,7 @@ from ..utils import ( mimetype2ext, orderedSet, parse_codecs, + parse_count, parse_duration, remove_quotes, remove_start, @@ -2450,6 +2451,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): @@ -2587,6 +2596,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor): 'album': album, 'release_date': release_date, 'release_year': release_year, + 'subscriber_count': subscriber_count, } |