Jeeaaasus / youtube-dl

Automated yt-dlp Docker image
https://hub.docker.com/r/jeeaaasustest/youtube-dl/
MIT License
258 stars 33 forks source link

individual output / config for each Channel/Playlist? #60

Closed Patzl92 closed 2 years ago

Patzl92 commented 2 years ago

Hi, can you define args for each added Channel/Playlist or is there only the global args (args.conf) ?

Coming from youtoube-dl-material, where you could set individual outputs and format args for each channel as you add the url, i set up individual output folders for each channel.

e.g. Playlist A goes to -> volume1/Youtube/Lets Plays/S01/PlaylistA (1080p - like set in args.conf) Playlist B goes to -> volume1/Youtube/Itchy Boots/S01/PlaylistB (and because i like Itchy Boots -> Resolution -> 4K)

I tried to add the custom args in the channel.txt behind the url but this didn´t work. Woud this be possible?

Thank you very much Patrick

Jeeaaasus commented 2 years ago

Hi @Patzl92 :)

can you define args for each added Channel/Playlist or is there only the global args (args.conf) ?

Yes args.conf is only global args, unless there is an yt-dlp feature I'm unaware of. args.conf is given to yt-dlp as --config-location desc: "Location of the main configuration file .."

Coming from youtoube-dl-material, where you could set individual outputs and format args for each channel as you add the url, i set up individual output folders for each channel.

My image don't have a system like that. Only way to achieve the same with my image would be to run multiple container of it. Personally I run a script to organize, rename and whatever after the fact, separately on my server.

I will consider adding this functionality but I feel it's quite complicated and I don't know how I would implement it. Probably wont happen sorry.

Feel free to ask more questions if you would like to. :)

Patzl92 commented 2 years ago

Hi Jeeaaasus, yes, a script could also work, will do that. Thank you for your answer and this image! :)

Jeeaaasus commented 2 years ago

Actually I stand corrected, might not be too complicated. After thinking some more about it, I really like the idea and maybe have something working .. Testing it right now with the 'unstable' image. If you want to, I would appreciate it if you also give it a try!

For now it's undocumented, here's the brief explanation. In channels.txt after each url on the same line, you can now add ' | ' to append extra arguments for that specific url.

Things to keep in mind.

Example with custom format and output:

https://www.youtube.com/channel/UC0vBXGSyV14u56gQw | --format 'bv+ba/b' --output '/custom-path-per-url/%(title)s.%(ext)s'

Thank you for improving my image, hopefully this works as you wanted.

Patzl92 commented 2 years ago

Hi Jeeaaasus, Sorry for the late response. I tested the unstable image and it is working like a charm!

i disabled the --output arg in the args.conf and added the it in the Channels.txt

Test1: 1080p https://www.youtube.com/playlist?list=PL8M9dV_BySaXAcvOFRz-nz97x2eEHqZSr | --output "/download/1080p/%(uploader)s/S01/S01E%(autonumber)s - %(title)s.%(ext)s" --format "bestvideo[ext=mp4][height<=1080]+bestaudio[ext=m4a]/mp4"

Test2: 4K with different Name (S02) and Folder Output https://www.youtube.com/playlist?list=PL8M9dV_BySaXAcvOFRz-nz97x2eEHqZSr | --output "/download/4K/%(uploader)s/S02/S02E%(autonumber)s - %(title)s.%(ext)s" --format bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4

this seems to also overrule the default download resolution setting in the env parameter (youtubedl_quality), wich i left untouched (1080).

Thank you very much for your efforts!

Jeeaaasus commented 2 years ago

Thank you for testing, appreciate that :)

i disabled the --output arg in the args.conf and added the it in the Channels.txt

no need, as any arguments you add overrides the same ones from args.conf.

this seems to also overrule the default download resolution setting in the env parameter (youtubedl_quality), wich i left untouched (1080).

Yes. This is because the builtin --format that is using the env youtubedl_quality is being overridden, you can use it if you'd like by specifying it like the example below. The "Test1: 1080p" but using the env for resolution. --format "bestvideo[ext=mp4][height<=$youtubedl_quality]+bestaudio[ext=m4a]/mp4"

When yt-dlp gets another release version this feature will become part of the normal latest image and I highly suggest you don't continue using the unstable image.

I'll also add some documentation explaining all this later.