Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to download m3u8 information: HTTP Error 401: Unauthorized #11

Closed
mishoops opened this issue Jan 12, 2024 · 3 comments
Closed

Failed to download m3u8 information: HTTP Error 401: Unauthorized #11

mishoops opened this issue Jan 12, 2024 · 3 comments

Comments

@mishoops
Copy link

mishoops commented Jan 12, 2024

Hi, I'm getting the following issue downloading videos. I filled in both embed_url and referer fields:

[generic] video: Downloading webpage
[generic] video: Downloading m3u8 information
ERROR: [generic] Failed to download m3u8 information: 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 "/Users/michal/.pyenv/versions/3.8.6/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 4082, in urlopen
    return self._request_director.send(req)
  File "/Users/michal/.pyenv/versions/3.8.6/lib/python3.8/site-packages/yt_dlp/networking/common.py", line 114, in send
    response = handler.send(request)
  File "/Users/michal/.pyenv/versions/3.8.6/lib/python3.8/site-packages/yt_dlp/networking/_helper.py", line 204, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/michal/.pyenv/versions/3.8.6/lib/python3.8/site-packages/yt_dlp/networking/common.py", line 325, in send
    return self._send(request)
  File "/Users/michal/.pyenv/versions/3.8.6/lib/python3.8/site-packages/yt_dlp/networking/_requests.py", line 343, in _send
    raise HTTPError(res, redirect_loop=max_redirects_exceeded)
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 "/Users/michal/.pyenv/versions/3.8.6/lib/python3.8/site-packages/yt_dlp/extractor/common.py", line 850, in _request_webpage
    return self._downloader.urlopen(self._create_request(url_or_request, data, headers, query))
  File "/Users/michal/.pyenv/versions/3.8.6/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 4114, 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 "/Users/michal/.pyenv/versions/3.8.6/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 1587, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/michal/.pyenv/versions/3.8.6/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 1722, in __extract_info
    ie_result = ie.extract(url)
  File "/Users/michal/.pyenv/versions/3.8.6/lib/python3.8/site-packages/yt_dlp/extractor/common.py", line 718, in extract
    ie_result = self._real_extract(url)
  File "/Users/michal/.pyenv/versions/3.8.6/lib/python3.8/site-packages/yt_dlp/extractor/generic.py", line 2420, in _real_extract
    formats, subtitles = self._extract_m3u8_formats_and_subtitles(url, video_id, 'mp4', headers=headers)
  File "/Users/michal/.pyenv/versions/3.8.6/lib/python3.8/site-packages/yt_dlp/extractor/common.py", line 1968, in _extract_m3u8_formats_and_subtitles
    res = self._download_webpage_handle(
  File "/Users/michal/.pyenv/versions/3.8.6/lib/python3.8/site-packages/yt_dlp/extractor/common.py", line 906, in _download_webpage_handle
    urlh = self._request_webpage(url_or_request, video_id, note, errnote, fatal, data=data, headers=headers, query=query, expected_status=expected_status)
  File "/Users/michal/.pyenv/versions/3.8.6/lib/python3.8/site-packages/yt_dlp/extractor/common.py", line 863, in _request_webpage
    raise ExtractorError(errmsg, cause=err)
yt_dlp.utils.ExtractorError: [generic] Failed to download m3u8 information: 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 "b-cdn-drm-vod-dl.py", line 188, in <module>
    video.download()
  File "b-cdn-drm-vod-dl.py", line 174, in download
    ydl.download(url)
  File "/Users/michal/.pyenv/versions/3.8.6/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 3541, in download
    self.__download_wrapper(self.extract_info)(
  File "/Users/michal/.pyenv/versions/3.8.6/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 3516, in wrapper
    res = func(*args, **kwargs)
  File "/Users/michal/.pyenv/versions/3.8.6/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 1576, in extract_info
    return self.__extract_info(url, self.get_info_extractor(key), download, extra_info, process)
  File "/Users/michal/.pyenv/versions/3.8.6/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 1605, in wrapper
    self.report_error(str(e), e.format_traceback())
  File "/Users/michal/.pyenv/versions/3.8.6/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 1054, in report_error
    self.trouble(f'{self._format_err("ERROR:", self.Styles.ERROR)} {message}', *args, **kwargs)
  File "/Users/michal/.pyenv/versions/3.8.6/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 993, in trouble
    raise DownloadError(message, exc_info)
yt_dlp.utils.DownloadError: ERROR: [generic] Failed to download m3u8 information: 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```

`Latest version: [email protected] from yt-dlp/yt-dlp
yt-dlp is up to date ([email protected] from yt-dlp/yt-dlp)`
@mishoops
Copy link
Author

mishoops commented Jan 16, 2024

i tried it again and again and again, one right after another, and after running "python3 b-cdn-drm-vod-dl.py" unsuccessful 4 times (with error 401), it started to work on the 5th run, i will check if there is maybe a timeout issue or something

@MaZED-UP
Copy link
Collaborator

In that case, increase the ping time.

        for i in range(0, 29, 4):  # first 28 seconds, arbitrary

Replace 29 in the program file with a higher value in the prepare_dl method.

@mishoops
Copy link
Author

thanks, that solved the problem, i put it to 40 and no 401s anymore, some odd timeouts but in the end it downloads:
[download] Destination: /Users/michal/Videos/Bunny CDN/.BTC PAF 07B Starting Out v2/BTC PAF 07B Starting Out v2 [download] 92.5% of ~ 96.97MiB at 3.71MiB/s ETA 00:03 (frag 259/281)[download] Got error: HTTPSConnectionPool(host='vz-acc7608b-fa3.b-cdn.net', port=443): Read timed out. (read timeout=20.0). Retrying (1/inf)... [download] 99.2% of ~ 96.54MiB at 4.00MiB/s ETA 00:00 (frag 280/281)[download] Got error: HTTPSConnectionPool(host='vz-acc7608b-fa3.b-cdn.net', port=443): Read timed out. (read timeout=20.0). Retrying (1/inf)... [download] 100% of 96.14MiB in 00:01:02 at 1.55MiB/s [MoveFiles] Moving file "/Users/michal/Videos/Bunny CDN/.BTC PAF 07B Starting Out v2/BTC PAF 07B Starting Out v2" to "/Users/michal/Videos/Bunny CDN/BTC PAF 07B Starting Out v2"

Repository owner locked and limited conversation to collaborators Jan 16, 2024
@MaZED-UP MaZED-UP pinned this issue Jan 16, 2024
Repository owner deleted a comment from mishoops Jan 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants