From fe29c67a14839ecd7c4b7206c5bb70ed85cd6fc2 Mon Sep 17 00:00:00 2001 From: Mozi <29089388+pzhlkj6612@users.noreply.github.com> Date: Sun, 26 May 2024 16:03:48 +0000 Subject: [PATCH] use urllib.parse.urlparse() --- yt_dlp/extractor/niconico.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yt_dlp/extractor/niconico.py b/yt_dlp/extractor/niconico.py index a66b78ea1..5d8b1e781 100644 --- a/yt_dlp/extractor/niconico.py +++ b/yt_dlp/extractor/niconico.py @@ -1013,7 +1013,7 @@ class NiconicoLiveIE(InfoExtractor): def _real_extract(self, url): video_id = self._match_id(url) webpage, urlh = self._download_webpage_handle(f'https://live.nicovideo.jp/watch/{video_id}', video_id) - headers = {'Origin': 'https://' + remove_start(urlparse(urlh.url).hostname, 'sp.')} + headers = {'Origin': 'https://' + remove_start(urllib.parse.urlparse(urlh.url).hostname, 'sp.')} embedded_data = self._parse_json(unescapeHTML(self._search_regex( r'