Skip to content
This repository was archived by the owner on Jan 14, 2020. It is now read-only.

Commit ae76297

Browse files
committed
一些玄学参数修改
1 parent 37cdb52 commit ae76297

File tree

4 files changed

+30
-15
lines changed

4 files changed

+30
-15
lines changed

modules/modify/index.js

+19-11
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,22 @@ var modify = function*(next) {
3737
}
3838

3939
if (/^\/eapi\/v3\/song\/detail/.test(req.url) ||
40-
/^\/eapi\/v3\/playlist\/detail/.test(req.url) ||
41-
/^\/eapi\/v1\/album/.test(req.url) ||
42-
/^\/eapi\/batch/.test(req.url) ||
43-
/^\/eapi\/cloudsearch\/pc/.test(req.url) ||
44-
/^\/eapi\/v1\/artist/.test(req.url) ||
45-
/^\/eapi\/v1\/search\/get/.test(req.url) ||
46-
/^\/eapi\/song\/enhance\/privilege/.test(req.url) ||
47-
/^\/eapi\/v1\/discovery\/new\/songs/.test(req.url) ||
48-
/^\/eapi\/v1\/play\/record/.test(req.url)) {
40+
/^\/eapi\/v3\/playlist\/detail/.test(req.url) ||
41+
/^\/eapi\/v1\/album/.test(req.url) ||
42+
/^\/eapi\/batch/.test(req.url) ||
43+
/^\/eapi\/cloudsearch\/pc/.test(req.url) ||
44+
/^\/eapi\/v1\/artist/.test(req.url) ||
45+
/^\/eapi\/v1\/search\/get/.test(req.url) ||
46+
/^\/eapi\/song\/enhance\/privilege/.test(req.url) ||
47+
/^\/eapi\/v1\/discovery\/new\/songs/.test(req.url) ||
48+
/^\/eapi\/v1\/play\/record/.test(req.url)) {
4949

5050
_this.defaultBody = utils.netease.modifyDetailApi(this.defaultBody);
5151
yield next;
5252

53-
} else if (/^\/eapi\/song\/enhance\/player\/url/.test(req.url)) {
53+
}
54+
55+
else if (/^\/eapi\/song\/enhance\/player\/url/.test(req.url)) {
5456

5557
try {
5658
var data = JSON.parse(_this.defaultBody);
@@ -80,7 +82,9 @@ var modify = function*(next) {
8082
_this.defaultBody = JSON.stringify(data);
8183
yield next;
8284

83-
} else if (/^\/eapi\/song\/enhance\/download\/url/.test(req.url)) {
85+
}
86+
87+
else if (/^\/eapi\/song\/enhance\/download\/url/.test(req.url)) {
8488

8589
if (utils.netease.getDownloadReturnCode(_this.defaultBody) != 200) {
8690
var songId = utils.netease.getDownloadSongId(_this.defaultBody);
@@ -96,6 +100,10 @@ var modify = function*(next) {
96100
yield next;
97101
}
98102
}
103+
104+
// else if (/^\/eapi\/v1\/playlist\/manipulate\/tracks/.test(req.url)) {
105+
// console.log(_this.defaultBody);
106+
// }
99107
}
100108

101109
module.exports = modify;

modules/proxy/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ var middleware = function*(next) {
112112
length: _this.length,
113113
encoding: _this.charset
114114
});
115+
// console.log(rawBody.toString());
115116
var result = yield post(url, req.headers, rawBody);
116117
var headers = result[0].headers;
117118
var body = result[1];

modules/utils/netease/index.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,16 @@ netease.prototype.modifyDetailApi = function(body) {
112112
console.log("Song Detail API Injected".green);
113113

114114
return body
115-
.replace(/\"pl\":\d+/g, '"pl":320000')
116-
.replace(/\"dl\":\d+/g, '"dl":320000')
115+
.replace(/\"pl\":0/g, '"pl":320000')
116+
.replace(/\"dl\":0/g, '"dl":320000')
117+
.replace(/\"fl\":0/g, '"fl":320000')
117118
.replace(/\"st\":-?\d+/g, '"st":0')
118-
.replace(/\"subp\":\d+/g, '"subp":1');
119+
.replace(/\"subp\":\d+/g, '"subp":1')
120+
.replace(/\"sp\":0/g, '"sp":7')
121+
.replace(/\"cp\":0/g, '"cp":1')
122+
.replace(/\"fee\":\d+/g, '"fee":0')
123+
.replace(/\"abroad\":1,/g, '')
124+
.replace(/\"paid\":false/g, '"paid":true');
119125
};
120126

121127
netease.prototype.modifyPlayerApiCustom = function(urlInfo, body) {

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "unblock-netease-music",
3-
"version": "1.2.8",
3+
"version": "1.2.9",
44
"scripts": {
55
"start": "node ./bin/www"
66
},

0 commit comments

Comments
 (0)