Skip to content

Commit 074d2f1

Browse files
Test the status code of the request.
1 parent a77fe28 commit 074d2f1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pyandrozoo/api.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@ def get(self, sha256):
1818
payload.update(self.payload)
1919
with open(sha256+'.apk', "wb") as apk_file:
2020
r = requests.get(self.root_url, payload)
21-
apk_file.write(r.content)
22-
return r, apk_file.name
21+
if r.status_code == 200:
22+
apk_file.write(r.content)
23+
return r, apk_file.name
24+
else:
25+
return r, None

0 commit comments

Comments
 (0)