From: raleeper Date: Fri, 30 Sep 2016 22:45:44 +0000 (-0700) Subject: [adobepass] Add Comcast with fixed _download_webpage calls X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=46f6052950585dbd8f93240984e7c0f7045fac56;p=youtube-dl.git [adobepass] Add Comcast with fixed _download_webpage calls --- diff --git a/youtube_dl/extractor/adobepass.py b/youtube_dl/extractor/adobepass.py index 8f7ed6ef2..76ab69d8c 100644 --- a/youtube_dl/extractor/adobepass.py +++ b/youtube_dl/extractor/adobepass.py @@ -26,6 +26,11 @@ MSO_INFO = { 'username_field': 'UserName', 'password_field': 'UserPassword', }, + 'Comcast_SSO': { + 'name': 'Comcast XFINITY', + 'username_field': 'user', + 'password_field': 'passwd', + }, 'thr030': { 'name': '3 Rivers Communications' }, @@ -1364,14 +1369,49 @@ class AdobePassIE(InfoExtractor): 'domain_name': 'adobe.com', 'redirect_url': url, }) - 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', { - mso_info.get('username_field', 'username'): username, - mso_info.get('password_field', 'password'): password, - }) - if mso_id != 'Rogers': - post_form(mvpd_confirm_page_res, 'Confirming Login') + + if mso_id == 'Comcast_SSO': + # 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') + + 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', { + mso_info.get('username_field', 'username'): username, + mso_info.get('password_field', 'password'): password, + }) + if mso_id != 'Rogers': + post_form(mvpd_confirm_page_res, 'Confirming Login') session = self._download_webpage( self._SERVICE_PROVIDER_TEMPLATE % 'session', video_id,