mirror of
https://github.com/MeoProject/lx-music-api-server.git
synced 2025-05-23 19:17:41 +08:00
chore: 优秀代码
This commit is contained in:
parent
49c6780c5b
commit
da3384b6d4
@ -210,4 +210,7 @@ async def other_with_query(method, source, t, _, query):
|
|||||||
'code': 2,
|
'code': 2,
|
||||||
'msg': e.args[0],
|
'msg': e.args[0],
|
||||||
'data': None,
|
'data': None,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async def info_with_query(source, songid, _, query):
|
||||||
|
return await other('info', source, songid, None)
|
@ -11,6 +11,7 @@ from .player import url
|
|||||||
from .musicInfo import getMusicInfo as _getInfo
|
from .musicInfo import getMusicInfo as _getInfo
|
||||||
from .utils import formatSinger
|
from .utils import formatSinger
|
||||||
from .lyric import getLyric as _getLyric
|
from .lyric import getLyric as _getLyric
|
||||||
|
from .mv import getMvPlayURLandInfo as _getMvInfo
|
||||||
from common import utils
|
from common import utils
|
||||||
from . import refresh_login
|
from . import refresh_login
|
||||||
|
|
||||||
@ -79,3 +80,5 @@ async def info(songid):
|
|||||||
async def lyric(songId):
|
async def lyric(songId):
|
||||||
return await _getLyric(songId)
|
return await _getLyric(songId)
|
||||||
|
|
||||||
|
async def mv(vid):
|
||||||
|
return await _getMvInfo(vid)
|
@ -1,10 +1,80 @@
|
|||||||
# ----------------------------------------
|
# ----------------------------------------
|
||||||
# - mode: python -
|
# - mode: python -
|
||||||
# - author: helloplhm-qwq -
|
# - author: helloplhm-qwq -
|
||||||
# - name: mv.py -
|
# - name: mv.py -
|
||||||
# - project: lx-music-api-server -
|
# - project: lx-music-api-server -
|
||||||
# - license: MIT -
|
# - license: MIT -
|
||||||
# ----------------------------------------
|
# ----------------------------------------
|
||||||
# This file is part of the "lx-music-api-server" project.
|
# This file is part of the "lx-music-api-server" project.
|
||||||
|
|
||||||
# 没做
|
import asyncio
|
||||||
|
import json
|
||||||
|
from .utils import signRequest
|
||||||
|
|
||||||
|
|
||||||
|
async def getMvPlayURLandInfo(vid):
|
||||||
|
info = signRequest({
|
||||||
|
"comm": {"ct": 24, "cv": 4747474},
|
||||||
|
"mvinfo": {
|
||||||
|
"module": "video.VideoDataServer",
|
||||||
|
"method": "get_video_info_batch",
|
||||||
|
"param": {
|
||||||
|
"vidlist": [vid],
|
||||||
|
"required": [
|
||||||
|
"vid",
|
||||||
|
"type",
|
||||||
|
"sid",
|
||||||
|
"cover_pic",
|
||||||
|
"duration",
|
||||||
|
"singers",
|
||||||
|
"video_switch",
|
||||||
|
"msg",
|
||||||
|
"name",
|
||||||
|
"desc",
|
||||||
|
"playcnt",
|
||||||
|
"pubdate",
|
||||||
|
"isfav",
|
||||||
|
"gmid",
|
||||||
|
"songmid"
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}, True)
|
||||||
|
urlreq = signRequest({
|
||||||
|
"comm": {
|
||||||
|
"ct": 24,
|
||||||
|
"cv": 4747474,
|
||||||
|
"g_tk": 812935580,
|
||||||
|
"uin": 0,
|
||||||
|
"format": "json",
|
||||||
|
"platform": "yqq"
|
||||||
|
},
|
||||||
|
"mvUrl": {
|
||||||
|
"module": "gosrf.Stream.MvUrlProxy",
|
||||||
|
"method": "GetMvUrls",
|
||||||
|
"param": {
|
||||||
|
"vids": [vid],
|
||||||
|
"request_typet": 10001,
|
||||||
|
"addrtype": 3,
|
||||||
|
"format": 264
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
res = await asyncio.gather(info, urlreq)
|
||||||
|
i = res[0]
|
||||||
|
# output i with formatted json
|
||||||
|
print(json.dumps(i.json(), indent=2, ensure_ascii = False))
|
||||||
|
url = res[1]
|
||||||
|
file_info = {}
|
||||||
|
urlbody = url.json()
|
||||||
|
if (urlbody['code'] == 0 and urlbody['mvUrl']['code'] == 0):
|
||||||
|
for u in url['mvUrl']['data'][vid]['mp4']:
|
||||||
|
if (u['filetype'] == 0):
|
||||||
|
if (u['fileSize']):
|
||||||
|
pass
|
||||||
|
pass
|
||||||
|
pass
|
||||||
|
pass
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user