Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filenames #546

Closed
kickerofelves opened this issue Nov 25, 2012 · 7 comments
Closed

filenames #546

kickerofelves opened this issue Nov 25, 2012 · 7 comments

Comments

@kickerofelves
Copy link

@kickerofelves kickerofelves commented Nov 25, 2012

In the old days, youtube-dl did a fine job of sanitizing filenames. At some point recently, the '&' no long became rewritten as '_'. This is bad for *nix. Now I do an update and see the results of this commit 42cb53f removing the underscores. I don't see how this is smarter. Now I can't simply double click to capture the entire filename. Please change it back.

@phihag
Copy link
Contributor

@phihag phihag commented Nov 26, 2012

I'm regularily using youtube-dl on a Linux system and can't follow why ampersands should be bad for *nix. Can you elaborate?

In any case, if this affects just the ampersand and it is really a serious impediment for multiple users, I'm fine with blacklisting that character (or replacing it with underscores).

Personally, I'd prefer a video filename like AT&T.mp4 to AT_T.mp4, and every shell from this millenium will automatically escape those characters when one presses Tab anyways. @FiloSottile What would you prefer?

@FiloSottile
Copy link
Collaborator

@FiloSottile FiloSottile commented Nov 26, 2012

Every shell has its special characters, and a shell user needs to account for those by himself, as we can't possibly escape them all. I would keep the &.

Also, I thought that he was having issues with the & in he URL (probably read too fast). If so, there's nothing we can do about it anyway.

@kickerofelves
Copy link
Author

@kickerofelves kickerofelves commented Nov 26, 2012

If you have a directory with many (50+ e.g.) files, it is usually simpler and faster to just double click the filename than to rely on tab expansion. Now FiloSottile has eliminated underscores this is no longer possible.

"Every shell has its special characters, and a shell user needs to account for those by himself." Do you know how many times I've seen Windows users recommend youtube-dl to other Windows users? Never. This is a *nix world program and every major shell uses '&' for job control. (And I think it's a special concatenation character on Windows.) No one has said to "escape them all" but '&' is not some weird minor character.

I could just write a patch to revert to older, saner functionality but with the binary that is more difficult and the instructions at https://github.com/rg3/youtube-dl#what-is-this-binary-file-where-has-the-code-gone don't even work.

Finally, you closed the other issue I submitted #547 before I could respond and said "I'm unsure over where to include that information." How about on the documentation page? http://rg3.github.com/youtube-dl/documentation.html Of course that page is still says yahoo video is supported so maybe it needs a lot of updating. Thanks for the ~/.config/youtube-dl.conf info.

@FiloSottile
Copy link
Collaborator

@FiloSottile FiloSottile commented Nov 26, 2012

If you have a directory with many (50+ e.g.) files, it is usually simpler and faster to just double click the filename than to rely on tab expansion. Now FiloSottile has eliminated underscores this is no longer possible.

Sorry, I don't get the double-clicking thing. Also, do you mean that we don't replace amps or spaces or what with underscores?

"Every shell has its special characters, and a shell user needs to account for those by himself." Do you know how many times I've seen Windows users recommend youtube-dl to other Windows users? Never.

Do you know who wrote me last week? www.easybrakeconverter.com (http://www.easybrakeconverter.com/)
And this is the only I can disclose, as I asked for permission, but scrape a bit the bug tracker.

This is a *nix world program and every major shell uses '&' for job control. (And I think it's a special concatenation character on Windows.) No one has said to "escape them all" but '&' is not some weird minor character.

!, ?, (, ), ", ' and space will all be deadly to my shell, if unescaped.

I could just write a patch to revert to older, saner functionality but with the binary that is more difficult and the instructions at https://github.com/rg3/youtube-dl#what-is-this-binary-file-where-has-the-code-gone don't even work.

Please, detail what you mean by "saner" functionality. If the community and the other developers appreciate it, I'll implement it myself.
Also, the code is only a folder away (there are three folders in the repo) and the FAQ is only off by "make compile" -> "make youtube-dl". Fixed.

Finally, you closed the other issue I submitted #547 (#547) before I could respond and said "I'm unsure over where to include that information." How about on the documentation page? http://rg3.github.com/youtube-dl/documentation.html Of course that page is still says yahoo video is supported so maybe it needs a lot of updating. Thanks for the ~/.config/youtube-dl.conf info.

Yes. We need to update documentation. And you can comment on closed issues. And reopen them, if there's anything left.

Now, please be positive and constructive, and keep the atmosphere relaxed (better than I'm doing ATM) because I also have history to study, and phihag has a thesis ongoing, and we are here only to help.

@FiloSottile
Copy link
Collaborator

@FiloSottile FiloSottile commented Nov 26, 2012

Oh, wait, got it. Double-clicking to select the text. I fear that there are a number of similar breaking characters, space first. I think this is a beauty-usability tradeoff. I'm for --id -> usability and --title -> (working) beauty.

@rg3
Copy link
Collaborator

@rg3 rg3 commented Nov 26, 2012

In an xterm-like terminal, characters are sorted in classes. When you double-click on a character, it selects the full group of neighbour characters that belong to the same class as the one you clicked on. This is explained in the "CHARACTER CLASSES" section of the xterm manpage.

Fortunately, you can change the character class of the ampersand character to make it belong to the letters class. Is this an appropriate solution for the OP problem?

@phihag
Copy link
Contributor

@phihag phihag commented Nov 26, 2012

@kickerofelves As @FiloSottile said, just because #547 is closed doesn't mean that you cannot comment or reopen it. I just got the impression that using the configuration file would almost certainly solve your problem. Please discuss everything related to that issue there. Thanks!

Also note that the binary version has no effect on development - in fact, it makes it easier since we now can split the code across multiple files. The following instruction (copied from the FAQ should work:

git clone git://github.com/rg3/youtube-dl.git
cd youtube-dl
python -m youtube_dl --help

If it doesn't, please file an issue with details on what doesn't work. So feel free to submit patches to the youtube_dl/* files.


I believe the new --restrict-filenames option in youtube-dl 2012.11.27 solves your problem. As mentioned above, you can add it to /etc/youtube-dl.conf to make it the default, or simply create a shell alias. If it doesn't, feel free to comment here and reopen this issue, or simply open a new issue. Thank you for reporting issues with youtube-dl!

@phihag phihag closed this Nov 26, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.