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.
Custom filename transformations (was: Filename: I want to restrict characters, but permit spaces) #5042
Comments
|
If you are using a modern GUI tool, why are you restricting characters in the first place? |
|
Because I want readable file names. The code of modern GUI programs may be 8-bit smart, but I want to be able to read filenames. And, as long as the only issue is spaces, most of what I want to do from the command line works -- bash escapes spaces. Just as long as it's either a real program, or a well-written script (and I've gotten quite good with the whole "$var" syntax all over everything ... yuck, why wasn't this in the shell design from day one?) |
|
Can you elaborate on why filenames would get more readable when you pass in
As it stands, this issue is lacking context, and without context, we usually close issues. So please do provide a more detailed example of why you'd wanna restrict filenames in the first place. |
|
Here is a directory listing keybounceMBP:Etho michael$ ls Modded minecraft episodes 13-15 were downloaded with youtube-dl, as 480p (thank you for decoding the dash data and fetching it); the rest were from a firefox extension ("Download YouTube Videos as MP4") that fetches the 360p feed. The name change is significant, and breaks programs like mplayer that auto-play the next one, or even the sorting of files in Finder or the command line. |
|
Other similar ideas: In my opinion 2. is still a valid request even in 2017. Quite a few emojis are not in the basic multilingual plane (BMP) of Unicode. In other words, applications should support at least UCS-4 (UTF-32) to handle them correctly. Besides Android, Konsole/QTerminal don't work well, either. They use Qt's QString, which are UCS-2 internally. Update: iTerm2 goes crazy with some emojis, too |
|
On some videos I'm downloading, I encounter emojis (example), or UTF-8 accents (example). Because of these characters, I'm encountering the following issues:
So, I searched a bit and found the I suggest adding a |
|
Any update on this issue? |
|
Files are not downloaded if there is a # in the filename. Could it be possible to have an option just to restrict illegal characters ? |
|
Chipping in to also say that I'd love to see this feature to strip down emojis or add filters to output file names. Sometimes clips being downloaded have emojis in their titles and it tends to cause weird issues with other software, such as not detecting the file or crashing. |
|
How is this issue solvable? |
|
to strip most emojis from the final filename, add this --exec switch (it's one single line):
this was tested on the penguinean operating system. Credits: extra:
|
|
P.S.
the It's a simple substitution that can be done with tools like |
|
I appreciate the comprehensive scripts nestukh. Can this be easily replicated on Windows too, as in just replacing the appropriate syntaxes from the original script? |
|
Probably yes, also you will need no changes under WSL (GNU/Linux subsystem for Windows 10), MSYS2, Cygwin or others minimal GNU/Linux layer implementations on Windows. |
Right now, restricting filenames to reasonable characters also prevents spaces.
Yea, I know, most unix scripts/etc. can't handle spaces, but most modern GUI tools can.