mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-03 08:52:56 +01:00
[extractor/hidive] Fix login
Fixes https://github.com/yt-dlp/yt-dlp/issues/6493#issuecomment-1462906556
This commit is contained in:
parent
34d3df72e9
commit
9f717b69b4
|
@ -47,15 +47,16 @@ def _perform_login(self, username, password):
|
||||||
login_webpage = self._download_webpage(
|
login_webpage = self._download_webpage(
|
||||||
self._LOGIN_URL, None, 'Logging in', data=urlencode_postdata(data))
|
self._LOGIN_URL, None, 'Logging in', data=urlencode_postdata(data))
|
||||||
# If the user has multiple profiles on their account, select one. For now pick the first profile.
|
# If the user has multiple profiles on their account, select one. For now pick the first profile.
|
||||||
profile_id = self._search_regex(r'<button [^>]+?data-profile-id="(\w+)"', login_webpage, 'profile_id')
|
profile_id = self._search_regex(
|
||||||
|
r'<button [^>]+?data-profile-id="(\w+)"', login_webpage, 'profile id', default=None)
|
||||||
if profile_id is None:
|
if profile_id is None:
|
||||||
return # If only one profile, Hidive auto-selects it
|
return # If only one profile, Hidive auto-selects it
|
||||||
profile_id_hash = self._search_regex(r'\<button [^>]+?data-hash="(\w+)"', login_webpage, 'profile_id_hash')
|
|
||||||
self._request_webpage(
|
self._request_webpage(
|
||||||
'https://www.hidive.com/ajax/chooseprofile', None,
|
'https://www.hidive.com/ajax/chooseprofile', None,
|
||||||
data=urlencode_postdata({
|
data=urlencode_postdata({
|
||||||
'profileId': profile_id,
|
'profileId': profile_id,
|
||||||
'hash': profile_id_hash,
|
'hash': self._search_regex(
|
||||||
|
r'\<button [^>]+?data-hash="(\w+)"', login_webpage, 'profile id hash'),
|
||||||
'returnUrl': '/dashboard'
|
'returnUrl': '/dashboard'
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user