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

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

Closed
3 tasks done
ifixthat-gmx opened this issue Oct 6, 2024 · 2 comments
Closed
3 tasks done
Labels

Comments

@ifixthat-gmx
Copy link

Checklist

  • I'm asking a question
  • I've looked through the README and FAQ for similar questions
    above links are not working:

Zugriff gesperrt
Aufgrund eines Urteils des Landgerichts Hamburg ist der Zugriff auf diese Website gesperrt.

  • I've searched the bugtracker for similar questions including closed ones

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"

  • tmpstore=html,json --> tells the extractor to save the webpages html (get variables for the json-link here), and the downloaded json (contains the wanted video-playlist-data)
  • pathprefix tells the location for the html and json (I want store them in a different location than the video)

--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
Copy link
Contributor

dirkf commented Oct 7, 2024

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:

  • --extractor-args ... for passing extractor-specific parameters: this will soon have to be implemented here, to control client selection in the YT extractor;
  • --paths TYPE:LOCATION to specify a directory to be used for the TYPE files.

@ifixthat-gmx
Copy link
Author

ifixthat-gmx commented Oct 7, 2024

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 ?

@dirkf dirkf closed this as completed Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants