From 36147a63e32a62e61fe032e50249a2de456fa758 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Thu, 4 Mar 2021 23:59:37 +0530 Subject: [PATCH] [trovo] Pass origin header (Closes #139) Fixes: https://github.com/ytdl-org/youtube-dl/issues/28346 --- yt_dlp/extractor/trovo.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/yt_dlp/extractor/trovo.py b/yt_dlp/extractor/trovo.py index 43745213d..0e842b9ca 100644 --- a/yt_dlp/extractor/trovo.py +++ b/yt_dlp/extractor/trovo.py @@ -14,6 +14,7 @@ class TrovoBaseIE(InfoExtractor): _VALID_URL_BASE = r'https?://(?:www\.)?trovo\.live/' + _HEADERS = {'Origin': 'https://trovo.live'} def _extract_streamer_info(self, data): streamer_info = data.get('streamerInfo') or {} @@ -68,6 +69,7 @@ def _real_extract(self, url): 'format_id': format_id, 'height': int_or_none(format_id[:-1]) if format_id else None, 'url': play_url, + 'http_headers': self._HEADERS, }) self._sort_formats(formats) @@ -153,6 +155,7 @@ def _real_extract(self, url): 'protocol': 'm3u8_native', 'tbr': int_or_none(play_info.get('bitrate')), 'url': play_url, + 'http_headers': self._HEADERS, }) self._sort_formats(formats)