Skip to content

Commit

Permalink
暂时解决Cover接口报错问题
Browse files Browse the repository at this point in the history
  • Loading branch information
HisAtri committed Jul 16, 2024
1 parent 9be88d4 commit 87e7205
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions api/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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', ''))
Expand All @@ -53,6 +55,7 @@ def cover_api():

@v1_bp.route('/cover/<path:s_type>', 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__:
Expand Down
2 changes: 1 addition & 1 deletion mod/searchx/kugou.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 '
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ aiohttp~=3.9.1
Pillow~=10.1.0
pyaes~=1.6.1
Werkzeug~=3.0.1
wowotou~=1.0.1
mygo~=1.0.0

0 comments on commit 87e7205

Please sign in to comment.