]> jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/gigya.py
[ie/orf:on] Improve extraction (#9677)
[yt-dlp.git] / yt_dlp / extractor / gigya.py
1 from .common import InfoExtractor
2
3 from ..utils import (
4 ExtractorError,
5 urlencode_postdata,
6 )
7
8
9 class GigyaBaseIE(InfoExtractor):
10 def _gigya_login(self, auth_data):
11 auth_info = self._download_json(
12 'https://accounts.eu1.gigya.com/accounts.login', None,
13 note='Logging in', errnote='Unable to log in',
14 data=urlencode_postdata(auth_data))
15
16 error_message = auth_info.get('errorDetails') or auth_info.get('errorMessage')
17 if error_message:
18 raise ExtractorError(
19 'Unable to login: %s' % error_message, expected=True)
20 return auth_info