From d65e932928ad6ad94be2ff9c251b630e7d97eb5d Mon Sep 17 00:00:00 2001 From: raphael60650 Date: Thu, 17 Jun 2021 18:34:27 +0200 Subject: [PATCH] if content size changed, the file will be redownloaded --- source/get_github_file.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/get_github_file.py b/source/get_github_file.py index 0268474..86d221b 100644 --- a/source/get_github_file.py +++ b/source/get_github_file.py @@ -6,8 +6,10 @@ root = "https://raw.githubusercontent.com/Faraphel/MKWF-Install/master/" def get_github_file(self, file): try: - if os.path.exists(file): return 1 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 with open(file, "wb") as file: