使用pySmartDL并行下载-python multiprocess [英] Parallel downloads using pySmartDL - python multiprocess

查看:131
本文介绍了使用pySmartDL并行下载-python multiprocess的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在我的项目中使用 pySmartDL 处理下载.但是pySmartDL不支持并行下载,并且执行线程会停止,直到下载完成.我尝试使用 WorQ 处理该问题.但是开始下载后就不会进行下载了,是否有更好的方法来解决此问题?还是还有其他支持并行下载的Python库?

I'm hoping to use pySmartDL for my project to handle downloads. But pySmartDL doesn't support parallel downloads and the execution thread stops until a download is finished. I tried using WorQ to handle the issue. But with that download doesn't happen after I start it.Is there a better way to address this issue? Or is there any other Python libraries that support parallel downloads?

推荐答案

pySmartDL已经支持非阻塞多线程下载:

pySmartDL already supports nonblocking multithreaded downloads:

from pySmartDL import SmartDL

files = [URL1,
         URL2,
         URL3]

objs = SmartDL(files, progress_bar=False)
objs.start(blocking=False)
while not objs.isFinished():
    # Do something else

这篇关于使用pySmartDL并行下载-python multiprocess的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆