-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ie/polskieradio] Fixed issue #8419 #8459
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should do it for the episodes, too, and adjust the page count in the output
diff --git a/yt_dlp/extractor/polskieradio.py b/yt_dlp/extractor/polskieradio.py
index 5bf92b9b5..e0b22fffd 100644
--- a/yt_dlp/extractor/polskieradio.py
+++ b/yt_dlp/extractor/polskieradio.py
@@ -262,14 +262,14 @@ def _call_lp3(self, path, query, video_id, note):
query=query, headers={'x-api-key': '9bf6c5a2-a7d0-4980-9ed7-a3f7291f2a81'})
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(
'AudioArticle/GetListByCategoryId', {
'categoryId': playlist_id,
'PageSize': 10,
'skip': i,
'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'):
break
for episode in page['data']:
@@ -281,14 +281,14 @@ def _entries(self, playlist_id, has_episodes, has_articles):
'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(
'Article/GetListByCategoryId', {
'categoryId': playlist_id,
'PageSize': 9,
'skip': i,
'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'):
break
for article in page['data']:
Got it! I'll fix this and upload a PR after some time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you also update the PolskieRadioAuditionIE
tests so that we have correct counts, please?
Can you brief what exactly in tests do I need to update? Count seems to be working fine only. |
ah nvm, I guess these playlists are constantly being appended to anyways so it doesn't make a difference |
Closes yt-dlp#8419 Authored by: shubhexists
IMPORTANT: PRs without the template will be CLOSED
Description of your pull request and other information
This a a site-fix code.
Changes made in polskieradio.py .
This PR fixes the issue of skipping the first page of the site as reported in the linked issue.
Fixes #8419
Template
Before submitting a pull request make sure you have:
In order to be accepted and merged into yt-dlp each piece of code must be in public domain or released under Unlicense. Check all of the following options that apply:
What is the purpose of your pull request?
Copilot Summary
🤖 Generated by Copilot at bc45707
Summary
🐛📄🚀
Fix missing first page of auditions in
polskieradio
extractor by using zero-based page numbers.Walkthrough
itertools.count
to 0 (link)