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

Add argument to return the extractor that will be used? #13539

Closed
thehunmonkgroup opened this issue Jul 1, 2017 · 2 comments
Closed

Add argument to return the extractor that will be used? #13539

thehunmonkgroup opened this issue Jul 1, 2017 · 2 comments

Comments

@thehunmonkgroup
Copy link

@thehunmonkgroup thehunmonkgroup commented Jul 1, 2017

  • [ x] I've verified and I assure that I'm running youtube-dl 2017.06.25

Before submitting an issue make sure you have:

  • [ x] At least skimmed through README and most notably FAQ and BUGS sections
  • [x ] Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • [ x] Feature request (request for a new functionality)
  • Question
  • Other

Description of your issue, suggested solution and other information

Curious how hard it would be to add an argument that would simply print the extractor that will be used based on the URL passed?

Looks like that could happen around https://github.com/rg3/youtube-dl/blob/master/youtube_dl/YoutubeDL.py#L752, after the ie.working() check? Not sure, as the try/catch block afterwards seems to suggest that the final successful extractor isn't known until it actually executes something.

My use case is that I'm building a simple wrapper around youtube-dl for downloading videos from YouTube and Vimeo, which use different access control strategies. If I could run something like youtube-dl --show-extractor [url], and have it spit out the name of the extractor it will use for the url in question, I could provide a bit simpler interface for entering credentials to access private videos.

I suppose I could just steal the regex that's used for Vimeo and do my own check against the URL I receive, I just thought it would be cleaner to get the answer from youtube-dl iteself

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jul 2, 2017

Matching extractor's suitable does not mean this extractor will be the final one. Extractors may delegate extraction to another extractors when necessary so it's technically impossible to know the final extractor until extraction is finished.

@dstftw dstftw closed this Jul 2, 2017
@thehunmonkgroup
Copy link
Author

@thehunmonkgroup thehunmonkgroup commented Jul 2, 2017

Cool, thanks for the quick response, it's trivial to handle on my end with a regex...

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.