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 add a new downloader method #1143

Closed
jaimeMF opened this issue Jul 28, 2013 · 0 comments
Closed

How to add a new downloader method #1143

jaimeMF opened this issue Jul 28, 2013 · 0 comments

Comments

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jul 28, 2013

I've written a downloader for f4m manifests (the code is in this repo: https://github.com/jaimeMF/f4m-dl), I want to integrate this in the youtube-dl code. This is my proposal:

  1. Move all the download code to a new downloader module.
  2. Use FileDownloader as the base class and move the HTTP file downloading code to a new method.
  3. Write a class that would be used by YoutubeDL that given an info dictionary decides which method it should call.
  4. Allow to specify which downloader to use use in the info_dict, like: 'downloader': F4M_DOWNLOADER (where F4M_DOWNLOADER is a constant from the downloader module)

Instead of creating a new module and new classes it may be better to just add the f4m download process tas a new method, as with rtmp. But I think that all the flv handling code shouldn't be in FileDownloader.py, that's why I prefer the other method, although this is simpler.

There's also more reasons why I think is better to split the code in different classes:

  • When using the f4m downloader multiple files are downloaded, which will produce different progress_hook calls, but the listener may only be interested in the final file progress, not the individual file.
  • Sightly related to the previous point, currently there's a progress viewer for each fragment, but trying to use only one for the final video (some videos are divided in more that 100 parts) is quite hard if it's a method from the same class.
@jaimeMF jaimeMF closed this Feb 24, 2014
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
1 participant
You can’t perform that action at this time.