-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
40943f3
commit d4056fc
Showing
8 changed files
with
154 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# ---------------------------------------- | ||
# - mode: python - | ||
# - author: helloplhm-qwq - | ||
# - name: __init__.py - | ||
# - project: lx-music-api-server - | ||
# - license: MIT - | ||
# ---------------------------------------- | ||
# This file is part of the "lx-music-api-server" project. | ||
|
||
from . import qdes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# ---------------------------------------- | ||
# - mode: python - | ||
# - author: helloplhm-qwq - | ||
# - name: qdes.py - | ||
# - project: lx-music-api-server - | ||
# - license: MIT - | ||
# ---------------------------------------- | ||
# This file is part of the "lx-music-api-server" project. | ||
|
||
from .log import log | ||
from . import variable | ||
import binascii | ||
import zlib | ||
|
||
logger = log('qdes') | ||
|
||
try: | ||
from .natives import qdes | ||
variable.qdes_lib_loaded = True | ||
except: | ||
try: | ||
import qdes | ||
variable.qdes_lib_loaded = True | ||
except: | ||
logger.warning('QRC解密库qdes加载失败, 可能为不支持当前系统, QRC相关的逐字歌词获取将无法使用') | ||
|
||
def qdes_decrypt(qrc): | ||
if variable.qdes_lib_loaded: | ||
decoded = zlib.decompress(qdes.LyricDecode(binascii.unhexlify(qrc.encode('utf-8')))).decode('utf-8') | ||
return decoded | ||
else: | ||
raise ModuleNotFoundError('qdes解密库未被加载') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters