yt-dlp: [adobepass] `--ap-mso` HTTP Error 451: Unavailable For Legal Reasons
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 yt-dlp is broken on a supported site
- I’ve verified that I have updated yt-dlp to nightly or master (update instructions)
- 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
United States
Provide a description that is worded well enough to be understood
Unable to download any videos from NBC. They work in the browser.
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://www.nbc.com/lopez-vs-lopez/video/lopez-vs-dateline/9000396845', '--ap-mso', 'Verizon', '--ap-username', 'PRIVATE', '--ap-password', 'PRIVATE', '-vU']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version master@2024.12.13.102848 from yt-dlp/yt-dlp-master-builds [542166962] (win_exe)
[debug] Python 3.10.11 (CPython AMD64 64bit) - Windows-10-10.0.26100-SP0 (OpenSSL 1.1.1t 7 Feb 2023)
[debug] exe versions: ffmpeg N-93302-g147ef1d947, ffprobe N-93302-g147ef1d947
[debug] Optional libraries: Cryptodome-3.21.0, brotli-1.1.0, certifi-2024.08.30, curl_cffi-0.5.10, mutagen-1.47.0, requests-2.32.3, sqlite3-3.40.1, urllib3-2.2.3, websockets-14.1
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets, curl_cffi
[debug] Loaded 1837 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp-master-builds/releases/latest
Latest version: master@2024.12.13.102848 from yt-dlp/yt-dlp-master-builds
yt-dlp is up to date (master@2024.12.13.102848 from yt-dlp/yt-dlp-master-builds)
[NBC] Extracting URL: https://www.nbc.com/lopez-vs-lopez/video/lopez-vs-dateline/9000396845
[NBC] 9000396845: Downloading JSON metadata
[NBC] 9000396845: Downloading JSON metadata
[NBC] 9000396845: Downloading Provider Redirect Page
ERROR: [NBC] 9000396845: Unable to download webpage: HTTP Error 451: Unavailable For Legal Reasons (caused by <HTTPError 451: Unavailable For Legal Reasons>)
File "yt_dlp\extractor\common.py", line 742, in extract
File "yt_dlp\extractor\nbc.py", line 212, in _real_extract
File "yt_dlp\extractor\adobepass.py", line 1449, in _extract_mvpd_auth
File "yt_dlp\extractor\adobepass.py", line 1367, in _download_webpage_handle
File "yt_dlp\extractor\common.py", line 962, in _download_webpage_handle
File "yt_dlp\extractor\common.py", line 911, in _request_webpage
File "yt_dlp\extractor\common.py", line 898, in _request_webpage
File "yt_dlp\YoutubeDL.py", line 4162, in urlopen
File "yt_dlp\networking\common.py", line 117, in send
File "yt_dlp\networking\_helper.py", line 208, in wrapper
File "yt_dlp\networking\common.py", line 340, in send
File "yt_dlp\networking\_requests.py", line 365, in _send
yt_dlp.networking.exceptions.HTTPError: HTTP Error 451: Unavailable For Legal Reasons
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 27 (13 by maintainers)
Commits related to this issue
- [ie/adobepass] Rework to require software statement (#13131) * Also removes broken cookie support Closes #11811 Authored by: maxbin123, bashonly Co-authored-by: bashonly <88596187+bashonly@users.no... — committed to maxbin123/yt-dlp by maxbin123 a year ago
- [ie/adobepass] Rework to require software statement (#13131) * Also removes broken cookie support Closes #11811 Authored by: maxbin123, bashonly Co-authored-by: bashonly <88596187+bashonly@users.no... — committed to JChris246/yt-dlp by maxbin123 a year ago
I get the same error with a different MSO. Would be interested to know if this is happening with other sites that use Adobepass (besides just NBC)
EDIT: It does affect other sites
Some hints for whomever takes this on (I would if I had more time).
The 451 error goes away if you supply a valid
reg_codeas part of the query toself._SERVICE_PROVIDER_TEMPLATE % 'authenticate/saml'. This reg_code looks like it can be obtained through its own set of API calls but I haven’t figured out exactly what yet. Notably, the final call that returns thereg_codealways returns a unique reg_code, even when supplied the same set of parameters. Also of note, if you supply a reg_code that has already been used, you will get redirected back to the original video URL without authenticating, rather than to the TV provider log in screen. But if you pass a valid reg_code, the authentication process continues as expected.Another interesting thing is that when making the call to
self._SERVICE_PROVIDER_TEMPLATE % 'session', I had to pass two additional headers as part ofmvpd_headers, else I would get a 401 Unauthorized. These areap_21andpass_sfp. I grabbed the values from devtools and hard-coded them in yt-dlp and they are still working ~18 hours later, so they last for at least that long. This also may be website-specific as I only had this issue with ESPN and not with ABC. But I had to make the changes inadobepass.pyregardless.Hope that helps. I (and probably many others) heavily rely on the Adobe Pass functionality but unfortunately I just do not have the literal and figurative bandwidth to fix this myself.
Confirming the non-DRM aspect from a different angle. One of my machines had an expired MVPD token for ABC and was getting 451 when trying to obtain a new one. But another machine had a current token and it was still able to extract and download the non-DRM episode. So it is almost certainly an issue with adobepass.
FWIW, the same behavior also occurs with ESPN content (e.g. https://www.espn.com/watch/player/_/id/2a7a3931-bbde-4e39-b13c-a2ba38e4ee90). Even more reason to believe it is a problem with adobepass and not an issue with any specific site.
Yes. Because of what @2ShedsJackson said above:
If everything behind adobepass is now DRM-protected, we simply need to remove the adobepass extractor
@dano-code Both of those links are DRM-protected and will not play in Firefox w/ DRM disabled