Skip to content
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

Scraper is failing on empty playlist #340

Closed
benoit74 opened this issue Sep 23, 2024 · 0 comments · Fixed by #341
Closed

Scraper is failing on empty playlist #340

benoit74 opened this issue Sep 23, 2024 · 0 comments · Fixed by #341
Assignees
Labels
Milestone

Comments

@benoit74
Copy link
Collaborator

While the scraper should simply ignore empty playlist (and not even render them in the final ZIM UI), currently the scraper fails when it encounters an empty playlist:

[youtube2zim::2024-09-21 21:01:47,936] ERROR:Interrupting process due to error: list index out of range
[youtube2zim::2024-09-21 21:01:47,936] ERROR:list index out of range
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/youtube2zim/scraper.py", line 421, in run
    self.make_json_files(succeeded)
  File "/usr/local/lib/python3.12/site-packages/youtube2zim/scraper.py", line 1177, in make_json_files
    playlist_list.append(generate_playlist_preview_object(playlist))
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/youtube2zim/scraper.py", line 1135, in generate_playlist_preview_object
    videos[0]["contentDetails"]["videoId"]
    ~~~~~~^^^
IndexError: list index out of range
@benoit74 benoit74 added the bug label Sep 23, 2024
@benoit74 benoit74 self-assigned this Sep 23, 2024
@benoit74 benoit74 added this to the 3.2.0 milestone Sep 23, 2024
This was referenced Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant