unblock-netease-music
Advanced tools
Comparing version 2.2.1 to 2.2.2
@@ -66,4 +66,4 @@ 'use strict'; | ||
_fs2.default.readdirSync(_path2.default.resolve(__dirname, 'plugins')).forEach(function (e) { | ||
var Plugin = require(_path2.default.resolve(__dirname, 'plugins', e)); | ||
_fs2.default.readdirSync(_path2.default.resolve(__dirname, 'plugins')).forEach(function (file) { | ||
var Plugin = require(_path2.default.resolve(__dirname, 'plugins', file)); | ||
_this.plugins.push(new Plugin()); | ||
@@ -95,10 +95,13 @@ }); | ||
searchResult = _context.sent; | ||
searchName = searchResult[0].name.replace(/ /g, '').toLowerCase(); | ||
trueName = songName.replace(/ /g, '').toLowerCase(); | ||
if (searchResult.length > 0 && searchName.indexOf(trueName) !== -1) { | ||
callback(null, { | ||
plugin: plugin, | ||
searchResult: searchResult[0] | ||
}); | ||
if (searchResult.length > 0) { | ||
searchName = searchResult[0].name.replace(/ /g, '').toLowerCase(); | ||
trueName = songName.replace(/ /g, '').toLowerCase(); | ||
if (searchName.indexOf(trueName) !== -1) { | ||
callback(null, { | ||
plugin: plugin, | ||
searchResult: searchResult[0] | ||
}); | ||
} | ||
} else { | ||
@@ -109,3 +112,3 @@ console.log(('No resource found from ' + plugin.name).yellow); | ||
case 7: | ||
case 5: | ||
case 'end': | ||
@@ -112,0 +115,0 @@ return _context.stop(); |
@@ -103,3 +103,2 @@ 'use strict'; | ||
options = { | ||
// url: `https://c.y.qq.com/base/fcgi-bin/fcg_musicexpress.fcg?guid=${this.guid}&format=json`, | ||
url: 'https://c.y.qq.com/base/fcgi-bin/fcg_musicexpress.fcg?json=3&guid=' + this.guid + '&g_tk=5381&jsonpCallback=jsonCallback&loginUin=0&hostUin=0&format=json&inCharset=utf8&outCharset=utf8¬ice=0&platform=yqq&needNewCode=0' | ||
@@ -106,0 +105,0 @@ }; |
{ | ||
"name": "unblock-netease-music", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "start": "babel-node -- src/bin/unblockneteasemusic -p 8123 -k -q -r", |
@@ -18,4 +18,4 @@ import 'colors'; | ||
initPlugins() { | ||
fs.readdirSync(path.resolve(__dirname, 'plugins')).forEach((e) => { | ||
const Plugin = require(path.resolve(__dirname, 'plugins', e)); | ||
fs.readdirSync(path.resolve(__dirname, 'plugins')).forEach((file) => { | ||
const Plugin = require(path.resolve(__dirname, 'plugins', file)); | ||
this.plugins.push(new Plugin()); | ||
@@ -32,9 +32,11 @@ }); | ||
const searchResult = await plugin.search(songName, artist); | ||
const searchName = searchResult[0].name.replace(/ /g, '').toLowerCase(); | ||
const trueName = songName.replace(/ /g, '').toLowerCase(); | ||
if (searchResult.length > 0 && searchName.indexOf(trueName) !== -1) { | ||
callback(null, { | ||
plugin, | ||
searchResult: searchResult[0], | ||
}); | ||
if (searchResult.length > 0) { | ||
const searchName = searchResult[0].name.replace(/ /g, '').toLowerCase(); | ||
const trueName = songName.replace(/ /g, '').toLowerCase(); | ||
if (searchName.indexOf(trueName) !== -1) { | ||
callback(null, { | ||
plugin, | ||
searchResult: searchResult[0], | ||
}); | ||
} | ||
} else { | ||
@@ -41,0 +43,0 @@ console.log(`No resource found from ${plugin.name}`.yellow); |
@@ -35,3 +35,2 @@ import 'colors'; | ||
const options = { | ||
// url: `https://c.y.qq.com/base/fcgi-bin/fcg_musicexpress.fcg?guid=${this.guid}&format=json`, | ||
url: `https://c.y.qq.com/base/fcgi-bin/fcg_musicexpress.fcg?json=3&guid=${this.guid}&g_tk=5381&jsonpCallback=jsonCallback&loginUin=0&hostUin=0&format=json&inCharset=utf8&outCharset=utf8¬ice=0&platform=yqq&needNewCode=0`, | ||
@@ -38,0 +37,0 @@ }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
1724
480527