update netease_music_unlock.js

This commit is contained in:
lumither committed 2024-09-19 15:08:23 -07:00
1 parent 7bd7ac6214
commit 11ce53736d
1 file changed
+4 -15
+4 -15
View File
@@ -1,26 +1,15 @@
/**
* @fileoverview Example of HTTP rewrite.
* @fileoverview unlock netease regional restriction
*
* rewrite url: ^https?://(..)?music.163.com/
*
* @supported Quantumult X (v1.0.5-build173)
*/
// $request, $response, $notify(title, subtitle, message), console.log(message)
// $request.scheme, $request.method, $request.url, $request.path, $request.headers
// $response.statusCode, $response.headers, $response.body
//
// $prefs is for persistent store and the data of $prefs will be cleared when Quantumult X is deleted.
// $prefs.setValueForKey(value, key), $prefs.removeValueForKey(key), $prefs.removeAllValues(). Returns true or false, value and key should be string.
// $prefs.valueForKey(key) returns value.
//
// setTimeout(function() { console.log("abc"); }, 1000);
//
// You can optional change the response headers at the same time by using $done({body: modifiedBody, headers: modifiedHeaders}); only change the response headers is not allowed for script-response-body. The modifiedHeaders can be copied and modified from $response.headers, please do not change the content length, type and encoding field.
// Response status can also be optional changed by using $done({body: modifiedBody, headers: modifiedHeaders, status: modifiedStatus}), the modifiedStatus should be like "HTTP/1.1 200 OK"
var body = $request.headers;
var obj = JSON.parse(body);
obj['X-Real-IP'] = "219.133.168.5";
obj['X-Real-IP'] = "219.133.168.5"; // shenzhen futian
body = JSON.stringify(obj);
console.log(body);