woefe / ytcc

Command line tool to keep track of your favorite playlists on YouTube and many other places.
GNU General Public License v3.0
178 stars 20 forks source link

Feature: Option to use custom playlist name in youtube_dl output #82

Closed just-for-reporting-issues closed 3 years ago

just-for-reporting-issues commented 3 years ago

Is your feature request related to a problem? Please describe.

Unable to use the same custom 'name' (ytcc rename) defined in ytcc as youtube_dl output.

Describe the solution you'd like

Would be great to allow the name we define in ytcc to be used as an output in the youtube_dl format option. For example instead of using something like this:

[youtube_dl]
output_template = %(uploader)s/%(title)s.%(ext)s

We can use this:

[youtube_dl]
output_template = %(ytcc_name)s/%(title)s.%(ext)s

Additional context

Would be nice to have a youtube_dl flags options the same as mpv does. Some youtubers have crazy titles (emojii's etc) so being able to pass in --restrict-filenames would be nice.

woefe commented 3 years ago

Adding a restrict_filenames option to the config shouldn't be a problem.

But using the ytcc name in the output_template is tricky, because youtube_dl is not aware of that name. I could probably override the name after youtube_dl's info extraction and the actual download. But using the ytcc name has another problem: the name is not unique, because a video can be on multiple playlists. Which name should we use in case there is more than one? This will lead to unexpected behavior in the future.

woefe commented 3 years ago

restrict_filenames introduced in 916f112

woefe commented 2 years ago

Not exactly in the output template, but I found another solution to the problem in https://github.com/woefe/ytcc/commit/81cbca8e5ea825520304c5c9f8655c5c113234ab. Ytcc now has an option to use subdirectories per playlist. If a video is on multiple playlists it simply gets symlinked to the corresponding subdirectory