Closed estatistics closed 2 weeks ago
Add --
before you start with the list of IDs to indicate to yt-dlp that no more regular arguments follow.
So instead of
yt-dlp -F "-40JTHtTjCk"
You would run
yt-dlp -F -- "-40JTHtTjCk"
Alternatively, you can use -a
to load in a list of URLs/IDs (docs).
THANKS!
Is the --
behaviour actually documented?
The optparse documentation says that its default behaviour is to support "... only the most common command-line syntax and semantics conventionally used under Unix" and then summarises these with no mention of the --
convention for ending the option list.
yt-dlp overrides the default argument processing with parse_known_args()
but both implement the --
option break.
Since this isn't an obvious feature of the program or Python-based programs generally (nor is it universal even in GNU/POSIX despite ...), it should be in the help's option list, both here and upstream. Presumably the automatic generation of the list skips it as a prefix of other options?
This is domumentation about that exact case: How do I download a video starting with a -
?
Wouldn't it be better to document the --
option internally?
It looks like the only easy way (say, without patching .print_help()) to do that would use the
description/
epilogoptions of
_YoutubeDLOptionParser/
optparse.OptionParser. yt-dl could use
epilog` but that's spoken for here. Maybe:
description='Use option -- to force treatment of all subsequent items as URLs',
DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE
Checklist
Provide a description that is worded well enough to be understood
yt-dlp cannot download video using its id code: no such option: -0. How i can do it?
I use to download videos from youtube using their ids: yt-dlp id, and its works. but now "-40JTHtTjCk" this is got as option and not as id. what i must do?
Maybe, just maybe you can do it as in ffmpeg style eg.: yt-dlp "ids: -40JTHtTjCk dfdsftTjCk j56gfdg .... "
Provide verbose output that clearly demonstrates the problem
yt-dlp -vU <your command line>
)'verbose': True
toYoutubeDL
params instead[debug] Command-line config
) and insert it belowComplete Verbose Output