ohli24 api update 2022.11.25(01.)
This commit is contained in:
@@ -247,6 +247,45 @@ class LogicOhli24(LogicModuleBase):
|
||||
P.logger.error("Exception:%s", e)
|
||||
P.logger.error(traceback.format_exc())
|
||||
|
||||
def process_api(self, sub, req):
|
||||
logger.debug("here!")
|
||||
ret = {}
|
||||
try:
|
||||
if sub == "anime_list":
|
||||
logger.debug(f"anime_list =*==")
|
||||
logger.debug(req)
|
||||
data = []
|
||||
cate = req.form["type"]
|
||||
page = req.form["page"]
|
||||
|
||||
data = self.get_anime_info(cate, page)
|
||||
# self.current_data = data
|
||||
return jsonify(
|
||||
{"ret": "success", "cate": cate, "page": page, "data": data}
|
||||
)
|
||||
|
||||
except Exception as exception:
|
||||
logger.error("Exception:%s", exception)
|
||||
logger.error(traceback.format_exc())
|
||||
ret["ret"] = "exception"
|
||||
ret["data"] = str(exception)
|
||||
return jsonify(ret)
|
||||
|
||||
#########################################################
|
||||
# API
|
||||
#########################################################
|
||||
# @blueprint.route("/api/<sub>", methods=["GET", "POST"])
|
||||
# @check_api
|
||||
# def api(self, sub):
|
||||
# if sub == "ohli24":
|
||||
# try:
|
||||
# logger.debug("api ohli24")
|
||||
# data = {"aaaa"}
|
||||
# except Exception as e:
|
||||
# logger.error("Exception:%s", e)
|
||||
# logger.error(traceback.format_exc())
|
||||
# return data
|
||||
|
||||
@staticmethod
|
||||
def add_whitelist(*args):
|
||||
ret = {}
|
||||
|
||||
Reference in New Issue
Block a user