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

Playlist Support #33

Closed
mohammadnaushad opened this issue Jul 21, 2020 · 6 comments
Closed

Playlist Support #33

mohammadnaushad opened this issue Jul 21, 2020 · 6 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@mohammadnaushad
Copy link

Do you have any plans for playlist support?

@sealedtx
Copy link
Owner

@mohammadnaushad what exactly do you mean by "playlist support"?

@naushad3210
Copy link

naushad3210 commented Jul 24, 2020

It means .. if someone passes a url which belongs to a playlist like https://youtu.be/HdGp3-R6LEc?list=PLFRPNUj0az6RFv9HH7UgLIAGmXSfQXHxH
He should be able to download the video or should be able to fetch all the video details in the playlist. Like all the video links in that playlist so that one can then send the link to download the video

@sealedtx
Copy link
Owner

@naushad3210 I don't have spare time to implement this feature, probably for next few weeks. But PRs are welcomed

@sealedtx sealedtx added enhancement New feature or request help wanted Extra attention is needed labels Jul 26, 2020
@Grodou
Copy link
Contributor

Grodou commented Aug 20, 2020

Hello,

I found 2 options, both use the window["ytInitialData"] JSON section.
(Document and JSON sizes from an actual test suggested by @naushad3210)

  1. Use the watch page
  • https://www.youtube.com/watch?v=<video_id>&list=<playlist_id>
  • Document size: 566.12 ko
  • JSON size: 310.8 ko
  • 5 steps hierarchy contents.twoColumnWatchNextResults.playlist.playlist.contents[]
  1. Use the playlist page
  • https://www.youtube.com/playlist?list=<playlist_id>
  • Document size: 161.35 ko
  • JSON size: 71.1 ko
  • 14 steps hierarchy contents.twoColumnBrowseResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents[0].itemSectionRenderer.contents[0].playlistVideoListRenderer.contents[]

Once the final "contents" elements are available, each video data can be retrieved via playlistPanelVideoRenderer:

  • id: videoId
  • title: title.simpleText
  • duration: lengthSeconds

I think 2. is the best approach for a getPlaylist(String id) method that returns a basic video list and let the user choose.
Let me know if it's OK, I'll try to get back with a PR.

@sealedtx
Copy link
Owner

@Grodou Great, thank you for your research. I believe second approach is more suitable (as it is parsed from playlist page) despite its deep hierarchy. This implementation could be usefull, have a look. Will be glad to see your PR.

@Grodou
Copy link
Contributor

Grodou commented Aug 22, 2020

Thanks for the suggestion, I actually made a first version based on this implementation.
It works fine (get playlist details, get all videos), but does not have any "download" functionality yet.
I'll make a PR (so you can tell if everything's fine or not), and complete it later.

kangsLee pushed a commit to kangsLee/java-youtube-downloader that referenced this issue Nov 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants