Nbdler 是由Python3 编写的异步多客户端、多来源下载工具。
- HTTP
- HTTPS
- 支持断点续传
- 支持多来源多客户端下载
- 支持速度限速
- 支持下载缓冲设置
- 支持代理(取决于客户端)
import asyncio import nbdler async def main(): request = nbdler.Request('http://a/file', file_path='file') async with nbdler.dlopen(request) as dl: dl.start() while not dl.is_finished(): print((f'filename={dl.file.name}, ' f'transfer rate={round(dl.transfer_rate() / 1024)} kb/s, ' f'{round(dl.percent_complete(), 2)} % percent complete')) await asyncio.sleep(1) await dl.ajoin() asyncio.run(main())
import asyncio import nbdler async def main(): request = nbdler.Request('http://a/file', client_policy=nbdler.get_policy(http='aiohttp', https='requests'), max_concurrent=16, file_path='file') request.put('https://b/file') async with nbdler.dlopen(request) as dl: await dl.astart() await dl.ajoin() asyncio.run(main())
$ pip install Nbdler
- Python >= 3.5.3
- aiohttp
- requests
Apache-2.0
- 完善使用文档。
- 实现Handler处理器(SampleValidate 保证多来源下载时的资源匹配)。
- 实现DownloadSession(以便实现下载器的进程隔离,同时实现RPC进程通信)。
- 支持FTP协议。