通过http(s)有效下载文件的模块
dowp的Python项目详细描述
功能
- 能够下载任何文件类型
- 多线程以运行并行下载(如果支持的话)
- 连接丢失时可恢复的下载
- 跨平台支持
- 每个块/整个文件的定时基准
- 文件验证,通过哈希检查
安装
要安装Dowpy,请使用pip:
$ pip install dowpy
用法
url="https://gph.to/2BTy5xU"# To create a single thread downloaddow1=SingleDow(url)# To create a multi threaded download with 3 parallel downloadsdow2=MultiDow(url,3)# To start the downloaddow1.start()
文档
在开始下载之前,可以设置以下属性:
prop | type | Desc |
---|---|---|
.url | string | The direct url to the file to request |
.chunks | int | The # of parallel threads to download the file with (MultiDow only) |
.writeLocation | string | File location to download the file |
.fileName | string | Name of the downloaded file |
.hash | string | Known hash to test the file with |
以下属性返回有关下载的信息:
prop | type | Desc |
---|---|---|
.status | string | Returns the current status of the download (initialized, downloading, complete) |
.sizeInBytes | string | Returns the size of the file in bytes |
.startTime | string | Start time of the download |
.endTime | string | End time of the download |
.elapsedTime | String | Total time of download |