[atresplayer] changed auth endpoint, _API_BASE no longer needed

This commit is contained in:
Ramón Sola 2021-07-29 13:27:45 +02:00
parent a4a8c926ab
commit 1a24c71595

View File

@ -44,7 +44,6 @@ class AtresPlayerIE(InfoExtractor):
'only_matching': True, 'only_matching': True,
}, },
] ]
_API_BASE = 'https://api.atresplayer.com/'
def _real_initialize(self): def _real_initialize(self):
self._login() self._login()
@ -63,14 +62,13 @@ class AtresPlayerIE(InfoExtractor):
return return
try: try:
self._download_json( self._download_webpage(
urljoin(self._API_BASE, 'login'), None, 'https://account.atresplayer.com/auth/v1/login', None,
'Logging in', headers={ 'Logging in', headers={
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded'
}, data=urlencode_postdata({ }, data=urlencode_postdata({
'username': username, 'username': username,
'password': password, 'password': password,
'type': 'credentials',
})) }))
except ExtractorError as e: except ExtractorError as e:
if isinstance(e.cause, compat_HTTPError) and e.cause.code == 401: if isinstance(e.cause, compat_HTTPError) and e.cause.code == 401: