From 6a28e38c29ece1c3c92cd04bc6fdf52c48af0a40 Mon Sep 17 00:00:00 2001 From: Manuel Kamper Date: Fri, 12 Jan 2024 17:25:46 +0000 Subject: [PATCH] fixes #1 check if file extension is .apk (to prevent that .part) files are moved into repo folder. If not, wait for 30 seconds to finish the download and try again. --- updater.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/updater.py b/updater.py index 24e13cc..e70bfed 100644 --- a/updater.py +++ b/updater.py @@ -1,4 +1,4 @@ -#APK Updater v1.2 +#APK Updater v1.3 #(C) 2024 by Manuel Kamper (kmpr.at) #Do not remove copyright when distributing! import feedparser, mysql.connector, os, glob, time, shutil @@ -19,7 +19,7 @@ mydb = mysql.connector.connect( database="appstore" ) -### NO EDITS BELOW NECESSARY ### +### NO EDITS BELOW HERE NECESSARY ### url = "https://apkcombo.com/latest-updates/feed" @@ -27,6 +27,8 @@ def get_last_filename_and_rename(new_filename): global temp_path, repo_path files = glob.glob(temp_path + '/*') max_file = max(files, key=os.path.getctime) + while not max_file.endswith(".apk"): + time.sleep(30) filename_stripped = max_file.replace("_apkcombo.com","") filename = filename_stripped.split("/")[-1].split("_")[-2] new_filename2 = max_file.replace(filename, new_filename)