Even though I'm almost certain there's an easier way to do this, I'm too lazy to learn it at the moment. :mario_flop: :blobblush: :doggoblob:

@hrisskar To be honest, I'm kind of overwhelmed by seeing that ` && youtube-dl`. It's convention for a CLI tool that accepts one path or URL as input to accept any number of them in a single invocation.

Also, single quotes are only needed for a YouTube or Invidious URL if it contains ampersands which the shell would otherwise interpret as the "run in background" version of a semicolon.

Example:

youtube-dl youtube.com/watch?v=cIANk7zQ05 youtube.com/watch?v=Pwe-pA6TaZ youtube.com/watch?v=_7X6Yeydgy

@ssokolow Sadly, youtube-dl sticks its nose straight up and REFUSES to work for me unless I add those single quotes. :doggoblob: Though IIRC it's because I'm using zsh rather than bash; took me a bit of websearching before I learned that's why youtube-dl wouldn't work after migrating from to ! :mario_flop:

@hrisskar That's odd. I'm also using zsh and it works fine here.

Probably some zsh config flag that Manjaro defaults differently to Debian-family distros.

Try sticking echo on the beginning of the command and see what it prints. Maybe it's interpreting the ? as a globbing character and it's configured to remove unmatched globs rather than passing them through as literals. (Bash has an option to do that too)

@ssokolow Something like this:

youtube-dl -ciw invidio.us/watch?v=dFDgf33gSf -o /run/media/blah/Blah de Blah/ya ya/%(title)s.%(ext)s

@hrisskar Oh, you've got an alias or shell function redefining it.

Tell me what `which youtube-dl` says and I'll tell you how to alter it to handle multiple arguments properly.

@hrisskar Sorry. Force of habit. I'm used to using Markdown code snippet syntax everywhere.

Tell me what "which youtube-dl" (without quotes of any kind) says.

@hrisskar Hmm. Unlike bash, zsh's "which" is a shell builtin, so it'll identify functions and aliases.

That it gave you a path suggests that it's getting converted to "youtube-dl -ciw ..." some other way. (Or I misunderstood you.)

First, try prefixing it with "command" to see if that alters its behaviour (eg. "command youtube-dl youtube.com/watch?v=Xc4xYacTu- youtube.com/watch?v=T2br1fAKOG")

("command" tells a shell like bash or zsh to bypass aliases, functions, builtins, etc. and call the on-disk command)

@hrisskar Oh, correction. Put quotes around that. Right now, I just want to get you to reliable not needing ` && youtube-dl` while I find the name of the shell option I suspect of being the culprit for needing the quotes.

Follow

@ssokolow Here's what happened (I left out extra flags and such):

@hrisskar That "no matches found" is the key. You *are* running zsh with one of the globbing options which prevents it from passing un-matched globs through verbatim.

Try running "setopt NO_NOMATCH" and, if that fixes the problem, add it to your ~/.zshrc

If it causes the URL to be omitted from the command, also run "unsetopt NULL_GLOB"

@hrisskar :)

Is it working with multiple URLs in a single youtube-dl command now (no &&) or do we still need to fix that?

@ssokolow Internet's been slow for a while, but looks like we have a success!

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.