tartube icon indicating copy to clipboard operation
tartube copied to clipboard

[Feature Request] Download channel playlists as file links / shortcuts

Open ErikUden opened this issue 2 years ago • 1 comments

I am unaware of how the shortcut / file link system works on other platforms, so I am not sure how easy it would be to implement such a feature cross-platform, however:

Many channels organize their videos in playlists to fit certain series, events, etc. together. Like “Livestreams” are in one playlist, or “Minecraft Series XY” is in another playlist, where all videos belonging to that genre / series / event reside.

When downloading videos using youtube-dl, all videos publicly available will be downloaded and sorted in a singular directory chronologically, which is what I'd want to have over any type of sort, but still it makes me think an essential part of the channel (playlists) is lost.

However, the alternative (re-downloading each video from a playlist only to have them grouped together) is insanely wasteful in terms of storage management and no archivist would want that. You'd essentially download videos multiple times, that's bad.

So, my solution/feature request would be:

  1. Tartube scrapes the YouTube channel for playlists and the videos inside of those playlists (as suggested in my previous feature request) and then creates a folder with the same name as of that playlist inside of the local channel folder.

Possibly the naming conventions of those “channel playlists” could also be determined inside of the general settings, this way users can call the playlist “playlist_%NAME” or whatever they desire.

Additionally those playlists may also be found inside of Tartube as a drop-down when clicking on the channel, similar to when you click on a folder/directory inside of Tartube, the sub-folders appear.

Inside of that playlist there will be:

  1. A JSON file detailing the name, ID, uploader, etc. of that YouTube playlist, as well as info about every video inside of it (Title, ID, Order Number, upload date, etc.). This way you can have a machine readable standard so that Tartube can check whether the playlist has updated / changed in order to know when to update the local archive of the playlist. I believe such data is already accessible through yt-dl by default and added when a playlist is downloaded, or at least returned by an API request regarding info of that playlist.

  2. Links/Shortcuts to the actual videos in the higher directory.

This is the main feature I'm requesting: it would be bad if every video would be re-downloaded as that would just be a waste of storage, however it would be good to be able to browse playlists of channels as a directory on your PC and then click on a video inside of that local playlist and have it open and play.

This can be achieved without having to download the entire video through shortcuts / links with relative paths.

I am unaware how standardized the shortcut file format is, but I do know that on Windows you can merely create a shortcut to a file, and that shortcut file is truly just a text file with the file path written inside of it. That file path could be relative (“.../nameofvideo.mp4”) this way you continue having a singular channel folder with all the videos of that channel inside of it, but also have any playlists that channel may have had available to browse and play through easily, if you ever wanted to.

(Relative paths would just allow for you to move your Tartube folder anywhere, which is why I'm suggesting it.)


I don't understand how the Tartube database works, but I do believe that it stores the ID of every video downloaded and how that ID correlates to a file path to a video in the local archive.

So, once the API request for info regarding the scraped playlist has returned, the video IDs of that playlist can be compared to the videos downloaded by Tartube for that channel and if they match, the name of the video file from the local archive correlating to the ID can be returned and put into a relative shortcut / file link which can be put into the playlist folder of that channel.


There are multiple issues with my suggestion:

  • What if a video is found inside of that playlist that isn't present in the local archive?

I'd say the shortcut should then just lead to the online video, so if the video hasn't been downloaded yet, the shortcut just links to the actual public video online.

If the playlist is being scraped while the channel is downloaded, that would result in many videos being found inside of the online playlist that haven't yet been added to Tartube's local database (as their download is still in progress). It wouldn't make sense for all of them to be turned into YouTube links, so there are two things that can be done:

A) The playlist scrape is only done after a channel download operation is complete

B) Since the naming convention of downloaded videos for that channel are known, the resulting video IDs from the playlist scrape could be used for another API request for info regarding the video behind that ID (Video title, upload date, etc.), so that the resulting name of the downloaded video file in the local archive could be extrapolated before the video was downloaded in the first place. This way the shortcuts / file links can link to the video before it was downloaded, and once the video is downloaded the shortcuts will just begin working, and the playlist scrape can be done at any moment in time, regardless of when a video in that playlist is being downloaded.

  • Sometimes playlists by channels include, or mostly have, videos from other channels inside of them, for that there are multiple solutions:

A) Simply put the link to the online video inside of the shortcut B) (And this would be unnecessarily complex) check whether the channel that video belongs to has also been archived and then link to that local video as a shortcut there.

  • A more fundamental issue I'd see with this ordeal is the fact that playlists often have a specific order, so the filenames of the shortcuts inside of the local playlist directory would need to have the order number of the video the shortcut links to inserted as the first character, so:

1-videoName 2-videoName 3-videoName ...

The order of videos could be found in the playlist scrape / API request regarding info of that playlist.

Additionally, through the playlist scrape process, unlisted videos may be discovered that are still available in public playlists, which can then be added to the channel download (this way truly every video from that channel is downloaded, not just the ones seen publicly).

I, personally, would like to be able to browse through playlists of channels locally, especially since channels may get deleted and the nice grouping of channel videos into logical playlists would be lost.

I'm unaware of how useful this feature is compared to how hard it is to implement or how many users would actually need it, but for me it's an important part of the YouTube channel that I'd like to archive!

Thanks for maintaining Tartube and taking the time to read through my very long feature requests! Have a wonderful day!

ErikUden avatar Jul 26 '22 09:07 ErikUden

I think that this feature already exists, see this summary. Does it do what you want, without the need to create file-links/shortcuts?

axcore avatar Jul 29 '22 15:07 axcore

Closed for inactivity.

axcore avatar Feb 26 '23 13:02 axcore