Safe filenames #3

Closed
opened 2024-05-14 16:48:26 +03:00 by DarkCat09 · 2 comments
Owner

Now, AC/DC is splitted into 2 directories, while it should be one artist directory AC-DC.

  1. Replace slashes in filenames (in artist, album, track fields in outtmpl)
  2. Find out which other characters are restricted; I know that "?" cannot be in a filename on Android
  3. Maybe optimize this replacement using regexps
Now, `AC/DC` is splitted into 2 directories, while it should be one artist directory `AC-DC`. 1. Replace slashes in filenames (in artist, album, track fields in outtmpl) 2. Find out which other characters are restricted; I know that "?" cannot be in a filename on Android 3. Maybe optimize this replacement using regexps
Author
Owner

Okay, yt-dlp has S format type in outtmpl for sanitizing string as filename.

  • %(smth)#S restricts almost all symbols except alphanumeric as I can see (also breaking Russian song/artist/album names)
  • %(smth)S correctly sanitizes filename, but has an interesting feature: it replaces slash with ⧸ U+29F8 BIG SOLIDUS

I'm going to use S without # flag for the sake of simplicity. I don't know how to replace my own character set with _ efficiently and without creating one more post-processor (could be used to modify filename at before_dl).

Okay, yt-dlp has `S` format type in outtmpl for sanitizing string as filename. - `%(smth)#S` restricts almost all symbols except alphanumeric as I can see (also breaking Russian song/artist/album names) - `%(smth)S` correctly sanitizes filename, but has an interesting feature: it replaces slash with `⧸ U+29F8 BIG SOLIDUS` I'm going to use S without # flag for the sake of simplicity. I don't know how to replace my own character set with `_` efficiently and without creating one more post-processor (could be used to modify filename at `before_dl`).
Author
Owner
https://git.dc09.ru/DarkCat09/musicdlp/commit/d8f0172e958140582d1f94871be26d0f11a845da
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: DarkCat09/musicdlp#3
No description provided.