Skip to content

feat: add youtube playlist support#27

Open
Ranjesh2002 wants to merge 1 commit intoaverygan:mainfrom
Ranjesh2002:feat/playlist-support
Open

feat: add youtube playlist support#27
Ranjesh2002 wants to merge 1 commit intoaverygan:mainfrom
Ranjesh2002:feat/playlist-support

Conversation

@Ranjesh2002
Copy link
Copy Markdown

@Ranjesh2002 Ranjesh2002 commented Apr 11, 2026

Summary

Adds YouTube playlist support (fixes #9).

Previously, pasting a playlist URL would only fetch the first video because --no-playlist was passed to yt-dlp in both the info and download commands. This PR removes that restriction and handles playlists end-to-end.

Changes

app.py

  • Removed --no-playlist from get_info() and run_download()

  • Updated get_info() to parse multiple newline-delimited JSON objects returned by yt-dlp for playlists

  • Returns { is_playlist: true, videos: [...] } when multiple videos are detected, single video response unchanged for
    backward compatibility

    templates/index.html

  • Updated go() to detect is_playlist response and expand each video into its own card

  • Playlist videos behave identically to manually pasted individual URLs — individual download + Download All both work

    Testing

  • Tested with a 13-video YouTube playlist

  • Single video URLs still work as before

  • "Download All" works across playlist videos

Handles both playlist URL formats:

`https://www.youtube.com/playlist?list=xxx
`https://www.youtube.com/watch?v=xxx&list=xxx
playlist-download.mp4

@Ranjesh2002 Ranjesh2002 marked this pull request as ready for review April 11, 2026 07:41
@AmanoSpica
Copy link
Copy Markdown

Thanks for the work on this!

I was testing playlist handling and noticed that using /api/info for playlists can be a bit slow due to how yt-dlp fetches the data.

I tried a slightly different approach in my PR (#28), where the playlist is expanded into individual video URLs beforehand using yt-dlp --flat-playlist.

With this approach:

  • Each video is processed independently
  • Results can be shown progressively
  • It feels a bit more responsive from a UX perspective

Not sure if this direction fits the project, but I’d appreciate your thoughts!

@Ranjesh2002
Copy link
Copy Markdown
Author

Ranjesh2002 commented Apr 11, 2026

Thanks for the suggestion and for testing! I actually pulled your branch locally and tested it with the same playlist. it only fetched the first video rather than all videos in the playlist, so it doesn't fully resolve issue #9.
My implementation works as follows:

  • Removed --no-playlist from both get_info() and run_download()
  • Parses the multiple newline-delimited JSON objects yt-dlp - returns for playlists
  • All videos in the playlist are rendered as individual cards
  • Users can download individually or use "Download All"

Tested with a 13-video playlist all 13 videos fetched successfully. Single video URLs continue to work as before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can you add downloading of playlists from YouTube?

2 participants