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 method extract_info to FileDownloader #710

Closed
jaimeMF opened this issue Feb 24, 2013 · 5 comments
Closed

Add method extract_info to FileDownloader #710

jaimeMF opened this issue Feb 24, 2013 · 5 comments
Assignees

Comments

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Feb 24, 2013

That method would look like this:

def extract_info(self,url):
    #iterate over info extractors
    #and return the list of videos

Then in info extractors instead of calling fd.download([url]), we could call fd.extract_info(url) and append the videos returned to the ones we've already got.
This makes InfoExtractors just get the videos info. If needed file downloader will download them.
It would make easier to use youtube-dl as an API for getting videos info.

the download method would need to be rewritten:

def download(self,urls):
    for url in urls:
    videos=self.extract_info(url)
    #actually download the videos
@phihag
Copy link
Contributor

@phihag phihag commented Feb 24, 2013

Yeah, that would be nice, although at that point, I'd prefer a YoutubeDL class (along with Pythonic module-level methods as a shortcut to it), that setups openers, constructs IEs, handles I/O, and constructs the FileDownloader.

@jaimeMF
Copy link
Collaborator Author

@jaimeMF jaimeMF commented Feb 24, 2013

So, you'd prefer a class for getting the videos info and other for downloading?

@phihag
Copy link
Contributor

@phihag phihag commented Feb 24, 2013

No, one to coordinate everything, with methods like extract, download, postprocess, to_screen and one to actually download.

@jaimeMF
Copy link
Collaborator Author

@jaimeMF jaimeMF commented Feb 24, 2013

Understood.
I think making IE just get only the info is the easiest part, I'll have a look.

@jaimeMF
Copy link
Collaborator Author

@jaimeMF jaimeMF commented Apr 20, 2013

Done

@jaimeMF jaimeMF closed this Apr 20, 2013
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.