自己开发的一个下载器。(selfuse)
安装依赖项。
$ pip3 install -r 要求.txt
检查使用情况。
$ python3 main.py -h usage: main.py [-h] [--src SRC] [--save SAVE] [--max MAX] [--interval INTERVAL] [--chunk CHUNK] fastDownloader v0.0.1 options: -h, --help show this help message and exit --src SRC This parameter specifies the file path where the links to be downloaded are stored. --save SAVE This parameter specifies the path for storing the downloaded files. No / at the end. --max MAX This parameter specifies the concurrency level. --interval INTERVAL This parameter specifies the interval of requests. --chunk CHUNK This parameter specifies the number of bytes to be read per download.
[“url1”,“url2”...]
成功
$ python3 main.py --src ./test_success.json --max 3 --chunk 1024> 正在下载-3557342921266950271_500!> 正在下载-2865197712751752189_300!> 正在下载-700390739090695736_600正在下载!> 正在下载5636641034660171054_700!> 正在下载5773939477608183504_400!> 正在下载1310250945337633844_200!> 所有资源已成功下载!已下载 6 失败 0 剩余 0: 100%|██████████████████████████| 6/6 [00:01<00:00, 4.33it/s]# 注意:文件名前面的一长串字符是#唯一的哈希码,用于保证文件命名的唯一性。
失败的
$ python3 main.py --src ./test_failed.json --max 3 --chunk 1024> 立即下载-6762229335681689814_700!> 立即下载-55066400530373971_600!> 立即下载-2931830335596416142_500!>正在下载 2353655904693015958_300!> 正在下载 -5222952479054798371_non-existent-url!> 1 个文件下载失败!> 请使用“python3 main.py --src failed.json --save 重新运行。 --max 3 --interval 0.5 --块 1024"已下载4 失败 1 剩余 0: 100%|██████████████████████████| 5/5 [00:01<00:00, 4.53it/s]
请按照说明重新运行。