Skip to content

Commit

Permalink
[extractor/hidive] Fix login
Browse files Browse the repository at this point in the history
  • Loading branch information
pukkandan committed Mar 10, 2023
1 parent ab1de9c commit e6ab678
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions yt_dlp/extractor/hidive.py
Expand Up @@ -47,15 +47,16 @@ def _perform_login(self, username, password):
login_webpage = self._download_webpage(
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.
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:
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(
'https://www.hidive.com/ajax/chooseprofile', None,
data=urlencode_postdata({
'profileId': profile_id,
'hash': profile_id_hash,
'hash': self._search_regex(
r'\<button [^>]+?data-hash="(\w+)"', login_webpage, 'profile id hash'),
'returnUrl': '/dashboard'
}))

Expand Down

1 comment on commit e6ab678

@dirkf
Copy link
Contributor

@dirkf dirkf commented on e6ab678 Jul 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stray \? r'\<button ...

Please sign in to comment.