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
Add Spectrum as an Adobe Pass provider #26792
base: master
Are you sure you want to change the base?
Conversation
caf9e87
to
3b7c31e
Compare
I patched 2020.12.14 with this, but it does not work:
I threw in a breakpoint to investigate.
I redacted RelayState and SAMLRequest assuming they contained authentication tokens or something. I can't tell what, if anything, in this pile of JS contains the URL adobepass is looking for. |
Hmm yeah looks like Spectrum updated their login page recently. I'll dig into it. |
3b7c31e
to
5b41146
Compare
Reworked the change to get things working again. Unfortunately the new login form is a bit special as it's all dynamically loaded via JS so we need to manually recreate the flow in code. |
@dstftw Do you need me to send a provider account? |
Yes. |
a451d74
to
678ec23
Compare
If a dev needs a spectrum account login, please let me know and I'll provide one post-haste! @dstftw let me know if this is something you're still interested in fixing, and if so, I'll send over the login for spectrum |
Bumping this.. If a developer could finish this update for the SPECTRUM MSO I'd be super grateful! I have credentials that I will send immediately to whomever is a developer willing to take this on. |
@dstftw @kevinoconnor7 any willingness to work on this? I can provide MSO login |
@ohmybahgosh All the work is done. From my perspective this PR is ready to merge. @dstftw just needs a Spectrum login to test it with. You can probably send it to them via the email on their github profile. Unfortunately my Spectrum account is still in a bad state and I cannot easily change the password on it. |
Python 2.7.18./youtube-dl/youtube-dl https://www.nbc.com/making-it/video/random-crafts-of-kindness/4386591 --verbose
[debug] System config: []
[debug] User config: [u'--ap-mso', u'Spectrum', u'--ap-username', u'PRIVATE', u'--ap-password', u'PRIVATE', u'--convert-subtitles=srt', u'--add-metadata', u'--write-all-thumbnails', u'--embed-thumbnail', u'--embed-subs']
[debug] Custom config: []
[debug] Command-line args: [u'https://www.nbc.com/making-it/video/random-crafts-of-kindness/4386591', u'--verbose']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2021.03.14
[debug] Python version 2.7.18 (CPython) - Linux-5.10.0-kali9-amd64-x86_64-with-debian-kali-rolling
[debug] exe versions: ffmpeg 4.3.2-0, ffprobe 4.3.2-0, phantomjs 1.9.7, rtmpdump 2.4
[debug] Proxy map: {}
[NBC] 4386591: Downloading JSON metadata
[NBC] 4386591: Downloading Provider Redirect Page
[NBC] 4386591: Downloading Provider Login Page
[NBC] 4386591: Downloading SAML Response
ERROR: Unable to download JSON metadata: HTTP Error 404: (caused by HTTPError()); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
File "./youtube-dl/youtube-dl/youtube_dl/extractor/common.py", line 634, in _request_webpage
return self._downloader.urlopen(url_or_request)
File "./youtube-dl/youtube-dl/youtube_dl/YoutubeDL.py", line 2279, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "/usr/lib/python2.7/urllib2.py", line 435, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 548, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 473, in error
return self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 556, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) Python 3.9.2✦ ❯ ./youtube-dl https://www.nbc.com/making-it/video/random-crafts-of-kindness/4386591 --verbose --cookies /root/.cookies/nbc.txt [debug] System config: []
[debug] User config: ['--ap-mso', 'Spectrum', '--ap-username', 'PRIVATE', '--ap-password', 'PRIVATE', '--convert-subtitles=srt', '--add-metadata', '--write-all-thumbnails', '--embed-thumbnail', '--embed-subs']
[debug] Custom config: []
[debug] Command-line args: ['https://www.nbc.com/making-it/video/random-crafts-of-kindness/4386591', '--verbose', '--cookies', '/root/.cookies/nbc.txt']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.03.14
[debug] Python version 3.9.2 (CPython) - Linux-5.10.0-kali9-amd64-x86_64-with-glibc2.31
[debug] exe versions: ffmpeg 4.3.2-0, ffprobe 4.3.2-0, phantomjs 1.9.7, rtmpdump 2.4
[debug] Proxy map: {}
[NBC] 4386591: Downloading JSON metadata
[NBC] 4386591: Downloading Provider Redirect Page
[NBC] 4386591: Downloading Provider Login Page
[NBC] 4386591: Downloading SAML Response
ERROR: Unable to download JSON metadata: HTTP Error 404: (caused by <HTTPError 404: ''>); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
File "/opt/VID_TOOLZ/youtube-dl/./youtube-dl/youtube_dl/extractor/common.py", line 634, in _request_webpage
return self._downloader.urlopen(url_or_request)
File "/opt/VID_TOOLZ/youtube-dl/./youtube-dl/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) |
Some services no longer allow for the older services (ex. `Charter_Direct`) to be used and just return a generic 401 response. Going through their login flow manually, the new provider name appears to be `Spectrum`. This provider seems to work even place of services that still allow for `Charter_Direct` to be used. The Spectrum login form also needs special handling since it's dynamically loaded via JS thus we cannot simply capture the POST url and hidden form fields. Instead we need to hardcode the POST URL and recreate the request manually. Thankfully the SAMLRequest and RelayState are in the HTML response.
678ec23
to
f9d0a8c
Compare
oops! There was a case-sensitivity issue in the entitlement URL that I fixed on my local branch but never pushed. Should be fixed now! |
That fixed it!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes case sensitivity issue, and now the Spectrum Ap-mso is fully functional!
From: ytdl-org/youtube-dl#26792 Co-authored by: kevinoconnor7, ohmybahgosh
Are the devs reviewing this PR? Spectrum is one of the most popular TV providers in the U.S., this is a great addition! I have tested by using yt-dlp and it has worked so far, fixing |
I hope they are... I issued a PR for this fix over on YT-DLP and it was tested/merged already. Has been working great! |
From: ytdl-org/youtube-dl#26792 Co-authored by: kevinoconnor7, ohmybahgosh
Before submitting a pull request make sure you have:
In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:
What is the purpose of your pull request?
Description of your pull request and other information
Some services no longer allow for the older services (ex.
Charter_Direct
) to be used and just return a generic 401 response.Going through their login flow manually, the new provider name appears to be
Spectrum
. This provider seems to work even place of services that still allow forCharter_Direct
to be used.