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

What happens when there is no video in channel / playlist? #347

Closed
benoit74 opened this issue Sep 24, 2024 · 2 comments · Fixed by #365
Closed

What happens when there is no video in channel / playlist? #347

benoit74 opened this issue Sep 24, 2024 · 2 comments · Fixed by #365
Assignees
Labels
Milestone

Comments

@benoit74
Copy link
Collaborator

From #341 (review)

What happens when the channel has no video, or the playlist(s) have no video in the end? Do we create an almost empty ZIM?

We need to ensure that scraper fails in such a situation with a clear error message.

@dan-niles
Copy link
Collaborator

Since #341 ensures that all empty playlists are ignored, it's better to throw an error if no playlists with videos remain, rather than creating an empty ZIM file.

In the extract_videos_list method, after removing the empty playlists, adding the following two lines should be enough to throw an error:

for playlist in empty_playlists:
    self.playlists.remove(playlist)

# Add these two lines
if not self.playlists:
    raise Exception("No videos found in playlists")

WDYT?

@benoit74
Copy link
Collaborator Author

I like it!

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.

2 participants