From c7e4ab278a19e0d4e0eb9626660a4634df964364 Mon Sep 17 00:00:00 2001 From: Lesmiscore Date: Mon, 7 Nov 2022 14:56:28 +0900 Subject: [PATCH] [extractor/niconico] Always use HTTPS for requests This prevents MITM attacks from malicious parties like insane ISPs Closes #5469 --- yt_dlp/extractor/niconico.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yt_dlp/extractor/niconico.py b/yt_dlp/extractor/niconico.py index 82b60b476..e131b044a 100644 --- a/yt_dlp/extractor/niconico.py +++ b/yt_dlp/extractor/niconico.py @@ -231,7 +231,7 @@ def _get_heartbeat_info(self, info_dict): or self._parse_json( self._html_search_regex( 'data-api-data="([^"]+)"', - self._download_webpage('http://www.nicovideo.jp/watch/' + video_id, video_id), + self._download_webpage('https://www.nicovideo.jp/watch/' + video_id, video_id), 'API data', default='{}'), video_id)) @@ -390,7 +390,7 @@ def _real_extract(self, url): try: webpage, handle = self._download_webpage_handle( - 'http://www.nicovideo.jp/watch/' + video_id, video_id) + 'https://www.nicovideo.jp/watch/' + video_id, video_id) if video_id.startswith('so'): video_id = self._match_id(handle.geturl()) @@ -728,7 +728,7 @@ def _entries(self, url, item_id, query=None, note='Downloading page %(page)s'): webpage = self._download_webpage(url, item_id, query=query, note=note % {'page': page_num}) results = re.findall(r'(?<=data-video-id=)["\']?(?P.*?)(?=["\'])', webpage) for item in results: - yield self.url_result(f'http://www.nicovideo.jp/watch/{item}', 'Niconico', item) + yield self.url_result(f'https://www.nicovideo.jp/watch/{item}', 'Niconico', item) if not results: break