Skip to content

Commit

Permalink
fix(External.Lyrics.response): keywords
Browse files Browse the repository at this point in the history
Update External.Lyrics.response.dev.js
  • Loading branch information
VirgilClyne committed Nov 10, 2024
1 parent 9e1bb5b commit 217d16b
Showing 1 changed file with 3 additions and 43 deletions.
46 changes: 3 additions & 43 deletions src/External.Lyrics.response.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,24 +318,9 @@ async function searchTrack(vendor = "NeteaseMusic", keyword = "", UAPool = []) {
searchUrl.searchParams.set("type", "1");
searchUrl.searchParams.set("limit", "1");
searchUrl.searchParams.set("offset", "0");
searchUrl.searchParams.set("s", encodeURIComponent(keyword));
searchUrl.searchParams.set("s", keyword);
log(`🚧 searchUrl: ${searchUrl.toJSON()}`, "");
Request.url = searchUrl.toString();
/*
const searchUrl = {
"scheme": "https",
"host": "music.163.com",
"path": "api/cloudsearch/pc",
"query": {
"type": 1,
"limit": 1,
"offset": 0,
"s": encodeURIComponent(keyword),
}
};
log(`🚧 searchUrl: ${JSON.stringify(searchUrl)}`, "");
Request.url = URI.stringify(searchUrl);
*/
Request.headers.Referer = "https://music.163.com";
Request.headers.Cookie = "os=ios; __remember_me=true; NMTID=xxx";
const Result = await fetch(Request).then(response => JSON.parse(response.body));
Expand All @@ -358,25 +343,9 @@ async function searchTrack(vendor = "NeteaseMusic", keyword = "", UAPool = []) {
searchUrl.searchParams.set("type", "1");
searchUrl.searchParams.set("limit", "1");
searchUrl.searchParams.set("offset", "0");
searchUrl.searchParams.set("keywords", encodeURIComponent(keyword));
searchUrl.searchParams.set("keywords", keyword);
log(`🚧 searchUrl: ${searchUrl.toJSON()}`, "");
Request.url = searchUrl.toString();
/*
const searchUrl = {
"scheme": "https",
"host": HostPool[Math.floor(Math.random() * HostPool.length)],
//"path": "search",
"path": "cloudsearch",
"query": {
"type": 1,
"limit": 1,
"offset": 0,
"keywords": encodeURIComponent(keyword),
}
};
log(`🚧 searchUrl: ${JSON.stringify(searchUrl)}`, "");
Request.url = URI.stringify(searchUrl);
*/
Request.headers.Referer = "https://music.163.com";
const Result = await fetch(Request).then(response => JSON.parse(response.body));
trackInfo.id = Result?.result?.songs?.[0]?.id;
Expand All @@ -390,15 +359,6 @@ async function searchTrack(vendor = "NeteaseMusic", keyword = "", UAPool = []) {
const searchUrl = new URL("https://c.y.qq.com/cgi-bin/musicu.fcg");
log(`🚧 searchUrl: ${searchUrl.toJSON()}`, "");
Request.url = searchUrl.toString();
/*
const searchUrl = {
"scheme": "https",
"host": "u.y.qq.com",
"path": "cgi-bin/musicu.fcg"
};
log(`🚧 searchUrl: ${JSON.stringify(searchUrl)}`, "");
Request.url = URI.stringify(searchUrl);
*/
Request.headers.Referer = "https://c.y.qq.com";
Request.body = JSON.stringify({
"music.search.SearchCgiService": {
Expand All @@ -424,7 +384,7 @@ async function searchTrack(vendor = "NeteaseMusic", keyword = "", UAPool = []) {
searchUrl.searchParams.set("format", "json");
searchUrl.searchParams.set("p", "1");
searchUrl.searchParams.set("n", "1");
searchUrl.searchParams.set("w", encodeURIComponent(keyword));
searchUrl.searchParams.set("w", keyword);
searchUrl.searchParams.set("remoteplace", "txt.yqq.song");
log(`🚧 searchUrl: ${searchUrl.toJSON()}`, "");
Request.url = searchUrl.toString();
Expand Down

0 comments on commit 217d16b

Please sign in to comment.