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

Fix Crucial guide command leads into errors #31277

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

miguelgargallo
Copy link

At university, colleagues and I tried this tool, but all of us got the error at this point:

youtube-dl [OPTIONS] URL [URL...]

youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' URL https://www.youtube.com/watch?v=Toon9VARRIU

youtube-dl-miguelgargallo-contribution

ERROR: You've asked youtube-dl to download the URL "URL". That doesn't make any sense. Simply remove the parameter in your command or configuration. Add -v to the command line to see what arguments and configuration youtube-dl got.

So, to avoid future devs into this error... we love the project and want to improve it!

By just removing the "URL" word.

At university, colleagues and I tried this tool, but all of us got the error at this point:

  youtube-dl [OPTIONS] URL [URL...]

  youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' URL https://www.youtube.com/watch?v=Toon9VARRIU

ERROR: You've asked youtube-dl to download the URL "URL". That doesn't make any sense. Simply remove the parameter in your command or configuration. Add -v to the command line to see what arguments and configuration youtube-dl got.

So, to avoid future devs into this error... we love the project and want to improve it!

By just removing the "URL" word.
@rautamiekka
Copy link
Contributor

You misunderstood it: if you remove URL, the command now reads "optionally enter >=1 URL to use" instead of ">=1 URL required to use".

@gamer191
Copy link

gamer191 commented Oct 5, 2022

How about youtube-dl [OPTIONS] URLS

@gamer191
Copy link

gamer191 commented Oct 5, 2022

You misunderstood it: if you remove URL, the command now reads "optionally enter >=1 URL to use" instead of ">=1 URL required to use".

Technically that's correct though, depending on which options are passed (eg: --update, --batch-file FILE, --list-extractors)

@rautamiekka
Copy link
Contributor

In that sense it's technically correct, true.

Modified kine 52 to
youtube-dl [OPTIONS] URLS
@miguelgargallo
Copy link
Author

miguelgargallo commented Oct 6, 2022

Yeah! Totally true @rautamiekka
I modified into ec1c854

@Lesmiscore
Copy link
Contributor

Lesmiscore commented Oct 7, 2022

I think you also want to modify here,

'usage': '%prog [OPTIONS] URL [URL...]',

as youtube-dl gives:

$ youtube-dl
Usage: youtube-dl [OPTIONS] URL [URL...]

youtube-dl: error: You must provide at least one URL.
Type youtube-dl --help to see a list of all options.

Improvements
@miguelgargallo
Copy link
Author

done!

@dirkf
Copy link
Contributor

dirkf commented Oct 10, 2022

Yes, I can just about see how the original help synopsis might be confusing. Anyhow it's just wrong. The options don't have to precede the URLs and the URLs don't have to be provided if the options mean that yt-dl doesn't expect them.

curl, which has a somewhat similar UI, has the right formulation. man curl:

curl(1)                           curl Manual                          curl(1)

NAME
       curl - transfer a URL

SYNOPSIS
       curl [options / URLs]

...

And also

$ curl --help
Usage: curl [options...] <url>
 ...
$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants