mirror of
https://github.com/l1ving/youtube-dl
synced 2025-02-11 09:27:50 +08:00
[adobepass] support FubuTV MSO
This commit is contained in:
parent
21c340b83f
commit
2d0822bbd0
@ -1,6 +1,8 @@
|
|||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import base64
|
||||||
|
import json
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
import xml.etree.ElementTree as etree
|
import xml.etree.ElementTree as etree
|
||||||
@ -60,6 +62,9 @@ MSO_INFO = {
|
|||||||
'username_field': 'IDToken1',
|
'username_field': 'IDToken1',
|
||||||
'password_field': 'IDToken2',
|
'password_field': 'IDToken2',
|
||||||
},
|
},
|
||||||
|
'Fubo': {
|
||||||
|
'name': 'FuboTV',
|
||||||
|
},
|
||||||
'thr030': {
|
'thr030': {
|
||||||
'name': '3 Rivers Communications'
|
'name': '3 Rivers Communications'
|
||||||
},
|
},
|
||||||
@ -1422,11 +1427,11 @@ class AdobePassIE(InfoExtractor):
|
|||||||
'domain_name': 'adobe.com',
|
'domain_name': 'adobe.com',
|
||||||
'redirect_url': url,
|
'redirect_url': url,
|
||||||
})
|
})
|
||||||
|
provider_redirect_page, urlh = provider_redirect_page_res
|
||||||
|
|
||||||
if mso_id == 'Comcast_SSO':
|
if mso_id == 'Comcast_SSO':
|
||||||
# Comcast page flow varies by video site and whether you
|
# Comcast page flow varies by video site and whether you
|
||||||
# are on Comcast's network.
|
# are on Comcast's network.
|
||||||
provider_redirect_page, urlh = provider_redirect_page_res
|
|
||||||
if 'automatically signing you in' in provider_redirect_page:
|
if 'automatically signing you in' in provider_redirect_page:
|
||||||
oauth_redirect_url = self._html_search_regex(
|
oauth_redirect_url = self._html_search_regex(
|
||||||
r'window\.location\s*=\s*[\'"]([^\'"]+)',
|
r'window\.location\s*=\s*[\'"]([^\'"]+)',
|
||||||
@ -1458,7 +1463,6 @@ class AdobePassIE(InfoExtractor):
|
|||||||
elif mso_id == 'Verizon':
|
elif mso_id == 'Verizon':
|
||||||
# In general, if you're connecting from a Verizon-assigned IP,
|
# In general, if you're connecting from a Verizon-assigned IP,
|
||||||
# you will not actually pass your credentials.
|
# you will not actually pass your credentials.
|
||||||
provider_redirect_page, urlh = provider_redirect_page_res
|
|
||||||
if 'Please wait ...' in provider_redirect_page:
|
if 'Please wait ...' in provider_redirect_page:
|
||||||
saml_redirect_url = self._html_search_regex(
|
saml_redirect_url = self._html_search_regex(
|
||||||
r'self\.parent\.location=(["\'])(?P<url>.+?)\1',
|
r'self\.parent\.location=(["\'])(?P<url>.+?)\1',
|
||||||
@ -1491,10 +1495,32 @@ class AdobePassIE(InfoExtractor):
|
|||||||
}), headers={
|
}), headers={
|
||||||
'Content-Type': 'application/x-www-form-urlencoded'
|
'Content-Type': 'application/x-www-form-urlencoded'
|
||||||
})
|
})
|
||||||
|
else:
|
||||||
|
if mso_id == 'Fubo':
|
||||||
|
config_b64 = self._html_search_regex(r"window.atob\('(.*)'\)\)\)\);",
|
||||||
|
provider_redirect_page, 'client id', fatal=True)
|
||||||
|
config_json = base64.b64decode(config_b64.encode()).decode('ascii')
|
||||||
|
config = json.loads(config_json)
|
||||||
|
|
||||||
|
post_data = {
|
||||||
|
'username': username,
|
||||||
|
'password': password,
|
||||||
|
'client_id': config['clientID'],
|
||||||
|
'tenant': config['auth0Tenant'],
|
||||||
|
'sso': True,
|
||||||
|
'connection': 'Username-Password-Authentication',
|
||||||
|
'redirect_uri': config['callbackURL'],
|
||||||
|
}
|
||||||
|
post_data.update(config['extraParams'])
|
||||||
|
base_url = config.get('authorizationServer', {}).get(url, 'https://fubo.auth0.com')
|
||||||
|
|
||||||
|
mvpd_confirm_page_res = self._download_webpage_handle(
|
||||||
|
base_url + '/usernamepassword/login', video_id, 'Logging in',
|
||||||
|
data=json.dumps(post_data).encode(),
|
||||||
|
headers={'Content-Type': 'application/json'})
|
||||||
else:
|
else:
|
||||||
# Some providers (e.g. DIRECTV NOW) have another meta refresh
|
# Some providers (e.g. DIRECTV NOW) have another meta refresh
|
||||||
# based redirect that should be followed.
|
# based redirect that should be followed.
|
||||||
provider_redirect_page, urlh = provider_redirect_page_res
|
|
||||||
provider_refresh_redirect_url = extract_redirect_url(
|
provider_refresh_redirect_url = extract_redirect_url(
|
||||||
provider_redirect_page, url=urlh.geturl())
|
provider_redirect_page, url=urlh.geturl())
|
||||||
if provider_refresh_redirect_url:
|
if provider_refresh_redirect_url:
|
||||||
@ -1507,6 +1533,7 @@ class AdobePassIE(InfoExtractor):
|
|||||||
mso_info.get('username_field', 'username'): username,
|
mso_info.get('username_field', 'username'): username,
|
||||||
mso_info.get('password_field', 'password'): password,
|
mso_info.get('password_field', 'password'): password,
|
||||||
})
|
})
|
||||||
|
|
||||||
if mso_id != 'Rogers':
|
if mso_id != 'Rogers':
|
||||||
post_form(mvpd_confirm_page_res, 'Confirming Login')
|
post_form(mvpd_confirm_page_res, 'Confirming Login')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user