api_skin_info.py 372 B

123456789101112131415
  1. from .tool.func import *
  2. def api_skin_info_2(conn):
  3. curs = conn.cursor()
  4. json_address = re.sub("(((?!\.|\/).)+)\.html$", "info.json", skin_check())
  5. try:
  6. json_data = json.loads(open(json_address).read())
  7. except:
  8. json_data = None
  9. if json_data:
  10. return flask.jsonify(json_data)
  11. else:
  12. return flask.jsonify({}), 404