From 890d44b005c3073442064a847f2e0204619a8b47 Mon Sep 17 00:00:00 2001 From: Remita Amine Date: Mon, 20 Feb 2017 19:00:06 +0100 Subject: [adobepass] add support for Time Warner Cable(closes #12191) --- youtube_dl/extractor/adobepass.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'youtube_dl/extractor/adobepass.py') diff --git a/youtube_dl/extractor/adobepass.py b/youtube_dl/extractor/adobepass.py index 12eeab271..4d655bd5e 100644 --- a/youtube_dl/extractor/adobepass.py +++ b/youtube_dl/extractor/adobepass.py @@ -31,6 +31,11 @@ MSO_INFO = { 'username_field': 'user', 'password_field': 'passwd', }, + 'TWC': { + 'name': 'Time Warner Cable | Spectrum', + 'username_field': 'Ecom_User_ID', + 'password_field': 'Ecom_Password', + }, 'thr030': { 'name': '3 Rivers Communications' }, -- cgit 1.4.1 From af5049f128655cfec8978f17b04e5d88bd91d37f Mon Sep 17 00:00:00 2001 From: Yen Chi Hsuan Date: Thu, 2 Mar 2017 02:14:42 +0800 Subject: [adobepass] Add Charter Spectrum (#11465) Thanks @tv21 for the fix! --- youtube_dl/extractor/adobepass.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'youtube_dl/extractor/adobepass.py') diff --git a/youtube_dl/extractor/adobepass.py b/youtube_dl/extractor/adobepass.py index 4d655bd5e..d4816abf5 100644 --- a/youtube_dl/extractor/adobepass.py +++ b/youtube_dl/extractor/adobepass.py @@ -36,6 +36,11 @@ MSO_INFO = { 'username_field': 'Ecom_User_ID', 'password_field': 'Ecom_Password', }, + 'Charter_Direct': { + 'name': 'Charter Spectrum', + 'username_field': 'IDToken1', + 'password_field': 'IDToken2', + }, 'thr030': { 'name': '3 Rivers Communications' }, -- cgit 1.4.1 From febfe1e2626bab5dbb8d4e0bbe31aa225ce09d35 Mon Sep 17 00:00:00 2001 From: Sergey M․ Date: Sat, 18 Mar 2017 06:19:11 +0700 Subject: [adobepass] Detect and output error on authz token extraction (#12472) --- youtube_dl/extractor/adobepass.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'youtube_dl/extractor/adobepass.py') diff --git a/youtube_dl/extractor/adobepass.py b/youtube_dl/extractor/adobepass.py index d4816abf5..1b2d364ca 100644 --- a/youtube_dl/extractor/adobepass.py +++ b/youtube_dl/extractor/adobepass.py @@ -1458,6 +1458,8 @@ class AdobePassIE(InfoExtractor): self._downloader.cache.store(self._MVPD_CACHE, requestor_id, {}) count += 1 continue + if ' Date: Wed, 12 Apr 2017 01:18:57 -0400 Subject: [adobepass] Add Verizon support (#10803) --- youtube_dl/extractor/adobepass.py | 71 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) (limited to 'youtube_dl/extractor/adobepass.py') diff --git a/youtube_dl/extractor/adobepass.py b/youtube_dl/extractor/adobepass.py index 1b2d364ca..a15843315 100644 --- a/youtube_dl/extractor/adobepass.py +++ b/youtube_dl/extractor/adobepass.py @@ -41,6 +41,11 @@ MSO_INFO = { 'username_field': 'IDToken1', 'password_field': 'IDToken2', }, + 'Verizon': { + 'name': 'Verizon FiOS', + 'username_field': 'IDToken1', + 'password_field': 'IDToken2', + }, 'thr030': { 'name': '3 Rivers Communications' }, @@ -1416,6 +1421,72 @@ class AdobePassIE(InfoExtractor): if '' in mvpd_confirm_page: post_form(mvpd_confirm_page_res, 'Confirming Login') + elif mso_id == 'Verizon': + # In general, if you're connecting from a Verizon-assigned IP, + # you will not actually pass your credentials. + provider_redirect_page, urlh = provider_redirect_page_res + # print('provider_redirect_page_url', urlh.geturl()) + # https://signin.verizon.com/sso/VOLPortalLogin?SAMLRequest= + if 'Please wait ...' in provider_redirect_page: + # print('[debug] SAML Auto-Login is TRUE') # GO, + saml_redirect_url = self._html_search_regex( + r'self\.parent\.location=(["\'])(?P.+?)\1', + provider_redirect_page, 'Extracting SAML Redirect URL', group='url' + ) + # print('saml_redirect_url', saml_redirect_url) + # https://signin.verizon.com/sso/choice/tvpHandler.jsp?loginType=vzRedirect&partner= + saml_login_page = self._download_webpage( + saml_redirect_url, video_id, 'Downloading SAML Login Page' + ) + else: + if 'Please try again.' in provider_redirect_page: + # print('[debug] SAML Auto-Login is FALSE') # NBC, + provider_login_page_res = provider_redirect_page_res + else: + print('[error] SAML Auto-Login is UNKNOWN') + import sys + sys.exit(1) + provider_login_page, urlh = provider_login_page_res + # print('provider_login_page_url', urlh.geturl()) + # https://signin.verizon.com/sso/VOLPortalLogin?SAMLRequest= + saml_login_page_res = post_form(provider_login_page_res, 'Logging in', { + mso_info.get('username_field', 'username'): username, + mso_info.get('password_field', 'password'): password, + }) + saml_login_page, urlh = saml_login_page_res + if 'Please try again.' in saml_login_page: + print("[error] We're sorry, but either the User ID or Password entered is not correct.") + import sys + sys.exit(1) + # elif 'Please wait - we are verifying your account...' in saml_login_page: + # print('saml_login_page_url', urlh.geturl()) + # https://signin.verizon.com/sso/choice/tvpHandler.jsp?loginType=vzRedirect&partner= + saml_login_url = self._html_search_regex( + r'xmlHttp\.open\(\"POST\",\s(["\'])(?P.+?)\1', + saml_login_page, 'Extracting SAML Login URL', group='url') + # print('saml_login_url', saml_login_url) + # https://signin.verizon.com/sso/TVPHandlerServlet?loginType=vzRedirect&partner= + saml_response_json = self._download_json( + saml_login_url, video_id, 'Downloading SAML Response', + headers={'Content-Type': 'text/xml'} + ) + saml_target_url = saml_response_json['targetValue'] + saml_response = saml_response_json['SAMLResponse'] + saml_relay_state = saml_response_json['RelayState'] + # print('saml_target_url', saml_target_url) + # https://sp.auth.adobe.com/sp/saml/SAMLAssertionConsumer + form_data = { + 'SAMLResponse': saml_response, + 'RelayState': saml_relay_state + } + saml_autologin_res = self._download_webpage_handle( + saml_target_url, video_id, + 'Auto-Login', data=urlencode_postdata(form_data), + headers={'Content-Type': 'application/x-www-form-urlencoded'} + ) + original_page, urlh = saml_autologin_res + # print('original_page_url', urlh.geturl()) + else: # Normal, non-Comcast flow provider_login_page_res = post_form( -- cgit 1.4.1 From 79a51069e5c08afe7bf15bca7fcdf44fd0d93eb6 Mon Sep 17 00:00:00 2001 From: Remita Amine Date: Wed, 12 Apr 2017 15:17:18 +0100 Subject: [adobepass] improve comcast and verison login code(closes #10803) --- youtube_dl/extractor/adobepass.py | 98 +++++++++++++-------------------------- 1 file changed, 32 insertions(+), 66 deletions(-) (limited to 'youtube_dl/extractor/adobepass.py') diff --git a/youtube_dl/extractor/adobepass.py b/youtube_dl/extractor/adobepass.py index a15843315..100cf997f 100644 --- a/youtube_dl/extractor/adobepass.py +++ b/youtube_dl/extractor/adobepass.py @@ -1389,106 +1389,72 @@ class AdobePassIE(InfoExtractor): # Comcast page flow varies by video site and whether you # are on Comcast's network. provider_redirect_page, urlh = provider_redirect_page_res - # Check for Comcast auto login if 'automatically signing you in' in provider_redirect_page: oauth_redirect_url = self._html_search_regex( r'window\.location\s*=\s*[\'"]([^\'"]+)', provider_redirect_page, 'oauth redirect') - # Just need to process the request. No useful data comes back self._download_webpage( oauth_redirect_url, video_id, 'Confirming auto login') else: if '
Resume' in mvpd_confirm_page: post_form(mvpd_confirm_page_res, 'Confirming Login') - elif mso_id == 'Verizon': # In general, if you're connecting from a Verizon-assigned IP, # you will not actually pass your credentials. provider_redirect_page, urlh = provider_redirect_page_res - # print('provider_redirect_page_url', urlh.geturl()) - # https://signin.verizon.com/sso/VOLPortalLogin?SAMLRequest= if 'Please wait ...' in provider_redirect_page: - # print('[debug] SAML Auto-Login is TRUE') # GO, saml_redirect_url = self._html_search_regex( r'self\.parent\.location=(["\'])(?P.+?)\1', - provider_redirect_page, 'Extracting SAML Redirect URL', group='url' - ) - # print('saml_redirect_url', saml_redirect_url) - # https://signin.verizon.com/sso/choice/tvpHandler.jsp?loginType=vzRedirect&partner= + provider_redirect_page, + 'SAML Redirect URL', group='url') saml_login_page = self._download_webpage( - saml_redirect_url, video_id, 'Downloading SAML Login Page' - ) + saml_redirect_url, video_id, + 'Downloading SAML Login Page') else: - if 'Please try again.' in provider_redirect_page: - # print('[debug] SAML Auto-Login is FALSE') # NBC, - provider_login_page_res = provider_redirect_page_res - else: - print('[error] SAML Auto-Login is UNKNOWN') - import sys - sys.exit(1) - provider_login_page, urlh = provider_login_page_res - # print('provider_login_page_url', urlh.geturl()) - # https://signin.verizon.com/sso/VOLPortalLogin?SAMLRequest= - saml_login_page_res = post_form(provider_login_page_res, 'Logging in', { - mso_info.get('username_field', 'username'): username, - mso_info.get('password_field', 'password'): password, - }) + saml_login_page_res = post_form( + provider_redirect_page_res, 'Logging in', { + mso_info['username_field']: username, + mso_info['password_field']: password, + }) saml_login_page, urlh = saml_login_page_res if 'Please try again.' in saml_login_page: - print("[error] We're sorry, but either the User ID or Password entered is not correct.") - import sys - sys.exit(1) - # elif 'Please wait - we are verifying your account...' in saml_login_page: - # print('saml_login_page_url', urlh.geturl()) - # https://signin.verizon.com/sso/choice/tvpHandler.jsp?loginType=vzRedirect&partner= - saml_login_url = self._html_search_regex( - r'xmlHttp\.open\(\"POST\",\s(["\'])(?P.+?)\1', - saml_login_page, 'Extracting SAML Login URL', group='url') - # print('saml_login_url', saml_login_url) - # https://signin.verizon.com/sso/TVPHandlerServlet?loginType=vzRedirect&partner= + raise ExtractorError( + 'We\'re sorry, but either the User ID or Password entered is not correct.') + saml_login_url = self._search_regex( + r'xmlHttp\.open\("POST"\s*,\s*(["\'])(?P.+?)\1', + saml_login_page, 'SAML Login URL', group='url') saml_response_json = self._download_json( saml_login_url, video_id, 'Downloading SAML Response', - headers={'Content-Type': 'text/xml'} - ) - saml_target_url = saml_response_json['targetValue'] - saml_response = saml_response_json['SAMLResponse'] - saml_relay_state = saml_response_json['RelayState'] - # print('saml_target_url', saml_target_url) - # https://sp.auth.adobe.com/sp/saml/SAMLAssertionConsumer - form_data = { - 'SAMLResponse': saml_response, - 'RelayState': saml_relay_state - } - saml_autologin_res = self._download_webpage_handle( - saml_target_url, video_id, - 'Auto-Login', data=urlencode_postdata(form_data), - headers={'Content-Type': 'application/x-www-form-urlencoded'} - ) - original_page, urlh = saml_autologin_res - # print('original_page_url', urlh.geturl()) - + headers={'Content-Type': 'text/xml'}) + self._download_webpage( + saml_response_json['targetValue'], video_id, + 'Confirming Login', data=urlencode_postdata({ + 'SAMLResponse': saml_response_json['SAMLResponse'], + 'RelayState': saml_response_json['RelayState'] + }), headers={ + 'Content-Type': 'application/x-www-form-urlencoded' + }) else: - # Normal, non-Comcast flow provider_login_page_res = post_form( provider_redirect_page_res, 'Downloading Provider Login Page') mvpd_confirm_page_res = post_form(provider_login_page_res, 'Logging in', { -- cgit 1.4.1 From fb8e8b2d1684e66c1d3f3587010d8ef51ebff7ce Mon Sep 17 00:00:00 2001 From: Remita Amine Date: Fri, 28 Apr 2017 09:47:30 +0100 Subject: [adobepass] use geo verification headers for all requests --- youtube_dl/extractor/adobepass.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'youtube_dl/extractor/adobepass.py') diff --git a/youtube_dl/extractor/adobepass.py b/youtube_dl/extractor/adobepass.py index 100cf997f..7da96c65c 100644 --- a/youtube_dl/extractor/adobepass.py +++ b/youtube_dl/extractor/adobepass.py @@ -1308,6 +1308,12 @@ class AdobePassIE(InfoExtractor): _USER_AGENT = 'Mozilla/5.0 (X11; Linux i686; rv:47.0) Gecko/20100101 Firefox/47.0' _MVPD_CACHE = 'ap-mvpd' + def _download_webpage_handle(self, *args, **kwargs): + headers = kwargs.get('headers', {}) + headers.update(self.geo_verification_headers()) + kwargs['headers'] = headers + return super(AdobePassIE, self)._download_webpage_handle(*args, **kwargs) + @staticmethod def _get_mvpd_resource(provider_id, title, guid, rating): channel = etree.Element('channel') -- cgit 1.4.1 From daa4e9ff90e9c017238dae48e9862ebe02bc3ff2 Mon Sep 17 00:00:00 2001 From: Nii-90 Date: Sat, 20 May 2017 09:50:46 -0400 Subject: [adobepass] Add support for Brighthouse MSO --- youtube_dl/extractor/adobepass.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'youtube_dl/extractor/adobepass.py') diff --git a/youtube_dl/extractor/adobepass.py b/youtube_dl/extractor/adobepass.py index 7da96c65c..d57ad85c2 100644 --- a/youtube_dl/extractor/adobepass.py +++ b/youtube_dl/extractor/adobepass.py @@ -36,6 +36,11 @@ MSO_INFO = { 'username_field': 'Ecom_User_ID', 'password_field': 'Ecom_Password', }, + 'Brighthouse': { + 'name': 'Bright House Networks | Spectrum', + 'username_field': 'j_username', + 'password_field': 'j_password', + }, 'Charter_Direct': { 'name': 'Charter Spectrum', 'username_field': 'IDToken1', -- cgit 1.4.1 From 2d2132ac6e75932c9c7e6c143f20156482043729 Mon Sep 17 00:00:00 2001 From: Sergey M․ Date: Mon, 19 Jun 2017 22:53:39 +0700 Subject: [adobepass] Fix extraction on older python 2.6 --- youtube_dl/extractor/adobepass.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'youtube_dl/extractor/adobepass.py') diff --git a/youtube_dl/extractor/adobepass.py b/youtube_dl/extractor/adobepass.py index d57ad85c2..3dfc632e7 100644 --- a/youtube_dl/extractor/adobepass.py +++ b/youtube_dl/extractor/adobepass.py @@ -6,7 +6,10 @@ import time import xml.etree.ElementTree as etree from .common import InfoExtractor -from ..compat import compat_urlparse +from ..compat import ( + compat_kwargs, + compat_urlparse, +) from ..utils import ( unescapeHTML, urlencode_postdata, @@ -1317,7 +1320,8 @@ class AdobePassIE(InfoExtractor): headers = kwargs.get('headers', {}) headers.update(self.geo_verification_headers()) kwargs['headers'] = headers - return super(AdobePassIE, self)._download_webpage_handle(*args, **kwargs) + return super(AdobePassIE, self)._download_webpage_handle( + *args, **compat_kwargs(kwargs)) @staticmethod def _get_mvpd_resource(provider_id, title, guid, rating): -- cgit 1.4.1 From 0c7a631b613fe8ec443e6b17ea8f7a17fb8abb5b Mon Sep 17 00:00:00 2001 From: Sergey M․ Date: Sun, 25 Jun 2017 04:54:56 +0700 Subject: [adobepass] Add support for ATTOTT MSO (DIRECTV NOW) (closes #13472) --- youtube_dl/extractor/adobepass.py | 43 +++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) (limited to 'youtube_dl/extractor/adobepass.py') diff --git a/youtube_dl/extractor/adobepass.py b/youtube_dl/extractor/adobepass.py index 3dfc632e7..b83b51efb 100644 --- a/youtube_dl/extractor/adobepass.py +++ b/youtube_dl/extractor/adobepass.py @@ -15,6 +15,7 @@ from ..utils import ( urlencode_postdata, unified_timestamp, ExtractorError, + NO_DEFAULT, ) @@ -24,6 +25,11 @@ MSO_INFO = { 'username_field': 'username', 'password_field': 'password', }, + 'ATTOTT': { + 'name': 'DIRECTV NOW', + 'username_field': 'email', + 'password_field': 'loginpassword', + }, 'Rogers': { 'name': 'Rogers', 'username_field': 'UserName', @@ -1316,6 +1322,8 @@ class AdobePassIE(InfoExtractor): _USER_AGENT = 'Mozilla/5.0 (X11; Linux i686; rv:47.0) Gecko/20100101 Firefox/47.0' _MVPD_CACHE = 'ap-mvpd' + _DOWNLOADING_LOGIN_PAGE = 'Downloading Provider Login Page' + def _download_webpage_handle(self, *args, **kwargs): headers = kwargs.get('headers', {}) headers.update(self.geo_verification_headers()) @@ -1365,6 +1373,21 @@ class AdobePassIE(InfoExtractor): 'Use --ap-mso to specify Adobe Pass Multiple-system operator Identifier ' 'and --ap-username and --ap-password or --netrc to provide account credentials.', expected=True) + def extract_redirect_url(html, url=None, fatal=False): + # TODO: eliminate code duplication with generic extractor and move + # redirection code into _download_webpage_handle + REDIRECT_REGEX = r'[0-9]{,2};\s*(?:URL|url)=\'?([^\'"]+)' + redirect_url = self._search_regex( + r'(?i)