Skip to content

Commit

Permalink
[ie/weverse] Fix login error handling (#8458)
Browse files Browse the repository at this point in the history
Authored by: seproDev
  • Loading branch information
seproDev committed Oct 28, 2023
1 parent 464327a commit 4a601c9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions yt_dlp/extractor/weverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ def _perform_login(self, username, password):
'x-acc-trace-id': str(uuid.uuid4()),
'x-clog-user-device-id': str(uuid.uuid4()),
}
check_username = self._download_json(
f'{self._ACCOUNT_API_BASE}/signup/email/status', None,
note='Checking username', query={'email': username}, headers=headers)
if not check_username.get('hasPassword'):
valid_username = traverse_obj(self._download_json(
f'{self._ACCOUNT_API_BASE}/signup/email/status', None, note='Checking username',
query={'email': username}, headers=headers, expected_status=(400, 404)), 'hasPassword')
if not valid_username:
raise ExtractorError('Invalid username provided', expected=True)

headers['content-type'] = 'application/json'
Expand Down

0 comments on commit 4a601c9

Please sign in to comment.