yt-dlp: Can't download password-protected Vimeo link / [vimeo] Unable to download JSON metadata: HTTP Error 400: Bad Request
DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE
- I understand that I will be blocked if I intentionally remove or skip any mandatory* field
Checklist
- I’m reporting that a supported site is broken
- I’ve verified that I’m running yt-dlp version 2023.03.04 (update instructions) or later (specify commit)
- I’ve checked that all provided URLs are playable in a browser with the same IP and same login details
- I’ve checked that all URLs and arguments with special characters are properly quoted or escaped
- I’ve searched known issues and the bugtracker for similar issues including closed ones. DO NOT post duplicates
- I’ve read the guidelines for opening an issue
- I’ve read about sharing account credentials and I’m willing to share it if required
Region
Germany
Provide a description that is worded well enough to be understood
Simple Vimeo link, passworded, ang getting a Bad Request JSON error.
Provide verbose output that clearly demonstrates the problem
- Run your yt-dlp command with -vU flag added (
yt-dlp -vU <your command line>) - If using API, add
'verbose': TruetoYoutubeDLparams instead - Copy the WHOLE output (starting with
[debug] Command-line config) and insert it below
Complete Verbose Output
[debug] Command-line config: ['https://vimeo.com/669743367/40c9ad2582', '--video-password', 'PRIVATE', '-vU']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2023.03.04 [392389b7d] (pip)
[debug] Python 3.11.2 (CPython x86_64 64bit) - macOS-13.1-x86_64-i386-64bit (OpenSSL 1.1.1t 7 Feb 2023)
[debug] exe versions: ffmpeg 5.1.2 (setts), ffprobe 5.1.2, phantomjs 2.1.1, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.17, brotli-1.0.9, certifi-2022.12.07, mutagen-1.46.0, sqlite3-2.6.0, websockets-10.4
[debug] Proxy map: {}
[debug] Loaded 1786 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Available version: stable@2023.03.04, Current version: stable@2023.03.04
yt-dlp is up to date (stable@2023.03.04)
[vimeo] Extracting URL: https://vimeo.com/669743367/40c9ad2582
[vimeo] 669743367: Downloading JSON metadata
[vimeo] 669743367: Downloading JSON metadata
ERROR: [vimeo] 669743367: Unable to download JSON metadata: HTTP Error 400: Bad Request (caused by <HTTPError 400: 'Bad Request'>); 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
File "/usr/local/Cellar/yt-dlp/2023.3.4/libexec/lib/python3.11/site-packages/yt_dlp/extractor/common.py", line 694, in extract
ie_result = self._real_extract(url)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/yt-dlp/2023.3.4/libexec/lib/python3.11/site-packages/yt_dlp/extractor/vimeo.py", line 825, in _real_extract
return self._extract_from_api(video_id, unlisted_hash)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/yt-dlp/2023.3.4/libexec/lib/python3.11/site-packages/yt_dlp/extractor/vimeo.py", line 756, in _extract_from_api
video = self._download_json(
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/yt-dlp/2023.3.4/libexec/lib/python3.11/site-packages/yt_dlp/extractor/common.py", line 1048, in download_content
res = getattr(self, download_handle.__name__)(url_or_request, video_id, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/yt-dlp/2023.3.4/libexec/lib/python3.11/site-packages/yt_dlp/extractor/common.py", line 1012, in download_handle
res = self._download_webpage_handle(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/yt-dlp/2023.3.4/libexec/lib/python3.11/site-packages/yt_dlp/extractor/common.py", line 882, 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 "/usr/local/Cellar/yt-dlp/2023.3.4/libexec/lib/python3.11/site-packages/yt_dlp/extractor/common.py", line 839, in _request_webpage
raise ExtractorError(errmsg, cause=err)
File "/usr/local/Cellar/yt-dlp/2023.3.4/libexec/lib/python3.11/site-packages/yt_dlp/extractor/common.py", line 821, in _request_webpage
return self._downloader.urlopen(self._create_request(url_or_request, data, headers, query))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/yt-dlp/2023.3.4/libexec/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 3742, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 525, in open
response = meth(req, response)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 634, in http_response
response = self.parent.error(
^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 563, in error
return self._call_chain(*args)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 496, in _call_chain
result = func(*args)
^^^^^^^^^^^
File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 643, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 28 (11 by maintainers)
Commits related to this issue
- [ie/vimeo] Fix password-protected video extraction (#10341) Closes #6603 Authored by: bashonly — committed to yt-dlp/yt-dlp by bashonly 2 years ago
I used
yt-dlp "https://vimeo.com/669743367" --referer "https://player.vimeo.com/video/669743367?h=40c9ad2582" --video-password _hidden_Possible workarounds:
https://vimeo.com/669743367https://player.vimeo.com/video/669743367?h=40c9ad2582and pass the--refererThe problem is that if the URL is in the form of
https://vimeo.com/{id}/{unlisted_hash}, the extractor does not do anything with the video password, it jumps right into trying to extract the video from the API.I can reproduce the issue with the password-protected youtube-dl test video if I add its unlisted hash to the URL:
https://github.com/yt-dlp/yt-dlp/pull/10341 should fix this, if anyone wants to try it
1) Download nightly build via https://github.com/yt-dlp/yt-dlp-nightly-builds/releases
2) Download ChromeCookieUnlock plugin ZIP via https://github.com/seproDev/yt-dlp-ChromeCookieUnlock/releases/tag/v2024.04.29
3) Create a folder called yt-dlp-plugins in the directory where yt-dlp.exe is located. Copy the yt-dlp-ChromeCookieUnlock folder into this folder.
4) Open the chrome browser and go the video link enter your password on the web site, after then run the below commands.
5) yt-dlp “https://vimeo.com/xxxxx” --video-password “password” --cookies-from-browser chrome
PS: sometimes it can fail, go to the page again, refresh and enter the password, play the video for a second or two and run the script.
Vimeo is using cloudflare fingerprinting for
vimeo.comURLs, which could be user-agent dependent. But it also could be that the relevant session cookie isn’t being exported from Firefox. You’d need to compare the cookiefile dumps to see.Session cookies aren’t written to the same location on disk as regular cookies, and they are supposed to be wiped every time you restart the browser (though Chrome doesn’t actually do this
because Google wants to rewrite the rules of the internet in its own image). This is why--cookies-from-browserwon’t work with Firefox/Safari session cookies.The crashes are coming from trying to download a large media file with curl_cffi, which is used as the file downloader’s request handler when you pass
--impersonate. So don’t pass it: If you have curl_cffi installed, you don’t need to pass--impersonate. Impersonation is baked in to the extractor now (hence the warning you get when curl_cffi isn’t installed).Using alternate URL worked fine for me:
yt-dlp https://player.vimeo.com/video/xxx --video-password xxx(instead of simple URL:yt-dlp https://vimeo.com/xxx --video-password xxx)Open issues are never too old to comment on