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

Add playlist download option #228

Open
omar-azmi opened this issue Jan 10, 2025 · 2 comments
Open

Add playlist download option #228

omar-azmi opened this issue Jan 10, 2025 · 2 comments

Comments

@omar-azmi
Copy link

Hi there, thank you for the amazing project!

I was wondering if you would be interested in adding the ability to download a whole playlist to the user's filesystem, alongside a ".m3u" playlist file, so that it can be played by a local music players.

I hacked up a repo that does that over here: https://github.com/omar-azmi/animethemes-dl
And I think it can be easily ported over to the client side as well.

Would you like me to try implementing this feature in a PR?

Things to consider:

  • Clients might use the download feature too often, placing burden on the server's bandwidth.
  • The m3u playlist file does not specifically require the audio file to be on the filesystem. It can reference http sources as well (it's up to the music player whether it'll support it or not).
    So, it is possible to make a variation that will generate http referenced m3u files (so that clients will not have to download the audio files). Which option would you rather prefer? (local, http, or both?)
  • Bulk playlist video downloading is also achievable; however, it will place excessive strain on the server's bandwidth and running cost. Maybe it would be wiser to generate a partial torrent file that reflects the demanded video list (assuming that such a thing is possible with ".torrent" files (related question)).
  • The total download size can easily reach around a gigabyte, so an intermediate in-browser-memory storage of all the files (in a tar or zip archive) would not be practical. Instead, the downloads should be appended to the client's filessytem progressively, using the file-system-access api.

Possibly related issues:

@Maniload
Copy link
Member

Hey 👋 First of all thank you for taking the time and putting so much thought into your suggestion. A download option for playlist was initially planned as you can see in the issue you linked. You also already pointed out why it hasn't been added yet: bandwidth.

We are fine with users downloading individual videos directly from the site, but downloading entire playlists could amount to up to hundreds of gigabytes of traffic. Our hosting provider only provides us with a limited amount of bandwidth per month and we already hit the limit once. That's why we always refer to our backup torrent for such use-cases.

Now I guess it would be possible to implement a way to fetch playlist items from the torrent. Either by limiting the downloaded torrent files to the ones from a playlist (probably needs an integration with a torrent client) or by filtering the files from an already completely downloaded archive.

Regarding m3u files, I feel like this is a very niche use-case and would be easy to implement as a user script or browser extension. I don't think this should be in the client to be honest.

This leaves us with your last idea, which I actually quite like. It feels a bit like the download feature from pages like YouTube. It could still lead to users mass downloading video files, but maybe it has the benefit that subsequent requests could make use of the local copy thus removing the need to fetch anything completely. Exporting the files to a ZIP archive or something should also be simple that way.

If anything I could see this in the client, although it's probably a bit more work to implement. But if you want to work on it, go for it ^^ We have a Discord server where we coordinate development, so maybe you want to join that.

@omar-azmi
Copy link
Author

Thank you for the detailed reply.

In my opinion, the primary use-case for downloading audio files in bulk is that it would be very convenient for mobile users. Since most folks listen to music on their phones; having a local copy of the audio files would save up their mobile data (and the sever's bandwidth), in addition to giving them the ability to play it on the music player of their choice.
But I totally agree that video files shouldn't be availble for bulk downloading directly from the hosting server.

Regarding the download size, I imagine that downloading audio files in bulk shouldn't be too demanding on the server's bandwidth, compared with video file sizes.
For instance, 500 music files would amount to approximately 1.5 GB, which is roughly the size of 15 video files.
Though, it would probably be wise idea to limit the playlist audio downloading feature to signed-in members only, in addition to imposing some restrictions on the amount they can download in a day/week to prevent abuse.

This leaves us with your last idea, which I actually quite like. It feels a bit like the download feature from pages like YouTube.

I actually hadn't thought of this (i.e. using the user's filesystem for caching video files). But I imagine that implementing such a feature would require significant overhaul to the client side logic, since you'll have to inspect the user's filesystem for a potentially cached video before every fetch call to a video source.

Also, thanks for the Discord link. I'll be sure to check it out before working on a pull request.

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

No branches or pull requests

2 participants