From 87e72059b1fd57527bfbe2fd67983eaa02e36adc Mon Sep 17 00:00:00 2001 From: HisAtri Date: Tue, 16 Jul 2024 20:49:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=82=E6=97=B6=E8=A7=A3=E5=86=B3Cover?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/cover.py | 3 +++ mod/searchx/kugou.py | 2 +- requirements.txt | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/api/cover.py b/api/cover.py index 4b82138..ea6fc15 100644 --- a/api/cover.py +++ b/api/cover.py @@ -4,6 +4,7 @@ from flask import request, abort, redirect from urllib.parse import unquote_plus +from mygo.devtools import no_error from mod import searchx @@ -33,6 +34,7 @@ def local_cover_search(title: str, artist: str, album: str): @app.route('/cover', methods=['GET']) @cache.cached(timeout=86400, key_prefix=make_cache_key) +@no_error(exceptions=AttributeError) def cover_api(): title = unquote_plus(request.args.get('title')) artist = unquote_plus(request.args.get('artist', '')) @@ -53,6 +55,7 @@ def cover_api(): @v1_bp.route('/cover/', methods=['GET']) @cache.cached(timeout=86400, key_prefix=make_cache_key) +@no_error(exceptions=AttributeError) def cover_new(s_type): __endpoints__ = ["music", "album", "artist"] if s_type not in __endpoints__: diff --git a/mod/searchx/kugou.py b/mod/searchx/kugou.py index b91728c..5d603dc 100644 --- a/mod/searchx/kugou.py +++ b/mod/searchx/kugou.py @@ -12,7 +12,7 @@ from mod import textcompare from mod import tools -from wowotou.devtools import no_error +from mygo.devtools import no_error headers = {'User-Agent': '{"percent": 21.4, "useragent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) ' 'AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36", "system": "Chrome ' diff --git a/requirements.txt b/requirements.txt index 0657fba..426c105 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,4 +8,4 @@ aiohttp~=3.9.1 Pillow~=10.1.0 pyaes~=1.6.1 Werkzeug~=3.0.1 -wowotou~=1.0.1 \ No newline at end of file +mygo~=1.0.0 \ No newline at end of file