Compare commits

...

2 Commits

Author SHA1 Message Date
sepro
4a601c9eff
[ie/weverse] Fix login error handling (#8458)
Authored by: seproDev
2023-10-28 15:53:24 +00:00
Shubham
464327acdb
[ie/polskieradio:audition] Fix playlist extraction (#8459)
Closes #8419
Authored by: shubhexists
2023-10-28 15:50:08 +00:00
2 changed files with 8 additions and 8 deletions

View File

@ -262,14 +262,14 @@ class PolskieRadioAuditionIE(InfoExtractor):
query=query, headers={'x-api-key': '9bf6c5a2-a7d0-4980-9ed7-a3f7291f2a81'}) query=query, headers={'x-api-key': '9bf6c5a2-a7d0-4980-9ed7-a3f7291f2a81'})
def _entries(self, playlist_id, has_episodes, has_articles): def _entries(self, playlist_id, has_episodes, has_articles):
for i in itertools.count(1) if has_episodes else []: for i in itertools.count(0) if has_episodes else []:
page = self._call_lp3( page = self._call_lp3(
'AudioArticle/GetListByCategoryId', { 'AudioArticle/GetListByCategoryId', {
'categoryId': playlist_id, 'categoryId': playlist_id,
'PageSize': 10, 'PageSize': 10,
'skip': i, 'skip': i,
'format': 400, 'format': 400,
}, playlist_id, f'Downloading episode list page {i}') }, playlist_id, f'Downloading episode list page {i + 1}')
if not traverse_obj(page, 'data'): if not traverse_obj(page, 'data'):
break break
for episode in page['data']: for episode in page['data']:
@ -281,14 +281,14 @@ class PolskieRadioAuditionIE(InfoExtractor):
'timestamp': parse_iso8601(episode.get('datePublic')), 'timestamp': parse_iso8601(episode.get('datePublic')),
} }
for i in itertools.count(1) if has_articles else []: for i in itertools.count(0) if has_articles else []:
page = self._call_lp3( page = self._call_lp3(
'Article/GetListByCategoryId', { 'Article/GetListByCategoryId', {
'categoryId': playlist_id, 'categoryId': playlist_id,
'PageSize': 9, 'PageSize': 9,
'skip': i, 'skip': i,
'format': 400, 'format': 400,
}, playlist_id, f'Downloading article list page {i}') }, playlist_id, f'Downloading article list page {i + 1}')
if not traverse_obj(page, 'data'): if not traverse_obj(page, 'data'):
break break
for article in page['data']: for article in page['data']:

View File

@ -45,10 +45,10 @@ class WeverseBaseIE(InfoExtractor):
'x-acc-trace-id': str(uuid.uuid4()), 'x-acc-trace-id': str(uuid.uuid4()),
'x-clog-user-device-id': str(uuid.uuid4()), 'x-clog-user-device-id': str(uuid.uuid4()),
} }
check_username = self._download_json( valid_username = traverse_obj(self._download_json(
f'{self._ACCOUNT_API_BASE}/signup/email/status', None, f'{self._ACCOUNT_API_BASE}/signup/email/status', None, note='Checking username',
note='Checking username', query={'email': username}, headers=headers) query={'email': username}, headers=headers, expected_status=(400, 404)), 'hasPassword')
if not check_username.get('hasPassword'): if not valid_username:
raise ExtractorError('Invalid username provided', expected=True) raise ExtractorError('Invalid username provided', expected=True)
headers['content-type'] = 'application/json' headers['content-type'] = 'application/json'