From 91e50248a58795e1c367f734a504d92349173c5f Mon Sep 17 00:00:00 2001 From: Huibeiq <106383213+Huibq@users.noreply.github.com> Date: Sun, 1 Oct 2023 13:11:03 +0800 Subject: [PATCH 1/6] Update Netease.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复网易云接口 --- flaskSystem/src/Api/Netease.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flaskSystem/src/Api/Netease.py b/flaskSystem/src/Api/Netease.py index 6ad3b08..13df020 100644 --- a/flaskSystem/src/Api/Netease.py +++ b/flaskSystem/src/Api/Netease.py @@ -272,18 +272,18 @@ 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=lossless&id={id}&' # { # "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): From 1302e660d92161df089615430b6edaa8e653ead1 Mon Sep 17 00:00:00 2001 From: Huibeiq <106383213+Huibq@users.noreply.github.com> Date: Sun, 1 Oct 2023 13:12:07 +0800 Subject: [PATCH 2/6] Update Http.py --- flaskSystem/src/Common/Http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flaskSystem/src/Common/Http.py b/flaskSystem/src/Common/Http.py index 947b020..485d3f7 100644 --- a/flaskSystem/src/Common/Http.py +++ b/flaskSystem/src/Common/Http.py @@ -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: """ From da895da35583f53030c848185e8ae2a1af673ffb Mon Sep 17 00:00:00 2001 From: Huibeiq <106383213+Huibq@users.noreply.github.com> Date: Sun, 1 Oct 2023 13:15:23 +0800 Subject: [PATCH 3/6] Update Tools.py --- flaskSystem/src/Common/Tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flaskSystem/src/Common/Tools.py b/flaskSystem/src/Common/Tools.py index 590b314..b44078e 100644 --- a/flaskSystem/src/Common/Tools.py +++ b/flaskSystem/src/Common/Tools.py @@ -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']}" From 0640969282a1d413bc02f6d2441970ff153acc2f Mon Sep 17 00:00:00 2001 From: Huibeiq <106383213+Huibq@users.noreply.github.com> Date: Sun, 1 Oct 2023 13:46:45 +0800 Subject: [PATCH 4/6] Update Netease.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加注释,接口来自简繁音乐公共Api --- flaskSystem/src/Api/Netease.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flaskSystem/src/Api/Netease.py b/flaskSystem/src/Api/Netease.py index 13df020..f908617 100644 --- a/flaskSystem/src/Api/Netease.py +++ b/flaskSystem/src/Api/Netease.py @@ -272,7 +272,8 @@ def read_local(self): return False def getMusicUrl(self, id=''): - u = f'https://csm.sayqz.com/api/?type=apiSongUrlV1&level=lossless&id={id}&' + 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, From aa28ab733a7bba25fd0ea6ac6fad0ff7e84d5ad0 Mon Sep 17 00:00:00 2001 From: Huibeiq <106383213+Huibq@users.noreply.github.com> Date: Sun, 1 Oct 2023 14:13:10 +0800 Subject: [PATCH 5/6] Update kw.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 替换回原来的酷我搜索接口 --- flaskSystem/API/kw.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flaskSystem/API/kw.py b/flaskSystem/API/kw.py index 44e02a3..81eedb3 100644 --- a/flaskSystem/API/kw.py +++ b/flaskSystem/API/kw.py @@ -18,7 +18,7 @@ @app.get("/kw/search/////") 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, From 3437e1d87c5d58518bcbefb7afd99886372836dd Mon Sep 17 00:00:00 2001 From: Huibeiq <106383213+Huibq@users.noreply.github.com> Date: Sun, 1 Oct 2023 14:39:19 +0800 Subject: [PATCH 6/6] Update Http.py --- flaskSystem/src/Common/Http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flaskSystem/src/Common/Http.py b/flaskSystem/src/Common/Http.py index 485d3f7..6fc39d4 100644 --- a/flaskSystem/src/Common/Http.py +++ b/flaskSystem/src/Common/Http.py @@ -23,7 +23,7 @@ def getHttp(self, url: str, method: int = 0, data: bytes = r'', - header: dict[str, str, str] = {}, + header: dict[str, str, str] = {}, params: dict[str, str] = {} ) -> requests.Response: """