From c999bac02c5a4f755b2a82488a975e91c988ffd8 Mon Sep 17 00:00:00 2001 From: bashonly Date: Fri, 17 May 2024 23:44:11 -0500 Subject: [PATCH] Bugfix for 61b17437dc14a1c7e90ff48a6198df77828c6df4 Authored by: bashonly --- yt_dlp/extractor/common.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py index e232aa883a..a952828fba 100644 --- a/yt_dlp/extractor/common.py +++ b/yt_dlp/extractor/common.py @@ -1036,13 +1036,14 @@ def _webpage_read_content(self, urlh, url_or_request, video_id, note=None, errno webpage_bytes = urlh.read() if prefix is not None: webpage_bytes = prefix + webpage_bytes - url_or_request = self._create_request(url_or_request, data) if self.get_param('dump_intermediate_pages', False): self.to_screen('Dumping request to ' + urlh.url) dump = base64.b64encode(webpage_bytes).decode('ascii') self._downloader.to_screen(dump) if self.get_param('write_pages'): - filename = self._request_dump_filename(urlh.url, video_id, url_or_request.data) + if isinstance(url_or_request, Request): + data = self._create_request(url_or_request, data).data + filename = self._request_dump_filename(urlh.url, video_id, data) self.to_screen(f'Saving request to {filename}') with open(filename, 'wb') as outf: outf.write(webpage_bytes)