Skip to content

Commit

Permalink
Merge pull request QiuChenlyOpenSource#165 from Huibq/main
Browse files Browse the repository at this point in the history
一个网易云接口
  • Loading branch information
QiuChenly authored Oct 23, 2023
2 parents 3153785 + 3437e1d commit 0a7ed56
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion flaskSystem/API/kw.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

@app.get("/kw/search/<searchKey>/<page>/<size>/<rid>/<encId>")
def kwsearch(searchKey: str, page=1, size=100,rid='', encId=''):
lst = kw.search_kw_h5(searchKey, int(page), int(size),rid,encId) # Mac端搜索接口
lst = kw.search_kw_mac(searchKey, int(page), int(size)) # Mac端搜索接口
page = lst['page']
return {
'code': 200,
Expand Down
13 changes: 7 additions & 6 deletions flaskSystem/src/Api/Netease.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,18 +272,19 @@ def read_local(self):
return False

def getMusicUrl(self, id=''):
u = 'http://music.fy6b.com/index/mp3orflac'
d = f'type=netease&id={id}&option=flac'
u = f'https://csm.sayqz.com/api/?type=apiSongUrlV1&level=hires&id={id}'
#音质 standard => 标准,higher => 较高, exhigh=>极高, lossless=>无损, hires=>Hi-Res
# {
# "url": "http:\/\/m704.music.126.net\/20230305234939\/ccfe8832df4e3431dbe25dfea1118f1e\/jdymusic\/obj\/wo3DlMOGwrbDjj7DisKw\/22975550396\/2dbf\/d87f\/e6f2\/11dac549d861ba74f1d599d2f4f45cea.flac?authSecret=00000186b25ff97815c80aaba23719fb",
# "size": 3278433,
# "br": 512.575
# }
r = self.httpw(u, 1, d.encode('utf-8'), {
"Content-Type": "application/x-www-form-urlencoded",
"User-Agent": "Dalvik/2.1.0 (Linux; U; Android 8.1.0; MI 5s Build/OPM1.171019.018)"
r = self.httpw(u, 0, head={
"Host": "csm.sayqz.com",
"accept-encoding": "gaip",
"user-Agent": "okhttp/${project.version}"
})
r = r.json()
r = r.json()['data'][0]
return r

def searchMusicByTrd(self, searchKey="周杰伦", pageNum=1, pageSize=100):
Expand Down
2 changes: 1 addition & 1 deletion flaskSystem/src/Common/Http.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def getHttp(self,
url: str,
method: int = 0,
data: bytes = r'',
header: dict[str, str] = {},
header: dict[str, str, str] = {},
params: dict[str, str] = {}
) -> requests.Response:
"""
Expand Down
2 changes: 1 addition & 1 deletion flaskSystem/src/Common/Tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def downSingle(music, download_home, config):
elif platform == 'wyy':
link: str = handleWyy(music['mid'])
if link is not None:
music['extra'] = 'flac' if link.find(".flac?") != -1 else 'mp3'
music['type'] = 'flac' if link.find(".flac") != -1 else 'mp3'
music['singer'] = music['author_simple']
music["album"] = music['album']
musicFileInfo = f"{music['author_simple']} - {music['title']}"
Expand Down

0 comments on commit 0a7ed56

Please sign in to comment.