MrS0m30n3 / youtube-dl-gui

A cross platform front-end GUI of the popular youtube-dl written in wxPython.
The Unlicense
9.3k stars 1.59k forks source link

Add 'Playlist + Index + Title' to 'Filename format' dropdown #239

Open User486375 opened 7 years ago

User486375 commented 7 years ago

I think this would be a useful feature for most users to have default. e.g. %(playlist_index)s-%(title)s.%(ext)s

nodiscc commented 7 years ago

@User486375 I think all that is needed to add a filename template is to

  1. Add a new key in OUTPUT_FORMATS https://github.com/MrS0m30n3/youtube-dl-gui/blob/master/youtube_dl_gui/formats.py#L8
  2. Add a corresponding elif to _build_savepath()
  3. Add a new gettext msgid/msgstr to the english PO file, then to other locales

I agree that it would make sense to add Playlist + Index + Title as %(playlist)s-%(playlist_index)s-%(title)s.%(ext)s. Mind that the filename would probably be weird if you download a video that is not in a playlist using this template.

User486375 commented 7 years ago

@nodiscc To be exact, my suggestion was Index + Title not Playlist + Index + Title. Though I guess you could just add both, but @MrS0m30n3 may not want every single possible option hence the custom option.

After looking into a bit more though, adding PlaylistFolder + (Index + Title) as %(playlist)s/%(playlist_index)s-%(title)s.%(ext)s would be even better imo. As it creates a folder of the playlist rather than adding it to each file name.

Lastly a bit off topic, but regarding the ID option which adds the ID of each song to the file name, I feel like adding it to the metadata like http://peggo.tv/ does, would be a better implementation. Though unless this is already possible with youtube-dl itself? I can suggest there.

nodiscc commented 7 years ago

my suggestion was Index + Title not Playlist + Index + Title

Index + Title can be problematic if your download directory contains multiple playlists. Your file listing would look like 01... 01... 01... 01... 02... 02... 02... witrh no way to group the files by playlist. Your suggestion PlaylistFolder + (Index + Title) as %(playlist)s/%(playlist_index)s-%(title)s.%(ext)sis better indeed.

may not want every single possible option hence the custom option.

Having one good premade filename format for working with playlists would be nice. Let's find a good default.

regarding the ID option which adds the ID of each song to the file name

Having an unique identifier in the filename helps prevent files with the same name from overwriting each other. There are many other ways to store the ID (eg --archive-file) for other purposes, but it makes sense to have this filename format option.

Edit:

Though unless this is already possible with youtube-dl itself? I can suggest there.

I don't think it is possible to store the extractor name/id/original URL... directly to the file metadata using youtube-dl (I just checked, but maybe I missed something), but that would be great. Worth searching/filing a feature request on https://github.com/rg3/youtube-dl/issues in my opinion

User486375 commented 7 years ago

@nodiscc Welp... https://github.com/rg3/youtube-dl/issues/14682