소스 검색

[twitch] Add new source format detection approach (closes #19193)

Sergey M․ 6 년 전
부모
커밋
985637cbbf
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      youtube_dl/extractor/twitch.py

+ 6 - 1
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)