Zsh says "no matches found" when trying to download video with youtube-dl

20

4

I downloaded youtube-dl using pip on CrunchBang (a Debian Wheezy distro). When I run

youtube-dl {video URL}

I get

zsh: no matches found: {video URL}

I guess it has something to do with zsh, because I found some users on Arch forums complaining about it. When I switched to bash it worked.

Lynob

Posted 2013-09-24T12:21:51.280

Reputation: 3 254

this command solved my issue: setopt +o nomatch Ref => https://unix.stackexchange.com/questions/310540/how-to-get-rid-of-no-match-found-when-running-rm

– Paramesh – 2017-09-09T10:19:20.527

@Ramhound well switching to bash is not a big deal, but why switching to bash every time you want to download a video? besides i was working in virualenv switched to bash to try it and now my virtualenvwrapper is messed up, i need to uninstall it for it to work again http://stackoverflow.com/questions/11507186/python-virtualenv-no-module-named-virtualenvwrapper-hook-loader

– Lynob – 2013-09-24T12:29:51.687

Answers

32

Try quoting the URL, e.g.

youtube-dl '{video URL}'

in your notation, to avoid possible interpretation of special characters in the string.

Daniel Andersson

Posted 2013-09-24T12:21:51.280

Reputation: 20 465

1Quotes. I feel like an idiot.. – myol – 2016-06-22T18:03:06.593

why no one mention that? it works, i will accept it in 6 minutes, the system doesn't let me accept it right away – Lynob – 2013-09-24T12:31:26.380

2@Fischer By the way: my Zsh (on OS X in iTerm2 with oh-my-zsh) automatically escapes shell-specific characters like & and !, so there might be an option to configure that. – slhck – 2013-09-24T12:49:42.557

@slhck i just tried it on xterm doesn't work, i don't have xterm2, i'm using oh-my-zsh too.. yes i guess i have to configure my zsh for that, i guess bash does it by default because i haven't configured it, still using the default configuration – Lynob – 2013-09-24T16:59:12.627

2@Fischer: You'll need to load the url-quote-magic funtion to get special shellcharacters to be quotes automatically in URLs: autoload -Uz url-quote-magic; zle -N self-insert url-quote-magic – mpy – 2013-10-03T09:48:03.303

7

This was already mentioned in the comments, but it deserves its own answer:

autoload -Uz bracketed-paste-magic
zle -N bracketed-paste bracketed-paste-magic

autoload -Uz url-quote-magic
zle -N self-insert url-quote-magic

This causes pasted URLs to be automatically quoted, without needing to disable globbing.

Radon Rosborough

Posted 2013-09-24T12:21:51.280

Reputation: 323

Oops, it does work. My bad! – Lenar Hoyt – 2017-09-18T23:39:59.220