I messed up - Updater fix

* Not using external lib to get the version anymore
* Remove `atoma` from requirements.txt, it's not used since the scraping update

Signed-off-by: nanometer5088 <code.deleo@simplelogin.com>
This commit is contained in:
nanometer5088
2023-06-20 19:13:58 -03:00
parent 1754e1f377
commit 5940540a63
2 changed files with 7 additions and 4 deletions

View File

@@ -1,5 +1,4 @@
yt_dlp
requests
atoma
distro
bs4

View File

@@ -50,10 +50,14 @@ def init(silent):
log("Started update / networking test")
try:
import ast
link = requests.get("https://raw.githubusercontent.com/nanometer5088/CLI-TikTok/main/src/constants.py")
link = requests.get("https://raw.githubusercontent.com/nanometer5088/CLI-TikTok/main/src/constants.py").text.strip()
userversion = _read_user_version()
data = str(ast.literal_eval(link.text.split("APP = ")[1])["version"])
version_line = next(line for line in link.split('\n')
if line.startswith(' "version": '))
data = version_line.split(': ')[1]
if userversion < data:
log(f"New version detected! User version is {userversion}, but {data} was found on Github.")
clear_screen()