axcore / tartube

A GUI front-end for youtube-dl, partly based on youtube-dl-gui and written in Python 3 / Gtk 3
GNU Lesser General Public License v2.1
1.92k stars 105 forks source link

Possible to create sub directories in each channel folder for each year? #588

Closed Gaffers2277 closed 7 months ago

Gaffers2277 commented 9 months ago

i'm trying to download some channels and was wondering if i could create sub folders for each year. For example:

Channels
    MxRMods
        2017
            2017-01-05 - THE GREATEST IDEA EVER? - Skyrim Mods - Week 218 - [5ymUh6VeOGc].info
            2017-01-05 - THE GREATEST IDEA EVER? - Skyrim Mods - Week 218 - [5ymUh6VeOGc].webp
            2017-01-05 - THE GREATEST IDEA EVER? - Skyrim Mods - Week 218 - [5ymUh6VeOGc].webm
        2018
        2019
        2020
        2021
        2023
    Internet Today
        2018
        2019
        2020
        2021
        2022
        2023

I do have a basic python script i used to use with my own YT-DLP script that checks the file name for the date and creates folders and moves the files to the corresponding folders. But i assume if i use this the TarTube Database will break. Is it possible to create folders for each year so they show up in my Jellyfin Library as Seasons without breaking TarTube? Or is it possible to add custom scripts to run after TarTube has done its own thing?

axcore commented 9 months ago

If you are downloading videos from Tartube's Videos tab, then I'm afraid it's not directly possible. The codebase expects everything in one channel to be in the same folder (with a couple of common exceptions, such as sub-folders for thumbnails; the exceptions are described in the README).

A workaround would be to add the same channel to Tartube's database multiple times. You could call the channels "MxRMods 2017", "MxRMods 2018", etc. Then you could apply a different set of download options to each channel, disabling video downloads from other years.

If you are downloading videos from the Classic Mode tab, then of course it's different; you can use output templates to create any number of sub-folders. This exact situation is in fact described in yt-dlp's documentation.

For example, click the menu in the top-right corner of the tab, then select Edit download options > Files > File names. In the dropdown box, select Custom, and in the box besides it, enter this output template:

%(upload_date>%Y)s/%(title)s.%(ext)s

example

You could do the same thing in the download options for the Videos tab, as long as you don't care about a broken database. (If Tartube's database is not able to keep track of your downloaded videos, that shouldn't affect yt-dlp's operations for the most part. Maybe it's an acceptable compromise for you.)

axcore commented 9 months ago

Or is it possible to add custom scripts to run after TarTube has done its own thing?

Sorry, that has never been implemented, and for the same reason: in the Videos tab, it would break the database, and in the Classic Mode tab, you can use file output templates to do most of the same things.