1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-12-02 05:07:55 +01:00

Update Authentication for Directv Now

This commit is contained in:
SpeakerEnder 2019-03-31 00:01:17 -04:00
parent 93bb6b1bae
commit db4976186c

View File

@ -27,8 +27,8 @@ MSO_INFO = {
},
'ATTOTT': {
'name': 'DIRECTV NOW',
'username_field': 'email',
'password_field': 'loginpassword',
'username_field': 'userid',
'password_field': 'password',
},
'Rogers': {
'name': 'Rogers',
@ -1491,22 +1491,54 @@ class AdobePassIE(InfoExtractor):
}), headers={
'Content-Type': 'application/x-www-form-urlencoded'
})
elif mso_id == 'ATTOTT':
provider_login_page, urlTest = post_form(provider_redirect_page_res,'Pressing Continuing', {'submit': 'Continue'})
login_widget_data_json = self._html_search_regex(
"var LoginWidgetAdditionalAttr = (.*)//-->",
provider_login_page,
'login form data json',
flags=re.DOTALL)
login_widget_data = self._parse_json(login_widget_data_json, 'login form data')
login_widget_data = login_widget_data['LoginWidgetSetting']
post_url = login_widget_data['TGuardAuthPostUrl']
if not re.match(r'https?://', post_url):
post_url = compat_urlparse.urljoin(urlTest.geturl(), post_url)
form_data = login_widget_data['formSubmitParams']
form_data.update({
mso_info.get('username_field', 'username'): username,
mso_info.get('password_field', 'password'): password,
'remember_me': 'Y',
})
mvpd_confirm_page_res = self._download_webpage_handle(
post_url, video_id, 'Submit User/Password', data=urlencode_postdata(form_data), headers={
'Content-Type': 'application/x-www-form-urlencoded',
})
mvpd_auth_page = post_form(mvpd_confirm_page_res,'Authenticate')
post_form(mvpd_auth_page,'Call SAMLAssert')
else:
# Some providers (e.g. DIRECTV NOW) have another meta refresh
# Some providers have another meta refresh
# based redirect that should be followed.
provider_redirect_page, urlh = provider_redirect_page_res
provider_refresh_redirect_url = extract_redirect_url(
provider_redirect_page, url=urlh.geturl())
if provider_refresh_redirect_url:
provider_redirect_page_res = self._download_webpage_handle(
provider_refresh_redirect_url, video_id,
'Downloading Provider Redirect Page (meta refresh)')
provider_login_page_res = post_form(
provider_redirect_page_res, self._DOWNLOADING_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')
@ -1516,6 +1548,7 @@ class AdobePassIE(InfoExtractor):
'_method': 'GET',
'requestor_id': requestor_id,
}), headers=mvpd_headers)
if '<pendingLogout' in session:
self._downloader.cache.store(self._MVPD_CACHE, requestor_id, {})
count += 1