2 lines
48 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! For license information please see bundle.js.LICENSE.txt */
(()=>{var e={16(e){"use strict";e.exports=require("url")},21(e){"use strict";e.exports=require("fs")},148(e){"use strict";e.exports=require("axios")},153(e){"use strict";e.exports=JSON.parse('{"resourceTypeMap":{"0":"R_SO_4_","1":"R_MV_5_","2":"A_PL_0_","3":"R_AL_3_","4":"A_DJ_1_","5":"R_VI_62_","6":"A_EV_2_","7":"A_DR_14_"},"APP_CONF":{"apiDomain":"https://interface.music.163.com","domain":"https://music.163.com","encrypt":true,"encryptResponse":false,"clientSign":"18:C0:4D:B9:8F:FE@@@453832335F384641365F424635335F303030315F303031425F343434415F343643365F333638332@@@@@@6ff673ef74955b38bce2fa8562d95c976ed4758b1227c4e9ee345987cee17bc9","checkToken":"9ca17ae2e6ffcda170e2e6ee8af14fbabdb988f225b3868eb2c15a879b9a83d274a790ac8ff54a97b889d5d42af0feaec3b92af58cff99c470a7eafd88f75e839a9ea7c14e909da883e83fb692a3abdb6b92adee9e"}}')},157(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function a(e,t,r){return(t=function(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var c=r(599),s=r(213),u=r(148).default,l=r(899).PacProxyAgent,f=r(206),p=r(611),d=r(692),h=r(460),y=r(21),v=r(873),m=r(820).tmpdir(),b=r(800),g=b.cookieToJson,w=b.cookieObjToString,_=b.toBoolean,O=b.generateRandomChineseIP,S=r(16),j=S.URLSearchParams,x=S.URL,k=r(153).APP_CONF,C=y.readFileSync(v.resolve(m,"./anonymous_token"),"utf-8"),P=Math.floor,A=Math.random,T=Date.now,E=Object.keys,I=(JSON.stringify,JSON.parse),D=function(){for(var e="",t=0;t<6;t++)e+="abcdefghijklmnopqrstuvwxyz".charAt(P(26*A()));return"".concat(e,".").concat(T().toString(),".01.0")}(),U={pc:{os:"pc",appver:"3.1.17.204416",osver:"Microsoft-Windows-10-Professional-build-19045-64bit",channel:"netease"},linux:{os:"linux",appver:"1.2.1.0428",osver:"Deepin 20.9",channel:"netease"},android:{os:"android",appver:"8.20.20.231215173437",osver:"14",channel:"xiaomi"},iphone:{os:"iPhone OS",appver:"9.0.90",osver:"16.2",channel:"distribution"}},N={weapi:{pc:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0"},linuxapi:{linux:"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36"},api:{pc:"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Safari/537.36 Chrome/91.0.4472.164 NeteaseMusicDesktop/3.0.18.203152",android:"NeteaseMusic/9.1.65.240927161425(9001065);Dalvik/2.1.0 (Linux; U; Android 14; 23013RK75C Build/UKQ1.230804.001)",iphone:"NeteaseMusic 9.0.90/5038 (iPhone; iOS 16.2; zh_CN)"}},M=k.domain,R=k.apiDomain,G=k.encryptResponse,F=new Set([201,302,400,502,800,801,802,803]),B=function(e){return N[e]&&N[e][arguments.length>1&&void 0!==arguments[1]?arguments[1]:"pc"]||""};e.exports=function(e,t,r){return new Promise(function(o,a){var y=r.headers?i({},r.headers):{},v=r.realIP||r.ip||(r.randomCNIP?O():"");v&&(y["X-Real-IP"]=v,y["X-Forwarded-For"]=v);var m=r.cookie||{};"string"==typeof m&&(m=g(m)),"object"===n(m)&&(m=function(e,t){var r=s.lib.WordArray.random(32).toString(),n=U[e.os]||U.pc,o=i(i({},e),{},{__remember_me:"true",ntes_kaola_ad:"1",_ntes_nuid:e._ntes_nuid||r,_ntes_nnid:e._ntes_nnid||"".concat(r,",").concat(T().toString()),WNMCID:e.WNMCID||D,WEVNSM:e.WEVNSM||"1.0.0",osver:e.osver||n.osver,deviceId:e.deviceId||global.deviceId,os:e.os||n.os,channel:e.channel||n.channel,appver:e.appver||n.appver});return-1===t.indexOf("login")&&(o.NMTID=s.lib.WordArray.random(16).toString()),o.MUSIC_U||(o.MUSIC_A=o.MUSIC_A||C),o}(m,e),y.Cookie=w(m));var b="",S="",N=r.crypto,L=m.__csrf||"";""===N&&(N=k.encrypt?"eapi":"api");var H={status:500,body:{},cookie:[]};switch(N){case"weapi":y.Referer=M,y["User-Agent"]=r.ua||B("weapi"),t.csrf_token=L,S=c.weapi(t),b=M+"/weapi/"+e.substr(5);break;case"linuxapi":y["User-Agent"]=r.ua||B("linuxapi","linux"),S=c.linuxapi({method:"POST",url:M+e,params:t}),b=M+"/api/linux/forward";break;case"eapi":case"api":var q=i({osver:m.osver,deviceId:m.deviceId,os:m.os,appver:m.appver,versioncode:m.versioncode||"140",mobilename:m.mobilename||"",buildver:m.buildver||T().toString().substr(0,10),resolution:m.resolution||"1920x1080",__csrf:L,channel:m.channel,requestId:"".concat(T(),"_").concat(P(1e3*A()).toString().padStart(4,"0"))},r.checkToken?{"X-antiCheatToken":k.checkToken}:{});m.MUSIC_U&&(q.MUSIC_U=m.MUSIC_U),m.MUSIC_A&&(q.MUSIC_A=m.MUSIC_A),y.Cookie=function(e){for(var t=E(e),r=new Array(t.length),n=0,o=t.length;n<o;n++){var i=t[n];r[n]=encodeURIComponent(i)+"="+encodeURIComponent(e[i])}return r.join("; ")}(q),y["User-Agent"]=r.ua||B("api","iphone"),"eapi"===N?(t.header=q,t.e_r=_(void 0!==r.e_r?r.e_r:void 0!==t.e_r?t.e_r:G),S=c.eapi(e,t),b=R+"/eapi/"+e.substr(5)):"api"===N&&(b=R+e,S=t);break;default:f.error("Unknown Crypto:",N)}var K={method:"POST",url:b,headers:y,data:new j(S).toString(),httpAgent:new p.Agent({keepAlive:!0}),httpsAgent:new d.Agent({keepAlive:!0})};if(t.e_r&&(K.encoding=null,K.responseType="arraybuffer"),r.proxy)if(r.proxy.indexOf("pac")>-1){var W=new l(r.proxy);K.httpAgent=W,K.httpsAgent=W}else try{var J=new x(r.proxy);if(J.hostname){var z="https:"===J.protocol,V=h[z?"httpsOverHttp":"httpOverHttp"]({proxy:{host:J.hostname,port:J.port||80,proxyAuth:J.username&&J.password?J.username+":"+J.password:""}});K.httpsAgent=V,K.httpAgent=V,K.proxy=!1}else f.error("代理配置无效,不使用代理")}catch(e){f.error("代理URL解析失败:",e.message)}else K.proxy=!1;u(K).then(function(e){var r=e.data;H.cookie=(e.headers["set-cookie"]||[]).map(function(e){return e.replace(/\s*Domain=[^(;|$)]+;*/,"")});try{"eapi"===N&&t.e_r?H.body=c.eapiResDecrypt(r.toString("hex").toUpperCase()):H.body="object"===n(r)?r:I(r.toString()),H.body.code&&(H.body.code=Number(H.body.code)),H.status=Number(H.body.code||e.status),F.has(H.body.code)&&(H.status=200)}catch(t){H.body=r,H.status=e.status}H.status=H.status>100&&H.status<600?H.status:400,200===H.status?o(H):(f.error(H),a(H))}).catch(function(e){H.status=502,H.body={code:502,msg:e.message||e},f.error(H),a(H)})})}},206(e){var t="",r="",n="",o={debug:function(e){for(var r,n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return(r=console).info.apply(r,["".concat("","[DEBUG]").concat(t),e].concat(o))},info:function(e){for(var r,o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];return(r=console).info.apply(r,["".concat(n,"[INFO]").concat(t),e].concat(i))},warn:function(e){for(var r,n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return(r=console).info.apply(r,["".concat("","[WARN]").concat(t),e].concat(o))},error:function(e){for(var r,n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return(r=console).error.apply(r,["".concat("","[ERROR]").concat(t),e].concat(o))},success:function(e){for(var o,i=arguments.length,a=new Array(i>1?i-1:0),c=1;c<i;c++)a[c-1]=arguments[c];return(o=console).log.apply(o,["".concat(r).concat(n,"[SUCCESS]").concat(t),e].concat(a))},critical:function(e){for(var n,o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];return(n=console).error.apply(n,["".concat(r).concat("","[CRITICAL]").concat(t),e].concat(i))}};e.exports=o},213(e){"use strict";e.exports=require("crypto-js")},228(e){"use strict";e.exports=require("node-forge")},322(e){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function r(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,n(o.key),o)}}function n(e){var r=function(e){if("object"!=t(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(r)?r:r+""}var o=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.cache=new Map,this.size=0},(t=[{key:"add",value:function(e,t,r,n){var o=this,i=this.cache.get(e);i&&clearTimeout(i.timeout);var a={value:t,expire:r+Date.now(),timeout:setTimeout(function(){o.delete(e),"function"==typeof n&&n(t,e)},r)};return this.cache.set(e,a),this.size=this.cache.size,a}},{key:"delete",value:function(e){var t=this.cache.get(e);return t&&(clearTimeout(t.timeout),this.cache.delete(e),this.size=this.cache.size),null}},{key:"get",value:function(e){return this.cache.get(e)||null}},{key:"getValue",value:function(e){var t=this.cache.get(e);return t?t.value:void 0}},{key:"clear",value:function(){return this.cache.forEach(function(e){return clearTimeout(e.timeout)}),this.cache.clear(),this.size=0,!0}},{key:"has",value:function(e){var t=this.cache.get(e);return!(!t||Date.now()>t.expire&&(this.delete(e),1))}}])&&r(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();e.exports=o},330(e){"use strict";e.exports=JSON.parse('{"name":"@neteasecloudmusicapienhanced/api","version":"4.29.21","description":"全网最全的网易云音乐API接口 || A revival project for NeteaseCloudMusicApi Node.js Services (Half Refactor & Enhanced) || 网易云音乐 API 备份 + 增强 || 本项目自原版v4.28.0版本后开始自行维护","scripts":{"dev":"nodemon app.js","start":"node app.js","test":"mocha -r intelli-espower-loader -t 60000 server.test.js main.test.js --exit","lint":"eslint \\"**/*.{js,ts}\\"","lint-fix":"eslint --fix \\"**/*.{js,ts}\\"","prepare":"husky install","pkgwin":"pkg . -t node18-win-x64 -C GZip -o bin/app --no-bytecode","pkglinux":"pkg . -t node18-linux-x64 -C GZip -o bin/app --no-bytecode","pkgmacos":"pkg . -t node18-macos-x64 -C GZip -o bin/app --no-bytecode","build":"webpack --config webpack.config.js","build:prod":"webpack --mode production --config webpack.config.js","build:dev":"webpack --mode development --config webpack.config.js","start:bundle":"node precompiled/bundle.js"},"bin":"./app.js","pkg":{"scripts":"module/*.js","assets":["node_modules/axios","node_modules/express","node_modules/express-fileupload","node_modules/md5","node_modules/music-metadata","node_modules/pac-proxy-agent","node_modules/qrcode","node_modules/safe-decode-uri-component","node_modules/tunnel","node_modules/yargs","node_modules/tslib","node_modules/vm2","module","public","data"]},"keywords":["网易云音乐","网易云","音乐","网易云音乐nodejs"],"main":"main.js","types":"./interface.d.ts","engines":{"node":">=12"},"lint-staged":{"*.js":["eslint --fix","git add"]},"author":"MoeFurina","license":"MIT","files":["module","util","plugins","main.d.ts","interface.d.ts","module_types","server.js","generateConfig.js","public","data"],"dependencies":{"@neteasecloudmusicapienhanced/unblockmusic-utils":"^0.1.3","axios":"^1.13.4","crypto-js":"^4.2.0","dotenv":"^17.2.3","express":"^5.2.1","express-fileupload":"^1.5.2","md5":"^2.3.0","music-metadata":"^11.11.1","node-forge":"^1.3.3","pac-proxy-agent":"^7.2.0","qrcode":"^1.5.4","safe-decode-uri-component":"^1.2.1","tunnel":"^0.0.6","xml2js":"^0.6.2","yargs":"^18.0.0"},"devDependencies":{"@babel/core":"^7.28.6","@babel/preset-env":"^7.28.6","@eslint/eslintrc":"^3.3.3","@eslint/js":"^9.39.2","@types/express":"^5.0.6","@types/express-fileupload":"^1.5.1","@types/mocha":"^10.0.10","@types/node":"25.0.9","@typescript-eslint/eslint-plugin":"8.46.3","@typescript-eslint/parser":"8.53.0","babel-loader":"^10.0.0","eslint":"9.39.0","eslint-config-prettier":"10.1.8","eslint-plugin-html":"8.1.3","eslint-plugin-prettier":"5.5.5","globals":"^16.5.0","husky":"9.1.7","intelli-espower-loader":"1.1.0","lint-staged":"16.2.7","mocha":"11.7.5","nodemon":"^3.1.11","pkg":"^5.8.1","power-assert":"1.6.1","prettier":"3.7.4","typescript":"5.9.3","webpack":"^5.104.1","webpack-cli":"^6.0.1"}}')},378(e){"use strict";e.exports=require("express-fileupload")},460(e){"use strict";e.exports=require("tunnel")},554(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function c(r,n,o,a){var c=n&&n.prototype instanceof u?n:u,l=Object.create(c.prototype);return i(l,"_invoke",function(r,n,o){var i,a,c,u=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,a=0,c=e,p.n=r,s}};function d(r,n){for(a=r,c=n,t=0;!f&&u&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];r>3?(o=h===n)&&(c=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(a=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,a=0))}if(o||r>1)return s;throw f=!0,n}return function(o,l,h){if(u>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),a=l,c=h;(t=a<2?e:c)||!f;){i||(a?a<3?(a>1&&(p.n=-1),d(a,c)):p.n=c:p.v=c);try{if(u=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=p.n<0)?c:r.call(n,p))!==s)break}catch(t){i=e,a=1,c=t}finally{u=1}}return{value:t,done:f}}}(r,o,a),!0),l}var s={};function u(){}function l(){}function f(){}t=Object.getPrototypeOf;var p=[][n]?t(t([][n]())):(i(t={},n,function(){return this}),t),d=f.prototype=u.prototype=Object.create(p);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,i(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=f,i(d,"constructor",f),i(f,"constructor",l),l.displayName="GeneratorFunction",i(f,a,"GeneratorFunction"),i(d),i(d,a,"Generator"),i(d,n,function(){return this}),i(d,"toString",function(){return"[object Generator]"}),(o=function(){return{w:c,m:h}})()}function i(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}i=function(e,t,r,n){function a(t,r){i(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(a("next",0),a("throw",1),a("return",2))},i(e,t,r,n)}function a(e,t,r,n,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}function c(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function c(e){a(i,n,o,c,s,"next",e)}function s(e){a(i,n,o,c,s,"throw",e)}c(void 0)})}}function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach(function(t){l(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function l(e,t,r){return(t=function(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var f=r(21),p=r(873),d=r(820).tmpdir(),h=r(800).cookieToJson,y=p.resolve(d,"anonymous_token");f.existsSync(y)||f.writeFileSync(y,"","utf-8");var v={},m=p.join(__dirname,"module");if(f.existsSync(m)||(m=p.join(__dirname,"..","module")),!f.existsSync(m))throw new Error("Module directory not found at ".concat(p.join(__dirname,"module")," or ").concat(m));var b=f.readdirSync(m).reverse(),g=null;b.forEach(function(e){if(e.endsWith(".js")){var t=p.join(m,e),n=r(641)(t),i=e.split(".").shift()||"";v[i]=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="string"==typeof e.cookie?h(e.cookie):e.cookie||{};return n(u(u({},e),{},{cookie:t}),c(o().m(function e(){var t=arguments;return o().w(function(e){for(;;)if(0===e.n)return g||(g=r(157)),e.a(2,g.apply(void 0,t))},e)})))}}});var w=null;e.exports=u({get server(){return w||(w=r(860)),w}},v),Object.assign(e.exports,r(860))},594(e){"use strict";e.exports=require("express")},599(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var o=r(213),i=r(228),a="0102030405060708",c="e82ckenh8dichen8",s=function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"base64",a=o.AES.encrypt(o.enc.Utf8.parse(e),o.enc.Utf8.parse(r),{iv:o.enc.Utf8.parse(n),mode:o.mode[t.toUpperCase()],padding:o.pad.Pkcs7});return"base64"===i?a.toString():a.ciphertext.toString().toUpperCase()},u=function(e,t,r){return("base64"===(arguments.length>3&&void 0!==arguments[3]?arguments[3]:"base64")?o.AES.decrypt(e,o.enc.Utf8.parse(t),{iv:o.enc.Utf8.parse(r),mode:o.mode.ECB,padding:o.pad.Pkcs7}):o.AES.decrypt({ciphertext:o.enc.Hex.parse(e)},o.enc.Utf8.parse(t),{iv:o.enc.Utf8.parse(r),mode:o.mode.ECB,padding:o.pad.Pkcs7})).toString(o.enc.Utf8)};e.exports={weapi:function(e){for(var t,r,n=JSON.stringify(e),o="",c=0;c<16;c++)o+="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".charAt(Math.round(61*Math.random()));return{params:s(s(n,"cbc","0CoJUm6Qyw8W8jud",a),"cbc",o,a),encSecKey:(t=o.split("").reverse().join(""),r=i.pki.publicKeyFromPem("-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDgtQn2JZ34ZC28NWYpAUd98iZ37BUrX/aKzmFbt7clFSs6sXqHauqKWqdtLkF2KexO40H1YTX8z2lSgBBOAxLsvaklV8k4cBFK9snQXE9/DDaFt6Rr7iVZMldczhC0JNgTz+SHXT6CBHuX3e9SdB1Ua44oncaTWz7OBGLbCiK45wIDAQAB\n-----END PUBLIC KEY-----").encrypt(t,"NONE"),i.util.bytesToHex(r))}},linuxapi:function(e){var t=JSON.stringify(e);return{eparams:s(t,"ecb","rFgB&h#%2?^eDg:Q","","hex")}},eapi:function(e,t){var r="object"===n(t)?JSON.stringify(t):t,i="nobody".concat(e,"use").concat(r,"md5forencrypt"),a=o.MD5(i).toString(),u="".concat(e,"-36cd479b6b5-").concat(r,"-36cd479b6b5-").concat(a);return{params:s(u,"ecb",c,"","hex")}},decrypt:function(e){var t=o.AES.decrypt({ciphertext:o.enc.Hex.parse(e)},c,{mode:o.mode.ECB});return o.enc.Utf8.stringify(t)},aesEncrypt:s,aesDecrypt:u,eapiReqDecrypt:function(e){var t=u(e,c,"","hex").match(/(.*?)-36cd479b6b5-(.*?)-36cd479b6b5-(.*)/);return t?{url:t[1],data:JSON.parse(t[2])}:null},eapiResDecrypt:function(e){try{var t=u(e,c,"","hex");return JSON.parse(t)}catch(e){return console.log("eapiResDecrypt error:",e),null}}}},608(e,t,r){var n=r(16),o=r(322),i=r(206),a={ms:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2592e6},c=[],s=function(e){return function(t){return!function(e){return function(t){return e===t}}(e)(t)}},u=function(e,t){return"- "+(t?t+" ":"")+(e>1e3?(e/1e3).toFixed(2)+"sec":e+"ms")+""};function l(e){return e.getHeaders?e.getHeaders():e._headers}e.exports=new function e(){var t=new o,r={debug:!1,defaultDuration:36e5,enabled:!0,appendKey:[],jsonp:!1,redisClient:!1,headerBlacklist:[],statusCodes:{include:[],exclude:[]},events:{expire:void 0},headers:{},trackPerformance:!1},f=[],p=this,d=null,h={},y=[];function v(e,t,n,o){var i=["[apicache]",e,t,n,o].filter(function(e){return void 0!==e}),a=process.env.DEBUG&&-1!==process.env.DEBUG.split(",").indexOf("apicache");return(r.debug||a)&&console.log.apply(null,i)}function m(e,t,n){var o=r.statusCodes;return!(!t||n&&!n(e,t)||o.exclude&&o.exclude.length&&-1!==o.exclude.indexOf(t.statusCode)||o.include&&o.include.length&&-1===o.include.indexOf(t.statusCode))}function b(e){return Object.keys(e).filter(function(e){return-1===r.headerBlacklist.indexOf(e)}).reduce(function(t,r){return t[r]=e[r],t},{})}function g(e,t){if(t)if("string"==typeof t)e._apicache.content=(e._apicache.content||"")+t;else if(Buffer.isBuffer(t)){var r=e._apicache.content;"string"==typeof r&&(r=Buffer.from?Buffer.from(r):new Buffer(r)),r||(r=Buffer.alloc?Buffer.alloc(0):new Buffer(0)),e._apicache.content=Buffer.concat([r,t],r.length+t.length)}else e._apicache.content=t}function w(e,n,o,i,a,c,s){n._apicache={write:n.write,writeHead:n.writeHead,end:n.end,cacheable:!0,content:void 0},Object.keys(r.headers).forEach(function(e){n.setHeader(e,r.headers[e])}),n.writeHead=function(){return r.headers["cache-control"]||(m(e,n,s)?n.setHeader("cache-control","max-age="+(a/1e3).toFixed(0)):n.setHeader("cache-control","no-cache, no-store, must-revalidate")),n._apicache.headers=Object.assign({},l(n)),n._apicache.writeHead.apply(this,arguments)},n.write=function(e){return g(n,e),n._apicache.write.apply(this,arguments)},n.end=function(o,f){if(m(e,n,s)&&(g(n,o),n._apicache.cacheable&&n._apicache.content)){!function(e,t){var r=t.apicacheGroup;r&&(v('group detected "'+r+'"'),(d.groups[r]=d.groups[r]||[]).unshift(e)),d.all.unshift(e)}(i,e);var y=n._apicache.headers||l(n),w=function(e,t,r,n){return{status:e,headers:b(t),data:r,encoding:n,timestamp:(new Date).getTime()/1e3}}(n.statusCode,y,n._apicache.content,f);!function(e,n,o){var i=r.redisClient,a=r.events.expire;if(i&&i.connected)try{i.hset(e,"response",JSON.stringify(n)),i.hset(e,"duration",o),i.expire(e,o/1e3,a||function(){})}catch(e){v("[apicache] error in redis.hset()")}else t.add(e,n,o,a);h[e]=setTimeout(function(){p.clear(e,!0)},Math.min(o,2147483647))}(i,w,a);var _=new Date-e.apicacheTimer;v('adding cache entry for "'+i+'" @ '+c,u(_)),v("_apicache.headers: ",n._apicache.headers),v("res.getHeaders(): ",l(n)),v("cacheObject: ",w)}return n._apicache.end.apply(this,arguments)},o()}function _(e,t,r,n,o,i){if(n&&!n(e,t))return o();var a=l(t);Object.assign(a,b(r.headers||{}),{"cache-control":"max-age="+Math.max(0,(i/1e3-((new Date).getTime()/1e3-r.timestamp)).toFixed(0))});var c=r.data;c&&"Buffer"===c.type&&(c="number"==typeof c.data?new Buffer.alloc(c.data):new Buffer.from(c.data));var s=r.headers.etag,u=e.headers["if-none-match"];return u&&s===u?(t.writeHead(304,a),t.end()):(t.writeHead(r.status||200,a),t.end(c,r.encoding))}function O(){for(var e in f)Object.assign(f[e].options,r,f[e].localOptions)}function S(e,t){if("number"==typeof e)return e;if("string"==typeof e){var r=e.match(/^([\d\.,]+)\s?(\w+)$/);if(3===r.length){var n=parseFloat(r[1]),o=r[2].replace(/s$/i,"").toLowerCase();return"m"===o&&(o="ms"),(n||1)*(a[o]||0)}}return t}c.push(this),this.id=c.length,this.clear=function(e,n){var o=d.groups[e],a=r.redisClient;if(o)v('clearing group "'+e+'"'),o.forEach(function(e){if(v('clearing cached entry for "'+e+'"'),clearTimeout(h[e]),delete h[e],r.redisClient)try{a.del(e)}catch(t){i.info('[apicache] error in redis.del("'+e+'")')}else t.delete(e);d.all=d.all.filter(s(e))}),delete d.groups[e];else if(e){if(v("clearing "+(n?"expired":"cached")+' entry for "'+e+'"'),clearTimeout(h[e]),delete h[e],a)try{a.del(e)}catch(t){i.info('[apicache] error in redis.del("'+e+'")')}else t.delete(e);d.all=d.all.filter(s(e)),Object.keys(d.groups).forEach(function(t){d.groups[t]=d.groups[t].filter(s(e)),d.groups[t].length||delete d.groups[t]})}else v("clearing entire index"),a?d.all.forEach(function(e){clearTimeout(h[e]),delete h[e];try{a.del(e)}catch(t){i.info('[apicache] error in redis.del("'+e+'")')}}):t.clear(),this.resetIndex();return this.getIndex()},this.getDuration=function(e){return S(e,r.defaultDuration)},this.getPerformance=function(){return y.map(function(e){return e.report()})},this.getIndex=function(e){return e?d.groups[e]:d},this.middleware=function(e,o,i){var a=p.getDuration(e),c={};f.push({options:c});var s=function(e){return e&&(f.find(function(e){return e.options===c}).localOptions=e),O(),c};s(i);var l=r.trackPerformance?new function(){this.hitsLast100=new Uint8Array(25),this.hitsLast1000=new Uint8Array(250),this.hitsLast10000=new Uint8Array(2500),this.hitsLast100000=new Uint8Array(25e3),this.callCount=0,this.hitCount=0,this.lastCacheHit=null,this.lastCacheMiss=null,this.report=function(){return{lastCacheHit:this.lastCacheHit,lastCacheMiss:this.lastCacheMiss,callCount:this.callCount,hitCount:this.hitCount,missCount:this.callCount-this.hitCount,hitRate:0==this.callCount?null:this.hitCount/this.callCount,hitRateLast100:this.hitRate(this.hitsLast100),hitRateLast1000:this.hitRate(this.hitsLast1000),hitRateLast10000:this.hitRate(this.hitsLast10000),hitRateLast100000:this.hitRate(this.hitsLast100000)}},this.hitRate=function(e){for(var t=0,r=0,n=0;n<e.length;n++){var o=e[n];for(j=0;j<4;j++){switch(3&o){case 1:t++;break;case 2:r++}o>>=2}}var i=t+r;return 0==i?null:t/i},this.recordHitInArray=function(e,t){var r=~~(this.callCount/4)%e.length,n=this.callCount%4*2,o=~(3<<n),i=(t?1:2)<<n;e[r]=e[r]&o|i},this.recordHit=function(e){this.recordHitInArray(this.hitsLast100,e),this.recordHitInArray(this.hitsLast1000,e),this.recordHitInArray(this.hitsLast10000,e),this.recordHitInArray(this.hitsLast100000,e),e&&this.hitCount++,this.callCount++},this.hit=function(e){this.recordHit(!0),this.lastCacheHit=e},this.miss=function(e){this.recordHit(!1),this.lastCacheMiss=e}}:new function(){this.report=this.hit=this.miss=function(){}};y.push(l);var d=function(r,i,s){function f(){return v("bypass detected, skipping cache."),s()}if(!c.enabled)return f();if(r.headers["x-apicache-bypass"]||r.headers["x-apicache-force-fetch"])return f();r.apicacheTimer=new Date;var p=r.hostname+(r.originalUrl||r.url)+JSON.stringify(r.cookies);if(c.jsonp&&(p=n.parse(p).pathname),"function"==typeof c.appendKey)p+="$$appendKey="+c.appendKey(r,i);else if(c.appendKey.length>0){for(var d=r,h=0;h<c.appendKey.length;h++)d=d[c.appendKey[h]];p+="$$appendKey="+d}var y=c.redisClient,m=y?null:t.getValue(p);if(m){var b=new Date-r.apicacheTimer;return v("sending cached (memory-cache) version of",p,u(b)),l.hit(p),_(r,i,m,o,s,a)}if(!y||!y.connected)return l.miss(p),w(r,i,s,p,a,e,o);try{y.hgetall(p,function(t,n){if(!t&&n&&n.response){var c=new Date-r.apicacheTimer;return v("sending cached (redis) version of",p,u(c)),l.hit(p),_(r,i,JSON.parse(n.response),o,s,a)}return l.miss(p),w(r,i,s,p,a,e,o)})}catch(t){return l.miss(p),w(r,i,s,p,a,e,o)}};return d.options=s,d},this.options=function(e){return e?(Object.assign(r,e),O(),"defaultDuration"in e&&(r.defaultDuration=S(r.defaultDuration,36e5)),r.trackPerformance&&v("WARNING: using trackPerformance flag can cause high memory usage!"),this):r},this.resetIndex=function(){d={all:[],groups:{}}},this.newInstance=function(t){var r=new e;return t&&r.options(t),r},this.clone=function(){return this.newInstance(this.options())},this.resetIndex()}},611(e){"use strict";e.exports=require("http")},641(e){function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=641,e.exports=t},646(e){"use strict";e.exports=require("child_process")},692(e){"use strict";e.exports=require("https")},800(e,t,r){var n=r(206),o=[["1.0.1.0","1.0.3.255",768,"福州"],["1.0.8.0","1.0.15.255",2048,"广州"],["1.0.32.0","1.0.63.255",8192,"广州"],["1.1.0.0","1.1.0.255",256,"福州"],["1.1.2.0","1.1.63.255",15872,"广州"],["1.2.0.0","1.2.2.255",768,"北京"],["1.2.4.0","1.2.127.255",31744,"广州"],["1.3.0.0","1.3.255.255",65536,"广州"],["1.4.1.0","1.4.127.255",32512,"广州"],["1.8.0.0","1.8.255.255",65536,"北京"],["1.10.0.0","1.10.9.255",2560,"福州"],["1.10.11.0","1.10.127.255",29952,"广州"],["1.12.0.0","1.15.255.255",262144,"上海"],["1.18.128.0","1.18.128.255",256,"北京"],["1.24.0.0","1.31.255.255",524288,"赤峰"],["1.45.0.0","1.45.255.255",65536,"北京"],["1.48.0.0","1.51.255.255",262144,"济南"],["1.56.0.0","1.63.255.255",524288,"伊春"],["1.68.0.0","1.71.255.255",262144,"忻州"],["1.80.0.0","1.95.255.255",1048576,"北京"],["1.116.0.0","1.117.255.255",131072,"上海"],["1.119.0.0","1.119.255.255",65536,"北京"],["1.180.0.0","1.185.255.255",393216,"桂林"],["1.188.0.0","1.199.255.255",786432,"洛阳"],["1.202.0.0","1.207.255.255",393216,"铜仁"]];function i(e){var t=e.split(".").map(Number);return(t[0]<<24>>>0)+(t[1]<<16)+(t[2]<<8)+t[3]}var a=function(){for(var e=[],t=0,r=0;r<o.length;r++){var n=o[r],a=i(n[0]),c=i(n[1]),s=n[2]||c-a+1;e.push({start:a,end:c,count:s,location:n[3]||""}),t+=s}return e.totalCount=t,e}(),c=Math.floor,s=Math.random,u=Object.keys,l=encodeURIComponent;function f(e,t){return c(s()*(t-e+1))+e}function p(){return f(1,255)}e.exports={toBoolean:function(e){return"boolean"==typeof e||""===e?e:"true"===e||"1"==e},cookieToJson:function(e){if(!e)return{};for(var t=e.split(";"),r={},n=0,o=t.length;n<o;n++){var i=t[n].split("=");2===i.length&&(r[i[0].trim()]=i[1].trim())}return r},cookieObjToString:function(e){for(var t=u(e),r=[],n=0,o=t.length;n<o;n++){var i=t[n];r[n]="".concat(l(i),"=").concat(l(e[i]))}return r.join("; ")},getRandom:function(e){var t=s(),r=c(9*t+1),n=Math.pow(10,e-1);return c((t+r)*n)},generateRandomChineseIP:function(){var e=a.totalCount||0;if(!e){var t="116.".concat(f(25,94),".").concat(p(),".").concat(p());return n.info("Generated Random Chinese IP (fallback):",t),t}for(var r=Math.floor(s()*e),o=null,i=0;i<a.length;i++){var c=a[i];if(r<c.count){o=c;break}r-=c.count}o||(o=a[a.length-1]);var u,l=o.end-o.start+1,d=[(u=o.start+Math.floor(s()*l))>>>24&255,u>>>16&255,u>>>8&255,255&u].join(".");return n.info("Generated Random Chinese IP:",d,"location:",o.location),d},generateChainId:function(e){var t=Math.floor(1e6*Math.random()),r=function(e){if(!e)return"";var t=("; "+e).split("; sDeviceId=");return 2===t.length?t.pop().split(";").shift():""}(e)||"unknown-"+t,n=Date.now();return"".concat("v1","_").concat(r,"_").concat("web","_").concat("login","_").concat(n)},generateDeviceId:function(){for(var e=[],t=0;t<52;t++){var r=Math.floor(16*Math.random());e.push("0123456789ABCDEF"[r])}return e.join("")}}},820(e){"use strict";e.exports=require("os")},860(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,c=[],s=!0,u=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(c.push(n.value),c.length!==t);s=!0);}catch(e){u=!0,o=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return c}}(e,t)||l(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(n(e)+" is not iterable")}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach(function(t){s(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function s(e,t,r){return(t=function(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=l(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function l(e,t){if(e){if("string"==typeof e)return f(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(e,t):void 0}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function p(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var s=n&&n.prototype instanceof c?n:c,u=Object.create(s.prototype);return d(u,"_invoke",function(r,n,o){var i,c,s,u=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,c=0,s=e,p.n=r,a}};function d(r,n){for(c=r,s=n,t=0;!f&&u&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];r>3?(o=h===n)&&(s=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,c=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(u>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),c=l,s=h;(t=c<2?e:s)||!f;){i||(c?c<3?(c>1&&(p.n=-1),d(c,s)):p.n=s:p.v=s);try{if(u=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(f=p.n<0)?s:r.call(n,p))!==a)break}catch(t){i=e,c=1,s=t}finally{u=1}}return{value:t,done:f}}}(r,o,i),!0),u}var a={};function c(){}function s(){}function u(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(d(t={},n,function(){return this}),t),f=u.prototype=c.prototype=Object.create(l);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,d(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return s.prototype=u,d(f,"constructor",u),d(u,"constructor",s),s.displayName="GeneratorFunction",d(u,o,"GeneratorFunction"),d(f),d(f,o,"Generator"),d(f,n,function(){return this}),d(f,"toString",function(){return"[object Generator]"}),(p=function(){return{w:i,m:h}})()}function d(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}d=function(e,t,r,n){function i(t,r){d(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},d(e,t,r,n)}function h(e,t,r,n,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}function y(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){h(i,n,o,a,c,"next",e)}function c(e){h(i,n,o,a,c,"throw",e)}a(void 0)})}}r(996).config();var v=r(21),m=r(873),b=r(594),g=r(157),w=r(330),_=r(646).exec,O=r(608).middleware,S=r(800).cookieToJson,j=r(378),x=r(977),k=r(206);function C(e,t){return P.apply(this,arguments)}function P(){return P=y(p().m(function e(t,n){var o,i,a,c,s=arguments;return p().w(function(e){for(;;)switch(e.n){case 0:return o=!(s.length>2&&void 0!==s[2])||s[2],e.n=1,v.promises.readdir(t);case 1:return i=e.v,a=function(e){return n&&e in n?n[e]:"/".concat(e.replace(/\.js$/i,"").replace(/_/g,"/"))},c=i.reverse().filter(function(e){return e.endsWith(".js")}).map(function(e){var n=e.split(".").shift(),i=a(e),c=m.join(t,e);return{identifier:n,route:i,module:o?r(641)(c):c}}),e.a(2,c)}},e)})),P.apply(this,arguments)}function A(){return T.apply(this,arguments)}function T(){return(T=y(p().m(function e(){return p().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e){_("npm info NeteaseCloudMusicApiEnhanced version",function(t,r){if(t)e({status:-1});else{var n=r.trim();o=w.version<n?0:1,e({status:o,ourVersion:w.version,npmVersion:n})}var o})}))},e)}))).apply(this,arguments)}function E(e){return I.apply(this,arguments)}function I(){return I=y(p().m(function e(t){var n,o,a,s,d,h,v,w;return p().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=b(),o=process.env.CORS_ALLOW_ORIGIN,n.set("trust proxy",!0),n.use(b.static(m.join(__dirname,"public"))),n.use(function(e,t,r){"/"===e.path||e.path.includes(".")||t.set({"Access-Control-Allow-Credentials":!0,"Access-Control-Allow-Origin":o||e.headers.origin||"*","Access-Control-Allow-Headers":"X-Requested-With,Content-Type","Access-Control-Allow-Methods":"PUT,POST,GET,DELETE,OPTIONS","Content-Type":"application/json; charset=utf-8"}),"OPTIONS"===e.method?t.status(204).end():r()}),n.use(function(e,t,r){e.cookies={},(e.headers.cookie||"").split(/;\s+|(?<!\s)\s+$/g).forEach(function(t){var r=t.indexOf("=");r<1||r==t.length-1||(e.cookies[x(t.slice(0,r)).trim()]=x(t.slice(r+1)).trim())}),r()}),n.use(b.json({limit:"50mb"})),n.use(b.urlencoded({extended:!1,limit:"50mb"})),n.use(j()),n.use(O("2 minutes",function(e,t){return 200===t.statusCode})),a={"daily_signin.js":"/daily_signin","fm_trash.js":"/fm_trash","personal_fm.js":"/personal_fm"},v=t){e.n=2;break}return e.n=1,C(m.join(__dirname,"module"),a);case 1:v=e.v;case 2:s=u(v),e.p=3,h=p().m(function e(){var t;return p().w(function(e){for(;;)switch(e.n){case 0:t=d.value,n.use(t.route,function(){var e=y(p().m(function e(n,o){var i,a,s,u,d,h,y,v,m;return p().w(function(e){for(;;)switch(e.p=e.n){case 0:return[n.query,n.body].forEach(function(e){e&&"string"==typeof e.cookie&&(e.cookie=S(x(e.cookie)))}),i=Object.assign({},{cookie:n.cookies},n.query,n.body,n.files),e.p=1,e.n=2,t.module(i,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o,i=[].concat(t),a=n.ip;return"::ffff:"==a.substring(0,7)&&(a=a.substring(7)),"::1"==a&&(a=global.cnIp),k.info("Requested from ip:",a),i[3]=c(c({},i[3]),{},{ip:a}),g.apply(void 0,function(e){if(Array.isArray(e))return f(e)}(o=i)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(o)||l(o)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())});case 2:if(a=e.v,k.info("Request Success: ".concat(x(n.originalUrl))),"/song/url/v1"!==n.baseUrl&&"/song/url"!==n.baseUrl||"true"!==process.env.ENABLE_GENERAL_UNBLOCK){e.n=5;break}if(null===(s=a.body.data[0]).freeTrialInfo&&s.url&&![1,4].includes(s.fee)){e.n=4;break}return u=r(955),d=u.matchID,k.info("Starting unblock(uses general unblock):",n.query.id),e.n=3,d(n.query.id);case 3:h=e.v,s.url=h.data.url,s.freeTrialInfo="null",k.info("Unblock success! url:",s.url);case 4:s.url&&s.url.includes("kuwo")&&(y=process.env.PROXY_URL,"true"===(process.env.ENABLE_PROXY||"false")&&y&&(s.proxyUrl=y+s.url));case 5:v=a.cookie,i.noCookie||Array.isArray(v)&&v.length>0&&("https"===n.protocol?o.append("Set-Cookie",v.map(function(e){return e+"; SameSite=None; Secure"})):o.append("Set-Cookie",v)),o.status(a.status).send(a.body),e.n=8;break;case 6:if(e.p=6,m=e.v,k.error("".concat(x(n.originalUrl)),{status:m.status,body:m.body}),m.body){e.n=7;break}return o.status(404).send({code:404,data:null,msg:"Not Found"}),e.a(2);case 7:"301"==m.body.code&&(m.body.msg="需要登录"),i.noCookie||o.append("Set-Cookie",m.cookie),o.status(m.status).send(m.body);case 8:return e.a(2)}},e,null,[[1,6]])}));return function(t,r){return e.apply(this,arguments)}}());case 1:return e.a(2)}},e)}),s.s();case 4:if((d=s.n()).done){e.n=6;break}return e.d(i(h()),5);case 5:e.n=4;break;case 6:e.n=8;break;case 7:e.p=7,w=e.v,s.e(w);case 8:return e.p=8,s.f(),e.f(8);case 9:return e.a(2,n)}},e,null,[[3,7,8,9]])})),I.apply(this,arguments)}function D(){return(D=y(p().m(function e(t){var r,n,i,a,c,s,u,l;return p().w(function(e){for(;;)switch(e.n){case 0:return r=Number(t.port||process.env.PORT||"3000"),n=t.host||process.env.HOST||"",i=t.checkVersion&&A().then(function(e){var t=e.npmVersion,r=e.ourVersion;0==e.status&&k.info("最新版本: ".concat(t,", 当前版本: ").concat(r,", 请及时更新"))}),a=E(t.moduleDefs),e.n=1,Promise.all([i,a]);case 1:return c=e.v,(s=o(c,2))[0],u=s[1],(l=u).server=u.listen(r,n,function(){console.log("\n _ _ _____ __ __ \n | \\ | |/ ____| \\/ |\n | \\| | | | \\ / |\n | . ` | | | |\\/| |\n | |\\ | |____| | | | \n |_| \\_|\\_____|_| |_|\n "),console.log("\n ╔═╗╔═╗╦ ╔═╗╔╗╔╦ ╦╔═╗╔╗╔╔═╗╔═╗╔╦╗\n ╠═╣╠═╝║ ║╣ ║║║╠═╣╠═╣║║║║ ║╣ ║║\n ╩ ╩╩ ╩ ╚═╝╝╚╝╩ ╩╩ ╩╝╚╝╚═╝╚═╝═╩╝\n "),k.info("\n- Server started successfully @ http://".concat(n||"localhost",":").concat(r,"\n- Environment: ").concat("production","\n- Node Version: ").concat(process.version,"\n- Process ID: ").concat(process.pid))}),e.a(2,l)}},e)}))).apply(this,arguments)}e.exports={serveNcmApi:function(e){return D.apply(this,arguments)},getModulesDefinitions:C}},873(e){"use strict";e.exports=require("path")},899(e){"use strict";e.exports=require("pac-proxy-agent")},955(e){"use strict";e.exports=require("@neteasecloudmusicapienhanced/unblockmusic-utils")},977(e){"use strict";e.exports=require("safe-decode-uri-component")},994(e,t,r){function n(){var e,t,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function c(r,n,i,a){var c=n&&n.prototype instanceof u?n:u,l=Object.create(c.prototype);return o(l,"_invoke",function(r,n,o){var i,a,c,u=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,a=0,c=e,p.n=r,s}};function d(r,n){for(a=r,c=n,t=0;!f&&u&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];r>3?(o=h===n)&&(c=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(a=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,a=0))}if(o||r>1)return s;throw f=!0,n}return function(o,l,h){if(u>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),a=l,c=h;(t=a<2?e:c)||!f;){i||(a?a<3?(a>1&&(p.n=-1),d(a,c)):p.n=c:p.v=c);try{if(u=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=p.n<0)?c:r.call(n,p))!==s)break}catch(t){i=e,a=1,c=t}finally{u=1}}return{value:t,done:f}}}(r,i,a),!0),l}var s={};function u(){}function l(){}function f(){}t=Object.getPrototypeOf;var p=[][i]?t(t([][i]())):(o(t={},i,function(){return this}),t),d=f.prototype=u.prototype=Object.create(p);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,o(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=f,o(d,"constructor",f),o(f,"constructor",l),l.displayName="GeneratorFunction",o(f,a,"GeneratorFunction"),o(d),o(d,a,"Generator"),o(d,i,function(){return this}),o(d,"toString",function(){return"[object Generator]"}),(n=function(){return{w:c,m:h}})()}function o(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}o=function(e,t,r,n){function a(t,r){o(e,t,function(e){return this._invoke(t,r,e)})}t?i?i(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(a("next",0),a("throw",1),a("return",2))},o(e,t,r,n)}function i(e,t,r,n,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}var a=r(21),c=r(873),s=r(554).register_anonimous,u=r(800),l=u.cookieToJson,f=u.generateRandomChineseIP,p=r(820).tmpdir();function d(){var e;return e=n().m(function e(){var t,r,o,i;return n().w(function(e){for(;;)switch(e.p=e.n){case 0:return global.cnIp=f(),e.p=1,e.n=2,s();case 2:t=e.v,(r=t.body.cookie)&&(o=l(r),a.writeFileSync(c.resolve(p,"anonymous_token"),o.MUSIC_A,"utf-8")),e.n=4;break;case 3:e.p=3,i=e.v,console.log(i);case 4:return e.a(2)}},e,null,[[1,3]])}),d=function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function c(e){i(a,n,o,c,s,"next",e)}function s(e){i(a,n,o,c,s,"throw",e)}c(void 0)})},d.apply(this,arguments)}e.exports=function(){return d.apply(this,arguments)}},996(e){"use strict";e.exports=require("dotenv")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}function n(){var e,t,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function c(r,n,i,a){var c=n&&n.prototype instanceof u?n:u,l=Object.create(c.prototype);return o(l,"_invoke",function(r,n,o){var i,a,c,u=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,a=0,c=e,p.n=r,s}};function d(r,n){for(a=r,c=n,t=0;!f&&u&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];r>3?(o=h===n)&&(c=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(a=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,a=0))}if(o||r>1)return s;throw f=!0,n}return function(o,l,h){if(u>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),a=l,c=h;(t=a<2?e:c)||!f;){i||(a?a<3?(a>1&&(p.n=-1),d(a,c)):p.n=c:p.v=c);try{if(u=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=p.n<0)?c:r.call(n,p))!==s)break}catch(t){i=e,a=1,c=t}finally{u=1}}return{value:t,done:f}}}(r,i,a),!0),l}var s={};function u(){}function l(){}function f(){}t=Object.getPrototypeOf;var p=[][i]?t(t([][i]())):(o(t={},i,function(){return this}),t),d=f.prototype=u.prototype=Object.create(p);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,o(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=f,o(d,"constructor",f),o(f,"constructor",l),l.displayName="GeneratorFunction",o(f,a,"GeneratorFunction"),o(d),o(d,a,"Generator"),o(d,i,function(){return this}),o(d,"toString",function(){return"[object Generator]"}),(n=function(){return{w:c,m:h}})()}function o(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}o=function(e,t,r,n){function a(t,r){o(e,t,function(e){return this._invoke(t,r,e)})}t?i?i(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(a("next",0),a("throw",1),a("return",2))},o(e,t,r,n)}function i(e,t,r,n,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var a=r(21),c=r(873),s=r(820).tmpdir();function u(){var e;return e=n().m(function e(){var t;return n().w(function(e){for(;;)switch(e.n){case 0:return a.existsSync(c.resolve(s,"anonymous_token"))||a.writeFileSync(c.resolve(s,"anonymous_token"),"","utf-8"),t=r(994),e.n=1,t();case 1:r(860).serveNcmApi({checkVersion:!0});case 2:return e.a(2)}},e)}),u=function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function c(e){i(a,n,o,c,s,"next",e)}function s(e){i(a,n,o,c,s,"throw",e)}c(void 0)})},u.apply(this,arguments)}!function(){u.apply(this,arguments)}(),module.exports={}})();