fix
This commit is contained in:
parent
41045fdf3a
commit
cc56dec270
3 changed files with 5 additions and 10 deletions
|
|
@ -24,8 +24,8 @@ def track():
|
|||
ua = str(request.args.get('ua'))
|
||||
url = str(request.values.get("url") or request.headers.get("Referer"))
|
||||
|
||||
if os.path.exists('db/db.json'):
|
||||
with open('db/db.json', 'r') as db:
|
||||
if os.path.exists('db.json'):
|
||||
with open('db.json', 'r') as db:
|
||||
db = json.loads(db.read())
|
||||
else:
|
||||
db = {}
|
||||
|
|
@ -45,7 +45,7 @@ def track():
|
|||
|
||||
send_msg(f'User <{hash}> visited { url } on { ua } ({ str(len(db[hash][cat])) })')
|
||||
|
||||
with open('db/db.json', 'w+') as dbw:
|
||||
with open('db.json', 'w+') as dbw:
|
||||
dbw.write(json.dumps(db, indent=4))
|
||||
|
||||
return str(len(db[hash][cat]))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue