Upgrade yt_dlp and download script
This commit is contained in:
@@ -47,7 +47,7 @@ class TennisTVIE(InfoExtractor):
|
||||
_HEADERS = {
|
||||
'origin': 'https://www.tennistv.com',
|
||||
'referer': 'https://www.tennistv.com/',
|
||||
'content-Type': 'application/x-www-form-urlencoded'
|
||||
'content-Type': 'application/x-www-form-urlencoded',
|
||||
}
|
||||
|
||||
def _perform_login(self, username, password):
|
||||
@@ -58,7 +58,7 @@ class TennisTVIE(InfoExtractor):
|
||||
'redirect_uri': 'https://tennistv.com',
|
||||
'response_mode': 'fragment',
|
||||
'response_type': 'code',
|
||||
'scope': 'openid'
|
||||
'scope': 'openid',
|
||||
})
|
||||
|
||||
post_url = self._html_search_regex(r'action=["\']([^"\']+?)["\']\s+method=["\']post["\']', login_page, 'login POST url')
|
||||
@@ -67,7 +67,7 @@ class TennisTVIE(InfoExtractor):
|
||||
headers=self._HEADERS, data=urlencode_postdata({
|
||||
'username': username,
|
||||
'password': password,
|
||||
'submitAction': 'Log In'
|
||||
'submitAction': 'Log In',
|
||||
}))
|
||||
if 'Your username or password was incorrect' in temp_page:
|
||||
raise ExtractorError('Your username or password was incorrect', expected=True)
|
||||
@@ -82,14 +82,14 @@ class TennisTVIE(InfoExtractor):
|
||||
'response_type': 'code',
|
||||
'scope': 'openid',
|
||||
'nonce': random_uuidv4(),
|
||||
'prompt': 'none'
|
||||
'prompt': 'none',
|
||||
})
|
||||
|
||||
self.get_token(None, {
|
||||
'code': urllib.parse.parse_qs(handle.url)['code'][-1],
|
||||
'grant_type': 'authorization_code',
|
||||
'client_id': 'tennis-tv-web',
|
||||
'redirect_uri': 'https://www.tennistv.com/resources/v1.1.10/html/silent-check-sso.html'
|
||||
'redirect_uri': 'https://www.tennistv.com/resources/v1.1.10/html/silent-check-sso.html',
|
||||
})
|
||||
|
||||
def get_token(self, video_id, payload):
|
||||
@@ -109,7 +109,7 @@ class TennisTVIE(InfoExtractor):
|
||||
self.raise_login_required()
|
||||
self.access_token, self.refresh_token = cookies['access_token'].value, cookies['refresh_token'].value
|
||||
|
||||
def _download_session_json(self, video_id, entryid,):
|
||||
def _download_session_json(self, video_id, entryid):
|
||||
return self._download_json(
|
||||
f'https://atppayments.streamamg.com/api/v1/session/ksession/?lang=en&apijwttoken={self.access_token}&entryId={entryid}',
|
||||
video_id, 'Downloading ksession token', 'Failed to download ksession token', headers=self._HEADERS)
|
||||
@@ -126,7 +126,7 @@ class TennisTVIE(InfoExtractor):
|
||||
self.get_token(video_id, {
|
||||
'grant_type': 'refresh_token',
|
||||
'refresh_token': self.refresh_token,
|
||||
'client_id': 'tennis-tv-web'
|
||||
'client_id': 'tennis-tv-web',
|
||||
})
|
||||
k_session = self._download_session_json(video_id, entryid).get('KSession')
|
||||
if k_session is None:
|
||||
|
Reference in New Issue
Block a user