libre-tube / LibreTube

An alternative frontend for YouTube, for Android.
https://libretube.dev
GNU General Public License v3.0
8.79k stars 446 forks source link

Use Individual Links for Private Playlists Instead of "Watch Videos" #6594

Open akashsriramganapathy opened 1 month ago

akashsriramganapathy commented 1 month ago

Describe your suggested feature

Description:

I would like to propose an enhancement for the LibreTube application to improve access to private playlists.

Proposal:

Other details

Justification:

  1. Limitations on Video Count: The 50-video limitation in the "Watch Videos" feature can hinder users with extensive private playlists, making it difficult to access all desired content at once. Using individual links would allow for full access to larger playlists without these restrictions.
  2. Offline Accessibility: As someone who prefers offline viewing, being able to access private playlists through direct links would greatly enhance my ability to download and manage content for offline use without the constraints of video limits.
  3. Support from 3rd Party Downloaders: Many third-party downloaders already facilitate accessing private playlists through individual links. Incorporating this feature in LibreTube would align with existing practices and improve usability.

I believe this enhancement will significantly improve the LibreTube experience for users who need better access to private playlists, particularly those with larger collections.

Thank you for considering this feature request!

Acknowledgements

Bnyro commented 1 month ago

I don't get that, what's the difference from just downloading all videos manually?

akashsriramganapathy commented 1 month ago

Thank you for your reply! To clarify, my suggestion comes from testing with tools like yt-dlp and Seal, which both support downloading entire playlists or individual video links in bulk. This allows downloading multiple formats (like audio or video) and makes the process far more efficient for larger playlists.

For instance, with yt-dlp, I can use the following command:

yt-dlp --extract-audio --audio-format mp3 https://www.youtube.com/watch?v=NWKs-Gfx50o https://www.youtube.com/watch?v=joeytiqeAaQ ...

Alternatively, I can pass multiple YouTube links directly, as shown below, and yt-dlp or Seal will download all the videos in one go:

https://www.youtube.com/watch?v=NWKs-Gfx50o https://www.youtube.com/watch?v=joeytiqeAaQ https://www.youtube.com/watch?v=v678KhuV1wo https://www.youtube.com/watch?v=_QbWtaT3Ess...

This method eliminates the limitation of the "Watch Videos" feature, which only allows handling up to 50 videos at once. For someone like me who prefers offline access and regularly downloads large playlists, this direct link-based bulk download is incredibly convenient and faster. While yt-dlp and Seal support this functionality, other popular tools like NewPipe and YMusic don’t currently support downloading playlists in this format.

I think integrating this kind of functionality into LibreTube, especially for private playlists, would be a significant improvement, allowing users to easily download large playlists without having to manually manage each download.

Let me know if this provides more clarity, and thanks again for considering this enhancement!

Bnyro commented 1 month ago

Okay, I wasn't aware that Seal does support that. I however need to figure out how we can pass all the video ids to seal by looking at their source code, as the data we usually pass ia Andeoid intents only consists of one single uri, not multiple.

Bnyro commented 1 week ago

Looking at https://github.com/JunkFood02/Seal/blob/main/app/src/main/java/com/junkfood/seal/MainActivity.kt#L60-L83, it seems that Seal only supports one single URL at a time.

Why do you think Seal would support it, does any other app allow you to share multiple videos to Seal at a time that could be taken for reference?

akashsriramganapathy commented 1 week ago

When I first opened this request, I was able to get it working, but it's no longer possible, and I don't have proof to support it. I reached out to the YTDL team, and they mentioned it's unlikely to implement this feature. However, they suggested we could achieve something similar using the terminal download option with a custom template.

That said, I don’t think this would work for all users since it requires a specific setup. I originally thought that if we passed the URLs for a private playlist individually, like this:

https://www.youtube.com/watch?v=DrF5ST4W-zU,https://www.youtube.com/watch?v=Wnt5XAooDjo,https://www.youtube.com/watch?v=ib8FunNzsg0

it could process them, but it didn't work as expected. Plus, downloading larger playlists takes a lot more computational power.

For now, the feature is working as expected using video IDs, which are limited to 50 by default. This is in the right shape and works well on a wide range of devices.

Thanks for considering my request!

Bnyro commented 1 week ago

In that case, we can certainly find a way to allow the user to copy the playlist contents as a list of YouTube urls, such as

https://www.youtube.com/watch?v=DrF5ST4W-zU,https://www.youtube.com/watch?v=Wnt5XAooDjo,https://www.youtube.com/watch?v=ib8FunNzsg0

for using them inside yt-dlp or Seal with a custom command. That might not be the most user experience friendly solution in the end, but it's apparently the only way to bypass the 50 videos limit.

I'm currently wondering if that link should be shown in a new dialog if a custom package id for handling downloads is set, or if we should add a small copy button to the current download dialog that's handling downloads when using LibreTube's inbuilt downloader.

I'm hoping for your input on that!

akashsriramganapathy commented 3 days ago

Yes, adding a copy button would work well, but I believe this approach might be a bit messy for larger playlists. If the playlist exceeds 1,000 songs, it could cause third-party downloaders to crash, and phones are generally not designed for this kind of intensive activity.

My suggestion is to handle large playlists by providing an option to export the URLs into a plain .txt file containing only the URLs. This file could then be used with third-party downloaders for more efficient processing.

For example, using yt-dlp, the following command could be used:
yt-dlp --extract-audio --audio-format mp3 -a "filename.txt"

This approach would be much cleaner and more reliable for handling large playlists.

akashsriramganapathy commented 3 days ago

Additionally, we can achieve this with the current setup itself by using the export playlist option. However, the exported file contains a JSON structure, so we would need to remove the JSON formatting and extract only the URLs to make it usable for third-party downloaders.