Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Filenames should be filtered on --literal too #441
Comments
|
Actually, I'd suggest an option to force FAT32 filename restrictions everywhere since the same restrictions apply to FAT32 filesystems no matter where you mount them. (I know NTFS has a POSIX mode where only NUL and / are forbidden, but I'm not sure whether the Linux ntfs-3g driver uses it or whether it enforces the Win32 mode for compatibility) Either way, here are what I'd recommend filtering at bare minimum to ensure people don't get an unpleasant surprise when they try to copy a file to a thumbdrive:
As is, since |
|
I belive there are a lot of people using youtube-dl unter linux and don't bother about be able to copy the files to FAT/NTFS filesystem. On the other hand a lot of video titles uses some characters you can't use on FAT and any filtering of them makes the filename unnacessary ugly. Filtering only the forward-slash would be not that ugly. There could be something like --filter-filenames=[FAT|UNIX] as a parameter. |
|
@Blacker47 I wouldn't really mind that but what examples do you have in mind? Also, it may not be as bad as you're thinking in FAT mode:
That just leaves Anyway, my main concern is trying to get the default behaviour to be as comfortable as possible for the largest variety of people possible. |
|
+1 on using fancy Unicode characters instead of |
|
With the new |
|
Using non-ASCII with FATxx is not allways a good idea. The ONLY security related problem is not to escape the only ONE char, '/' (and on windows ''). I don't see any clue to aliasing --literal to --title because the escaping of one char is too much work. (I haven't checked the todays build for this issue - maybe it is fixed allready) |
|
We consolidated the behavior now, see https://github.com/rg3/youtube-dl#output-template
Does this address the issue? |
|
--title seems to make on linux the expected job now. Thanks. |
Using --title converts too much (spaces to underscores) for a modern filesystem.
Using --literal don't filter slashes out that produces ugly sub-directories. Maybe a directory-traversal with overwriting of important files is possible too.
IMHO, using --literal should filter slashes "/" anyway on a unix-system. On windows there would be some more chars.
In case the idea don't fits in the meaning of "literal" there could be a "almostliteral" option for unix-systems.