Git Product home page Git Product logo

Comments (5)

Grub4K avatar Grub4K commented on June 3, 2024 1

This is domumentation about that exact case: How do I download a video starting with a -?

from yt-dlp.

seproDev avatar seproDev commented on June 3, 2024

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).

from yt-dlp.

estatistics avatar estatistics commented on June 3, 2024

THANKS!

from yt-dlp.

dirkf avatar dirkf commented on June 3, 2024

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?

from yt-dlp.

dirkf avatar dirkf commented on June 3, 2024

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',

from yt-dlp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.