diff --git a/Scripts/files.py b/Scripts/files.py index 36afc642..5afdc68c 100644 --- a/Scripts/files.py +++ b/Scripts/files.py @@ -403,15 +403,9 @@ def check_for_update(currentVersion, updateReleaseChannel, silentCheck=False): print(f"\n> Downloading version: {F.GREEN}{latestVersion}{S.R}") url = f'https://codeload.github.com/ThioJoe/YT-Spammer-Purge/tar.gz/refs/tags/v{latestVersion}' - r = requests.get(url, stream=True) - if(r.status_code == 200): - with open(tarFileName, 'wb') as file: - for chunk in r.iter_content(chunk_size=1048576): - if chunk: - file.write(chunk) - else: - print("Downloading of new version failed!") - print(f"\n> {F.RED}Error: {S.R}GitHub returned a non 200 status code while trying to download newer version.\nStatus returned: {r.status_code}") + + fileDownloadResult = getRemoteFile(url, tarFileName) + if fileDownloadResult == False: input("Press Enter to Exit...") sys.exit() @@ -477,7 +471,7 @@ def fetch_file(streamFileSwitch): response = requests.get(url, headers=headers, stream=True) if response.status_code != 200: if silent == False: - print("Error fetching remote file or resource: " + url) + print("Error fetching remote file or resource: " + url) print("Response Code: " + str(response.status_code)) else: return response diff --git a/YTSpammerPurge.py b/YTSpammerPurge.py index 49b2b5e5..2a7acf54 100644 --- a/YTSpammerPurge.py +++ b/YTSpammerPurge.py @@ -36,7 +36,7 @@ ### IMPORTANT: I OFFER NO WARRANTY OR GUARANTEE FOR THIS SCRIPT. USE AT YOUR OWN RISK. ### I tested it on my own and implemented some failsafes as best as I could, ### but there could always be some kind of bug. You should inspect the code yourself. -version = "2.17.0-Beta6" +version = "2.17.0-Beta7" configVersion = 32 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# print("Importing Script Modules...")