From 19ee7e154343be08a454d8c89336eae5715c4a35 Mon Sep 17 00:00:00 2001 From: Aakash Gajjar Date: Thu, 17 Sep 2020 11:04:25 +0530 Subject: [PATCH] fix(tiktok): use `Referer` header in requests Signed-off-by: Aakash Gajjar --- youtube_dl/extractor/tiktok.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/tiktok.py b/youtube_dl/extractor/tiktok.py index 075a2cdf9..6392c3963 100644 --- a/youtube_dl/extractor/tiktok.py +++ b/youtube_dl/extractor/tiktok.py @@ -37,7 +37,10 @@ class TikTokBaseIE(InfoExtractor): 'url': try_get(video_info, lambda x: x['video']['urls'][0]), 'ext': 'mp4', 'height': height, - 'width': width + 'width': width, + 'http_headers': { + 'Referer': self._og_search_url(webpage), + }, }) return {