ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
131.89k stars 10k forks source link

how to pass a variable or argument to an extractor from command line #32942

Closed ifixthat-gmx closed 1 week ago

ifixthat-gmx commented 1 week ago

Checklist

Question

So for debugging purpose I'd like to pass some dynamic variables to the extractor (I have made some modifications to some of yours but also added new ones in my private repository).

I want to do something like this: youtube-dl --pass2extractor tmpstore=html,json --pass2extractor pathprefix=$HOME/.tmp/%SOME_UNIQ_AND_DYNAMIC% -f .. -o .. "URL"

--pass2extractor %PASS% -> the content of %PASS% should get passed into extractor (it should somehow be available/accessable)

Is it possible to do this and is something like that already implemented?

dirkf commented 1 week ago

There's already the --write-pages option for saving fetched web pages.

yt-dlp has implemented options similar to what you describe, so it may be useful to check those implementations:

ifixthat-gmx commented 1 week ago

There's already the --write-pages option for saving fetched web pages.

I know this - but it doesnt work for me - i need custom path and filename >> more control over which html or json should be saved and where

yt-dlp has implemented options similar to what you describe, so it may be useful to check those implementations:

  • --extractor-args ... for passing extractor-specific parameters: this will soon have to be implemented here, to control client selection in the YT extractor

Oh cool - will look at that later

Thanks for the reference.

@dirkf out of curiosity - have you checked your PR 30774 recently ?