51545b3b |
#!/usr/bin/python3
import os
import pathlib
import sys
import urllib.request
import io
import tarfile
DBURL = "https://freewvsdb.schokokeks.org/"
dbpaths = ['/var/lib/freewvs/', str(pathlib.Path.home()) + "/.cache/freewvs/"]
target = False
for dbpath in dbpaths:
if not os.path.isdir(dbpath):
try:
os.makedirs(dbpath)
except PermissionError:
continue
if os.access(dbpath, os.W_OK):
target = dbpath
break
if not target:
sys.exit("Can't write to " + " or ".join(dbpaths))
old = 0
if os.path.isfile(target + "timestamp"):
|