diff --git a/yt_dlp/downloader/bunnycdn.py b/yt_dlp/downloader/bunnycdn.py index a09ebb6d6..1a5a1c03f 100644 --- a/yt_dlp/downloader/bunnycdn.py +++ b/yt_dlp/downloader/bunnycdn.py @@ -38,8 +38,7 @@ def send_ping(): request = Request( f'{ping_url}?hash={md5_hash}&time={time}&paused={paused}&resolution={res}', - headers=headers, - ) + headers=headers) try: self.ydl.urlopen(request).read() diff --git a/yt_dlp/extractor/bunnycdn.py b/yt_dlp/extractor/bunnycdn.py index 18ab0d025..d78753384 100644 --- a/yt_dlp/extractor/bunnycdn.py +++ b/yt_dlp/extractor/bunnycdn.py @@ -104,7 +104,9 @@ def _real_extract(self, url): query=traverse_obj(parse_qs(url), {'token': 'token', 'expires': 'expires'})) if html_title := self._html_extract_title(webpage, default=None) == '403': - raise ExtractorError('This video is inaccessible. Setting a Referer header might be required to access the video', expected=True) + raise ExtractorError( + 'This video is inaccessible. Setting a Referer header ' + 'might be required to access the video', expected=True) elif html_title == '404': raise ExtractorError('This video does not exist', expected=True) @@ -127,7 +129,7 @@ def _real_extract(self, url): 'quality': 1, 'http_headers': headers, 'ext': urlhandle_detect_ext(urlh, default='mp4'), - 'filesize': int_or_none(urlh.headers.get('Content-Length')), + 'filesize': int_or_none(urlh.get_header('Content-Length')), }) # MediaCage Streams require activation and pings