]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[twitch] Add new source format detection approach (closes #19193)
authorSergey M․ <dstftw@gmail.com>
Mon, 11 Feb 2019 17:13:50 +0000 (00:13 +0700)
committerSergey M․ <dstftw@gmail.com>
Mon, 11 Feb 2019 17:13:50 +0000 (00:13 +0700)
youtube_dl/extractor/twitch.py

index 401615683dc9b22e4110a6db06dd959c524d96f9..8c87f6dd3bfde87fdb8d27935298a45f2861db47 100644 (file)
@@ -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)