Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Add argument to return the extractor that will be used? #13539
Comments
|
Matching extractor's |
|
Cool, thanks for the quick response, it's trivial to handle on my end with a regex... |
Before submitting an issue make sure you have:
What is the purpose of your issue?
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