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

Faster downloading using alternative libraries #26352

Open
deepesh-agarwal opened this issue Aug 17, 2020 · 2 comments
Open

Faster downloading using alternative libraries #26352

deepesh-agarwal opened this issue Aug 17, 2020 · 2 comments
Labels

Comments

@deepesh-agarwal
Copy link

@deepesh-agarwal deepesh-agarwal commented Aug 17, 2020

  • I'm asking a question
  • I've looked through the README and FAQ for similar questions
  • I've searched the bugtracker for similar questions including closed ones

Question

On quest for faster downloads in my custom script using youtube-dl as a library, I stumbled upon these https://github.com/juancarlospaco/faster-than-requests/ , https://stackoverflow.com/questions/19724222/pycurl-attachments-and-progress-functions modules which claim to accelrate python downloads.

My questions are:

A). Can youtube-dl use one of these to improve download speeds or it is already optimized?
B). Is there a way to track progress of downloads from external downloaders in the custom python script?

Thanks

@blackjack4494
Copy link

@blackjack4494 blackjack4494 commented Aug 19, 2020

A. Faster-than-requests won't improve download speeds but rather send requests faster. However they have no support for Python2 (nor 32bit if that is still important) and from what I got is that core maintainers are focused on compatibility.
Download speeds should be fine tho. You could try using aria2c as external downloader as that should about max out your download link (or the upload of the server)

B. In what custom python script?

@deepesh-agarwal
Copy link
Author

@deepesh-agarwal deepesh-agarwal commented Aug 19, 2020

@blackjack4494 My python script uses hooks provided by youtube-dl module to show download progress, something as shown below. When using aria2c I guess it won't be possible to grab this progress inside my script, need a solution to that?

def my_hook(d):
    if d['status'] == 'finished':
        file_tuple = os.path.split(os.path.abspath(d['filename']))
        print("Done downloading {}".format(file_tuple[1]))
        handle_finished(d)
    if d['status'] == 'downloading':
        print(d['filename'], d['_percent_str'], d['_eta_str']) 
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.