ARDMediathek HTTP Error 412: Precondition Failed for some videos
See original GitHub issueChecklist
- I’m reporting a broken site support
- I’ve verified that I’m running youtube-dl version 2021.04.26
- I’ve checked that all provided URLs are alive and playable in a browser
- I’ve checked that all URLs and arguments with special characters are properly quoted or escaped
- I’ve searched the bugtracker for similar issues including closed ones
Verbose log
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--ignore-config', '-v', 'https://ardmediathek.de/video/feuer-und-flamme/feuer-und-flamme-s01-e01/wdr-fernsehen/Y3JpZDovL3dkci5kZS9CZWl0cmFnLTM1Y2IwM2VkLTNkOTgtNDBkZC1iZjIxLTU1ZjFjODE4MmFlNw/']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.04.26
[debug] Python version 3.9.4 (CPython) - Linux-5.12.0-1-MANJARO-x86_64-with-glibc2.33
[debug] exe versions: ffmpeg 4.3.2, ffprobe 4.3.2, rtmpdump 2.4
[debug] Proxy map: {}
[debug] Using fake IP 53.50.219.112 (DE) as X-Forwarded-For.
[ARDBetaMediathek] Y3JpZDovL3dkci5kZS9CZWl0cmFnLTM1Y2IwM2VkLTNkOTgtNDBkZC1iZjIxLTU1ZjFjODE4MmFlNw: Downloading JSON metadata
ERROR: Unable to download JSON metadata: HTTP Error 412: Precondition Failed (caused by <HTTPError 412: 'Precondition Failed'>); 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 "/usr/lib/python3.9/site-packages/youtube_dl/extractor/common.py", line 634, in _request_webpage
return self._downloader.urlopen(url_or_request)
File "/usr/lib/python3.9/site-packages/youtube_dl/YoutubeDL.py", line 2279, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "/usr/lib/python3.9/urllib/request.py", line 523, in open
response = meth(req, response)
File "/usr/lib/python3.9/urllib/request.py", line 632, in http_response
response = self.parent.error(
File "/usr/lib/python3.9/urllib/request.py", line 561, in error
return self._call_chain(*args)
File "/usr/lib/python3.9/urllib/request.py", line 494, in _call_chain
result = func(*args)
File "/usr/lib/python3.9/urllib/request.py", line 641, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
Description
Youtube-dl fails for some videos of the ARDMediathek. An example video is https://ardmediathek.de/video/feuer-und-flamme/feuer-und-flamme-s01-e01/wdr-fernsehen/Y3JpZDovL3dkci5kZS9CZWl0cmFnLTM1Y2IwM2VkLTNkOTgtNDBkZC1iZjIxLTU1ZjFjODE4MmFlNw/
Issue Analytics
- State:
- Created 2 years ago
- Comments:15
Top Results From Across the Web
412 Precondition Failed - HTTP - MDN Web Docs
The HyperText Transfer Protocol (HTTP) 412 Precondition Failed client error response code indicates that access to the target resource has been denied.
Read more >How to fix 412 (Precondition Failed) Error HTML5 Video Tag
I got a temporary solution which helped me to make it working. Here is my code in which I am appending milli-seconds to...
Read more >412 Precondition Failed error on setting v3 in the Maven ...
If the build fails during the deploy stage with a status code of 412 (Precondition Failed), then <goal>exchange-pre-deploy</goal> was not executed. SOLUTION
Read more >412 Precondition Failed - HTTP Status Code Glossary - WebFX
HTTP Status Code 412: One or more conditions given in the request header fields evaluated to false when tested on the server.
Read more >Error "412 Precondition Failed" (mod_security2) - Online manual
When this happens, the error message returned by the server is 412 Request Blocked (Precondition failed). You can disable certain blocking rules, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This issue is caused by the
player_page
graphql query ( https://github.com/ytdl-org/youtube-dl/blob/master/youtube_dl/extractor/ard.py#L379 ). Removing thetracking
block from the query appears to fix the issue in my local testing:I don’t know if this fix works for all videos that have this issue, or why it works, so I am not going to PR this.
definetly a problem depending on your own IP or provider. Just checked the exactly same download from two different systems with two different providers. one gives the error (deutsche telekom) , the other (versatel) runs fine. (for ONE time only. then the download fails exactly the same way, so maybe just try the download twice fore reproducing) So that geoblocking somehow seems to be the problem. If that @yawkat workaround works with everything it should be implemented for all the others and published, please.