ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
131.37k stars 9.95k forks source link

Dailymotion HTTPError 401 when cookies used #29898

Closed dominictarro closed 3 years ago

dominictarro commented 3 years ago

Dailymotion videos are failing to download when I include --cookies, despite including --no-check-certificate. If I remove those two arguments, everything runs fine.

Am I misunderstanding the --no-check-certificate argument, or shouldn't this skip on ahead to the download without the cookies?

mikael@locale:~$ youtube-dl --cookies /ssd/capture/yt_cookie_shared.txt --no-check-certificate -f 'best' "https://www.dailymotion.com/video/x77cr2w" --verbose
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--cookies', '/ssd/capture/yt_cookie_shared.txt', '--no-check-certificate', '-f', 'best', 'https://www.dailymotion.com/video/x77cr2w', '--verbose']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.06.06
[debug] Python version 3.8.10 (CPython) - Linux-5.11.0-25-generic-x86_64-with-glibc2.29
[debug] exe versions: ffmpeg 4.2.4, ffprobe 4.2.4, rtmpdump 2.4
[debug] Proxy map: {}
[dailymotion] x77cr2w: Downloading media JSON metadata
ERROR: Unable to download JSON metadata: HTTP Error 401: Unauthorized (caused by <HTTPError 401: 'Unauthorized'>); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
  File "/home/mikael/.local/lib/python3.8/site-packages/youtube_dl/extractor/common.py", line 634, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/home/mikael/.local/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 2288, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/usr/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
dirkf commented 3 years ago

--no-check-certificate allows yt-dl to make an HTTPS connection even if the site's digital certificate can't be verified.

If I remove those two arguments, everything runs fine.

"Doctor, it hurts when I hit myself with this hammer."

"So stop hitting yourself with the hammer."