A hacky way to achieve this goal is edit the code as follows:
Thanks, but unfortunately, this doesn't work. Showing error:
[generic] Extracting URL: https://iframe.mediadelivery.net/9d8f8626-6059-4e7c-a166-b6888ebc730f/1280x720/video.drm?contextI...08-8a08-a97634d81847
[generic] video: Downloading webpage
ERROR: [generic] Unable to download webpage: HTTP Error 401: Unauthorized (caused by <HTTPError 401: Unauthorized>); please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U
Traceback (most recent call last):
File "C:\Python39\lib\site-packages\yt_dlp\networking\_urllib.py", line 396, in _send
res = opener.open(urllib_req, timeout=float(request.extensions.get('timeout') or self.timeout))
File "C:\Python39\lib\urllib\request.py", line 523, in open
response = meth(req, response)
File "C:\Python39\lib\urllib\request.py", line 632, in http_response
response = self.parent.error(
File "C:\Python39\lib\urllib\request.py", line 561, in error
return self._call_chain(*args)
File "C:\Python39\lib\urllib\request.py", line 494, in _call_chain
result = func(*args)
File "C:\Python39\lib\urllib\request.py", line 641, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 401: Unauthorized
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Python39\lib\site-packages\yt_dlp\YoutubeDL.py", line 4052, in urlopen
return self._request_director.send(req)
File "C:\Python39\lib\site-packages\yt_dlp\networking\common.py", line 114, in send
response = handler.send(request)
File "C:\Python39\lib\site-packages\yt_dlp\networking\_helper.py", line 204, in wrapper
return func(self, *args, **kwargs)
File "C:\Python39\lib\site-packages\yt_dlp\networking\common.py", line 325, in send
return self._send(request)
File "C:\Python39\lib\site-packages\yt_dlp\networking\_urllib.py", line 401, in _send
raise HTTPError(UrllibResponseAdapter(e.fp), redirect_loop='redirect error' in str(e)) from e
yt_dlp.networking.exceptions.HTTPError: HTTP Error 401: Unauthorized
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Python39\lib\site-packages\yt_dlp\extractor\common.py", line 847, in _request_webpage
return self._downloader.urlopen(self._create_request(url_or_request, data, headers, query))
File "C:\Python39\lib\site-packages\yt_dlp\YoutubeDL.py", line 4074, in urlopen
raise _CompatHTTPError(e) from e
yt_dlp.networking.exceptions._CompatHTTPError: HTTP Error 401: Unauthorized
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python39\lib\site-packages\yt_dlp\YoutubeDL.py", line 1567, in wrapper
return func(self, *args, **kwargs)
File "C:\Python39\lib\site-packages\yt_dlp\YoutubeDL.py", line 1702, in __extract_info
ie_result = ie.extract(url)
File "C:\Python39\lib\site-packages\yt_dlp\extractor\common.py", line 715, in extract
ie_result = self._real_extract(url)
File "C:\Python39\lib\site-packages\yt_dlp\extractor\generic.py", line 2439, in _real_extract
full_response = self._request_webpage(url, video_id, headers=filter_dict({
File "C:\Python39\lib\site-packages\yt_dlp\extractor\common.py", line 860, in _request_webpage
raise ExtractorError(errmsg, cause=err)
yt_dlp.utils.ExtractorError: [generic] Unable to download webpage: HTTP Error 401: Unauthorized (caused by <HTTPError 401: Unauthorized>); please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "i:\DownloadVideo\script.py", line 188, in <module>
video.download()
File "i:\DownloadVideo\script.py", line 174, in download
ydl.download(url)
File "C:\Python39\lib\site-packages\yt_dlp\YoutubeDL.py", line 3511, in download
self.__download_wrapper(self.extract_info)(
File "C:\Python39\lib\site-packages\yt_dlp\YoutubeDL.py", line 3486, in wrapper
res = func(*args, **kwargs)
File "C:\Python39\lib\site-packages\yt_dlp\YoutubeDL.py", line 1556, in extract_info
return self.__extract_info(url, self.get_info_extractor(key), download, extra_info, process)
File "C:\Python39\lib\site-packages\yt_dlp\YoutubeDL.py", line 1585, in wrapper
self.report_error(str(e), e.format_traceback())
File "C:\Python39\lib\site-packages\yt_dlp\YoutubeDL.py", line 1045, in report_error
self.trouble(f'{self._format_err("ERROR:", self.Styles.ERROR)} {message}', *args, **kwargs)
File "C:\Python39\lib\site-packages\yt_dlp\YoutubeDL.py", line 984, in trouble
raise DownloadError(message, exc_info)
yt_dlp.utils.DownloadError: ERROR: [generic] Unable to download webpage: HTTP Error 401: Unauthorized (caused by <HTTPError 401: Unauthorized>); please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U```
Additionally: With default max resolution script is working, but not correct. Somehow script delete some already downloaded parts, usually first 10–15 parts. This caused a problem on the final stage, when all parts must be combined in one video file, script can't merge video.