mirror of
https://github.com/Faraphel/Atlas-Install.git
synced 2025-07-03 11:18:26 +02:00
if content size changed, the file will be redownloaded
This commit is contained in:
parent
524104b400
commit
d65e932928
1 changed files with 3 additions and 1 deletions
|
@ -6,8 +6,10 @@ root = "https://raw.githubusercontent.com/Faraphel/MKWF-Install/master/"
|
||||||
|
|
||||||
def get_github_file(self, file):
|
def get_github_file(self, file):
|
||||||
try:
|
try:
|
||||||
if os.path.exists(file): return 1
|
|
||||||
dl = requests.get(root+file, allow_redirects=True, stream=True)
|
dl = requests.get(root+file, allow_redirects=True, stream=True)
|
||||||
|
if os.path.exists(file):
|
||||||
|
if int(dl.headers['Content-Length']) == os.path.getsize(file):
|
||||||
|
return 1
|
||||||
|
|
||||||
if dl.status_code == 200: # if page is found
|
if dl.status_code == 200: # if page is found
|
||||||
with open(file, "wb") as file:
|
with open(file, "wb") as file:
|
||||||
|
|
Loading…
Reference in a new issue