簡體   English   中英

Python腳本使用curl來部分下載大文件

[英]Python Script to download large files in parts using curl

我的研究所不允許文件下載超過300MB,因此我想到了部分下載文件的技巧! 現在,我想簡化任務並使用python創建腳本! 我正在使用os.system()執行命令!

我的計划是使用這個curl --range 300000000 * X-(300000000 *(X + 1)-1)[url] -o filename.partX#X是零件號

但是我不知道如何終止循環! 我怎么知道文件的所有可用部分都已下載! 誰能幫我這個忙嗎?

# repeat download if fail to download the big file
until curl -C - -o partial_file.zip http://example.com/file.zip; do
    echo Tansfer disrupted, retrying in 10 seconds...
    sleep 10
done

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM