From 4a601c9eff9fb42e24a4c8da3fa03628e035b35b Mon Sep 17 00:00:00 2001 From: sepro <4618135+seproDev@users.noreply.github.com> Date: Sat, 28 Oct 2023 17:53:24 +0200 Subject: [PATCH] [ie/weverse] Fix login error handling (#8458) Authored by: seproDev --- yt_dlp/extractor/weverse.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yt_dlp/extractor/weverse.py b/yt_dlp/extractor/weverse.py index 47f36806b..c94ca9db9 100644 --- a/yt_dlp/extractor/weverse.py +++ b/yt_dlp/extractor/weverse.py @@ -45,10 +45,10 @@ class WeverseBaseIE(InfoExtractor): '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'