summary refs log tree commit diff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2019-02-12 00:13:50 +0700
committerSergey M․ <dstftw@gmail.com>2019-02-12 00:13:50 +0700
commit985637cbbfc1a79091eb2f5ca4afec84f6616c75 (patch)
treebb7b5dd4fb6c1556e400f8f195861a68aaad49f4
parent7d8b89163c43dfec27dab5250183e52fce838389 (diff)
downloadyoutube-dl-985637cbbfc1a79091eb2f5ca4afec84f6616c75.tar.gz
youtube-dl-985637cbbfc1a79091eb2f5ca4afec84f6616c75.tar.xz
youtube-dl-985637cbbfc1a79091eb2f5ca4afec84f6616c75.zip
[twitch] Add new source format detection approach (closes #19193)
-rw-r--r--youtube_dl/extractor/twitch.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/youtube_dl/extractor/twitch.py b/youtube_dl/extractor/twitch.py
index 401615683..8c87f6dd3 100644
--- a/youtube_dl/extractor/twitch.py
+++ b/youtube_dl/extractor/twitch.py
@@ -136,7 +136,12 @@ class TwitchBaseIE(InfoExtractor):
             source = next(f for f in formats if f['format_id'] == 'Source')
             source['preference'] = 10
         except StopIteration:
-            pass  # No Source stream present
+            for f in formats:
+                if '/chunked/' in f['url']:
+                    f.update({
+                        'source_preference': 10,
+                        'format_note': 'Source',
+                    })
         self._sort_formats(formats)