woolbot commited on
Commit
0d77910
1 Parent(s): 1bd35b2
Files changed (4) hide show
  1. app.py +1 -1
  2. routes/helpers.py +2 -2
  3. routes/ytApi/search.py +1 -1
  4. signatures.db +0 -0
app.py CHANGED
@@ -84,7 +84,7 @@ def getBMPreview(): return osuApi.getPreview(request)
84
  def getBMFull(): return osuApi.getFull(request)
85
 
86
  if __name__ == "__main__":
87
- VERSION = '1.0 build72'
88
 
89
  config = configFile()
90
  with open(config['config-path'], "w") as outfile:
 
84
  def getBMFull(): return osuApi.getFull(request)
85
 
86
  if __name__ == "__main__":
87
+ VERSION = '1.0 build74'
88
 
89
  config = configFile()
90
  with open(config['config-path'], "w") as outfile:
routes/helpers.py CHANGED
@@ -44,8 +44,8 @@ def configFile():
44
  def checkSignature(signature: str):
45
  config = configFile()
46
  db = EazySQLite3(config['signatures-db'])
47
- query = db.query(f"SELECT * FROM `table` WHERE `key` LIKE \"{signature}\" AND `endtime`>{time.time()}")
48
- if len(query['details']) == 0: return False
49
  for row in query['details']:
50
  if signature == row[0]:
51
  db.query(f"UPDATE `table` SET `endtime`={round(time.time())+3600} WHERE `key`=\"{signature}\"")
 
44
  def checkSignature(signature: str):
45
  config = configFile()
46
  db = EazySQLite3(config['signatures-db'])
47
+ query = db.query(f"SELECT * FROM `table` WHERE (`key` LIKE \"{signature}\" OR `key`=\"{signature}\") AND `endtime`>{time.time()}")
48
+ #if len(query['details']) == 0: return False
49
  for row in query['details']:
50
  if signature == row[0]:
51
  db.query(f"UPDATE `table` SET `endtime`={round(time.time())+3600} WHERE `key`=\"{signature}\"")
routes/ytApi/search.py CHANGED
@@ -13,7 +13,7 @@ def search(request):
13
  if request.method == 'POST': signature = request.form['signature']
14
  else: signature = request.args['signature']
15
  except: return {"status": "error", "details": { "error_code": 103, "error_details": "No signature" }}
16
- if not helpers.checkSignature(signature): return {"status": "error", "details": { "error_code": 105, "error_details": " signature" }}
17
  html = urllib.request.urlopen("https://www.youtube.com/results?search_query={}".format(urllib.parse.quote_plus(searchQuery)))
18
  videoList = re.findall(r"watch\?v=(\S{11})", html.read().decode())
19
  videoIds = dict()
 
13
  if request.method == 'POST': signature = request.form['signature']
14
  else: signature = request.args['signature']
15
  except: return {"status": "error", "details": { "error_code": 103, "error_details": "No signature" }}
16
+ if not helpers.checkSignature(signature): return {"status": "error", "details": { "error_code": 105, "error_details": "Invalid signature" }}
17
  html = urllib.request.urlopen("https://www.youtube.com/results?search_query={}".format(urllib.parse.quote_plus(searchQuery)))
18
  videoList = re.findall(r"watch\?v=(\S{11})", html.read().decode())
19
  videoIds = dict()
signatures.db CHANGED
Binary files a/signatures.db and b/signatures.db differ