自己開發的一個下載器。
安裝依賴項。
$ 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!正在下載56立即下載36641034660171054_700! 5773939477608183504_400! >正在下載1310250945337633844_200! >正在下載1310250945337633844_200! ████| 6/6 [00:01<00:00, 4.33it/s]# 注意:檔案名稱前面的一長串字元是#唯一的雜湊碼,用來保證檔案命名的唯一性。
失敗的
$ python3 main.py --src ./test_failed.json --max 3 --chunk 1024> 立即下載-6762229335681689814_700!下載235 3655904693015958_300 現在! 5222952479054798371_不存在-url now! 4 失敗1 留下 0:100%|█████████████████████████| 5/5 [00:01<00:00, 4.53it/s]
請按照說明重新運行。