aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/twitch.py
diff options
context:
space:
mode:
Diffstat (limited to 'youtube_dl/extractor/twitch.py')
-rw-r--r--youtube_dl/extractor/twitch.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/youtube_dl/extractor/twitch.py b/youtube_dl/extractor/twitch.py
index 87290d002..4b0d8988d 100644
--- a/youtube_dl/extractor/twitch.py
+++ b/youtube_dl/extractor/twitch.py
@@ -349,6 +349,13 @@ class TwitchStreamIE(TwitchBaseIE):
% (self._USHER_BASE, channel_id, compat_urllib_parse.urlencode(query).encode('utf-8')),
channel_id, 'mp4')
+ # prefer the 'source' stream, the others are limited to 30 fps
+ def _sort_source(f):
+ if f.get('m3u8_media') is not None and f['m3u8_media'].get('NAME') == 'Source':
+ return 1
+ return 0
+ formats = sorted(formats, key=_sort_source)
+
view_count = stream.get('viewers')
timestamp = parse_iso8601(stream.get('created_at'))