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

Native playlist downloading #49

Closed
ckp95 opened this issue Jan 5, 2023 · 2 comments · Fixed by #76
Closed

Native playlist downloading #49

ckp95 opened this issue Jan 5, 2023 · 2 comments · Fixed by #76
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@ckp95
Copy link

ckp95 commented Jan 5, 2023

Hey, saw this in Hackernews, looks pretty neat.

Even though the README only mentions channels, I know that yt-dlp also supports downloading playlists. When I give it a playlist that has videos that were deleted, yark breaks. This is common in music playlists, for example this one.

I had a quick look in the code, I managed to get it to work with this simple hotfix:

diff --git a/yark/channel.py b/yark/channel.py
index 4863823..26eb7af 100644
--- a/yark/channel.py
+++ b/yark/channel.py
@@ -139,6 +139,7 @@ class Channel:
         settings = {
             "outtmpl": "%(id)s%(ext)s",
             "logger": VideoLogger(),
+            "ignoreerrors": True
         }
 
         # Get response and snip it
@@ -188,6 +189,8 @@ class Channel:
                 else:
                     _err_msg(f"Unknown video kind '{kind}' found", True)
 
+        videos = [x for x in videos if x is not None]
+
         # Parse metadata
         self._parse_metadata("video", videos, self.videos)
         self._parse_metadata("livestream", livestreams, self.livestreams)

I'm not making a formal PR because you might know of a cleaner way of implementing this check, but you're welcome to apply this patch if you want. Also it might be good to mention in the README that it works on playlists too, not just channels.

@Owez
Copy link
Owner

Owez commented Jan 5, 2023

Thanks for the input, i'll take a look at it tomorrow. Playlist viewing (#27) is in the upcoming v1.3 so it'll complement this kind of download nicely. There needs to be a seperate intake stream for playlists as new because yark is geared for channels right now

@Owez Owez changed the title Playlist download breaks on missing videos Native playlist downloading Jan 6, 2023
@Owez Owez self-assigned this Jan 6, 2023
@Owez Owez added the enhancement New feature or request label Jan 6, 2023
@Owez Owez added this to Yark 1.3 Jan 6, 2023
@Owez Owez moved this to Todo in Yark 1.3 Jan 6, 2023
@Owez Owez removed their assignment Jan 6, 2023
@swyxio
Copy link

swyxio commented Jan 8, 2023

just leaving a +1 for playlist downloading - just to motivate it - i'd like to back up every video i've ever "liked" as a simple way of guarding against bitrot and enabling proper search since youtube search sucks.

thank you for this project @Owez and looking forward to v1.3!

@Owez Owez moved this from Todo to In Progress in Yark 1.3 Jan 11, 2023
@Owez Owez self-assigned this Jan 11, 2023
@Owez Owez added the bug Something isn't working label Jan 11, 2023
@Owez Owez linked a pull request Jan 11, 2023 that will close this issue
@Owez Owez closed this as completed in #76 Jan 12, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Yark 1.3 Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants