diff options
author | Adrien Guinet <adrien@guinet.me> | 2020-09-26 18:03:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-26 18:03:41 +0200 |
commit | 1c06e9fce42fc9060e9628013b8297ce5c3d2ac0 (patch) | |
tree | 1e47dba1ef1f32a0e80782c3f1f4c0918906366f /samloader/fusclient.py | |
parent | add better error handling to checkupdate (diff) | |
download | samloader-1c06e9fce42fc9060e9628013b8297ce5c3d2ac0.tar samloader-1c06e9fce42fc9060e9628013b8297ce5c3d2ac0.tar.gz samloader-1c06e9fce42fc9060e9628013b8297ce5c3d2ac0.tar.bz2 samloader-1c06e9fce42fc9060e9628013b8297ce5c3d2ac0.tar.lz samloader-1c06e9fce42fc9060e9628013b8297ce5c3d2ac0.tar.xz samloader-1c06e9fce42fc9060e9628013b8297ce5c3d2ac0.tar.zst samloader-1c06e9fce42fc9060e9628013b8297ce5c3d2ac0.zip |
Diffstat (limited to 'samloader/fusclient.py')
-rw-r--r-- | samloader/fusclient.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/samloader/fusclient.py b/samloader/fusclient.py index 6836923..2acb165 100644 --- a/samloader/fusclient.py +++ b/samloader/fusclient.py @@ -24,9 +24,12 @@ class FUSClient(object): self.sessid = r.cookies["JSESSIONID"] r.raise_for_status() return r.text - def downloadfile(self, filename): + def downloadfile(self, filename, start=0): authv = 'FUS nonce="' + self.encnonce + '", signature="' + self.auth + '", nc="", type="", realm="", newauth="1"' + headers = {"Authorization": authv} + if start > 0: + headers["Range"] = "bytes={}-".format(start) r = requests.get("https://cloud-neofussvr.sslcs.cdngc.net/NF_DownloadBinaryForMass.do", - params={"file": filename}, headers={"Authorization": authv}, stream=True) + params={"file": filename}, headers=headers, stream=True) r.raise_for_status() return r |