Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
115b365493 | ||
|
|
827231bf23 | ||
|
|
2bc804187a | ||
|
|
da7ad5f8a3 | ||
|
|
16a3f488d3 | ||
|
|
04ab08a589 | ||
|
|
c39b5609dc |
@@ -1,3 +1,6 @@
|
||||
|
||||
var env = global.env || {};
|
||||
var CERU_KEY = env.ceru_key || '';
|
||||
var https = require('https');
|
||||
var http = require('http');
|
||||
var crypto = require('crypto');
|
||||
@@ -53,13 +56,23 @@ function requestUrl(urlStr, method, headers, body) {
|
||||
return doRequest(protocol, options, postData);
|
||||
}
|
||||
|
||||
function formatPlayTime(seconds) {
|
||||
if (!seconds) return '00:00';
|
||||
var m = Math.floor(seconds / 60);
|
||||
var s = Math.floor(seconds % 60);
|
||||
// ===== 格式化辅助 =====
|
||||
function formatPlayTime(time) {
|
||||
if (!time) return '--/--';
|
||||
var m = Math.floor(time / 60);
|
||||
var s = Math.floor(time % 60);
|
||||
if (m === 0 && s === 0) return '--/--';
|
||||
return (m < 10 ? '0' + m : m) + ':' + (s < 10 ? '0' + s : s);
|
||||
}
|
||||
|
||||
function sizeFormate(bytes) {
|
||||
if (typeof bytes === 'string') bytes = parseFloat(bytes.replace(/[^0-9.]/g, ''));
|
||||
var n = parseFloat(bytes);
|
||||
if (isNaN(n) || n < 0) return '0.00MB';
|
||||
var mb = n / (1024 * 1024);
|
||||
return mb.toFixed(2) + 'MB';
|
||||
}
|
||||
|
||||
// ===== Git音源配置 =====
|
||||
var GITCODE_CONFIG = { owner: 'ikun_0014', repo: 'music', token: 'WzsER9knWNgC_4tjeJCtHKcN' };
|
||||
function getGitcodeUrl() {
|
||||
@@ -68,6 +81,7 @@ function getGitcodeUrl() {
|
||||
var cachedList = null;
|
||||
var cacheTime = 0;
|
||||
var CACHE_TTL = 5 * 60 * 1000;
|
||||
var cachedLyricMap = null;
|
||||
|
||||
function fetchAllGitMusic() {
|
||||
var now = Date.now();
|
||||
@@ -75,22 +89,39 @@ function fetchAllGitMusic() {
|
||||
return requestUrl(getGitcodeUrl(), 'GET', { 'User-Agent': 'Mozilla/5.0' }).then(function(res) {
|
||||
var body = Array.isArray(res.body) ? res.body : [];
|
||||
var list = [];
|
||||
for (var i = 0; i < body.length; i++) list.push(formatGitItem(body[i]));
|
||||
var lyricMap = {};
|
||||
for (var i = 0; i < body.length; i++) {
|
||||
var formatted = formatGitItem(body[i]);
|
||||
if (formatted) {
|
||||
list.push(formatted);
|
||||
var lid = formatted.id;
|
||||
if (lid) lyricMap[lid] = (body[i].lyrics || body[i].lyric || '');
|
||||
}
|
||||
}
|
||||
cachedList = list;
|
||||
cachedLyricMap = lyricMap;
|
||||
cacheTime = now;
|
||||
return list;
|
||||
});
|
||||
}
|
||||
|
||||
function formatGitItem(item) {
|
||||
if (!item) return null;
|
||||
var qualities = {};
|
||||
var fmt = (item.format || '').toLowerCase();
|
||||
if (fmt === 'flac' && item.filesize) qualities.lossless = String(item.filesize);
|
||||
else if (fmt === 'mp3' && item.filesize) qualities.exhigh = String(item.filesize);
|
||||
else if (item.filesize) qualities.standard = String(item.filesize);
|
||||
var picUrl = item.img || '';
|
||||
if (fmt === 'flac' && item.filesize) {
|
||||
qualities['flac'] = sizeFormate(item.filesize);
|
||||
qualities['320k'] = sizeFormate(item.filesize);
|
||||
} else if (fmt === 'mp3' && item.filesize) {
|
||||
if (item.bitrate && Number(item.bitrate) >= 320) qualities['320k'] = sizeFormate(item.filesize);
|
||||
else qualities['128k'] = sizeFormate(item.filesize);
|
||||
} else if (item.filesize) {
|
||||
qualities['128k'] = sizeFormate(item.filesize);
|
||||
}
|
||||
var picUrl = item.img || item.cover || '';
|
||||
var songId = item.hash || item.relative_path || item.id || '';
|
||||
return {
|
||||
id: item.relative_path || '',
|
||||
id: String(songId),
|
||||
name: item.title || item.filename || '',
|
||||
artists: item.artist || '未知歌手',
|
||||
source: 'git',
|
||||
@@ -98,10 +129,9 @@ function formatGitItem(item) {
|
||||
mPic: picUrl,
|
||||
sPic: picUrl,
|
||||
albumName: item.album || '未知专辑',
|
||||
albumId: '',
|
||||
interval: '',
|
||||
qualities: qualities,
|
||||
_gitcodeData: item
|
||||
albumId: String(item.albumId || ''),
|
||||
interval: String(formatPlayTime(item.duration) || '--/--'),
|
||||
qualities: qualities
|
||||
};
|
||||
}
|
||||
|
||||
@@ -135,14 +165,14 @@ function search(str, page, limit, retryNum) {
|
||||
}
|
||||
|
||||
// ===== 播放链接 =====
|
||||
function getUrl(songInfo, type) {
|
||||
var q = type || '128k';
|
||||
var songId = songInfo.id || '';
|
||||
function getUrl(songId, quality) {
|
||||
songId = String(songId || '');
|
||||
quality = String(quality || '128k');
|
||||
if (!songId) return Promise.resolve('');
|
||||
var ceruKey = process.env.ceru_key || '';
|
||||
var ceruKey = CERU_KEY || '';
|
||||
var headers = { 'User-Agent': 'QZMusic/2.0' };
|
||||
if (ceruKey) headers['X-API-Key'] = ceruKey;
|
||||
return requestUrl('https://source.shiqianjiang.cn/api/music/url?source=git&songId=' + encodeURIComponent(songId) + '&quality=' + encodeURIComponent(q), 'GET', headers)
|
||||
return requestUrl('https://source.shiqianjiang.cn/api/music/url?source=git&songId=' + encodeURIComponent(songId) + '&quality=' + encodeURIComponent(quality), 'GET', headers)
|
||||
.then(function(res) {
|
||||
if (res.body && typeof res.body === 'object' && res.body.url) return res.body.url;
|
||||
if (res.body && typeof res.body === 'object' && res.body.data && res.body.data.url) return res.body.data.url;
|
||||
@@ -153,14 +183,19 @@ function getUrl(songInfo, type) {
|
||||
|
||||
// ===== 封面图 =====
|
||||
function getPic(songInfo) {
|
||||
if (songInfo.pic) return Promise.resolve(songInfo.pic);
|
||||
if (songInfo && songInfo.pic) return Promise.resolve(songInfo.pic);
|
||||
return Promise.resolve('');
|
||||
}
|
||||
|
||||
// ===== 歌词 =====
|
||||
function getLyric(songInfo) {
|
||||
if (songInfo._gitcodeData && songInfo._gitcodeData.lyrics) return Promise.resolve(songInfo._gitcodeData.lyrics);
|
||||
return Promise.resolve('');
|
||||
var id = (songInfo && songInfo.id) || '';
|
||||
if (!id) return Promise.resolve('');
|
||||
if (cachedLyricMap && cachedLyricMap[id]) return Promise.resolve(cachedLyricMap[id]);
|
||||
return fetchAllGitMusic().then(function() {
|
||||
if (cachedLyricMap && cachedLyricMap[id]) return cachedLyricMap[id];
|
||||
return '';
|
||||
}).catch(function() { return ''; });
|
||||
}
|
||||
|
||||
// ===== 音乐详情 =====
|
||||
@@ -192,18 +227,18 @@ var pluginInfo = {
|
||||
info: {
|
||||
id: 'koneko_ceru_git',
|
||||
name: 'GIT音源 - Koneko 聆澜',
|
||||
version: '0.1.0',
|
||||
version: '0.1.2',
|
||||
source: 'git',
|
||||
description: 'GIT音源,基于 CeruMusic musicSdk 搜索 + Ceru 播放接口'
|
||||
description: 'GIT音源,基于 GitCode audio_database.json 本地搜索 + Ceru 播放接口'
|
||||
},
|
||||
ext: [],
|
||||
env: [{ key: 'ceru_key', name: 'Ceru API Key', description: '聆澜播放接口密钥' }],
|
||||
quality: [
|
||||
{ name: '标准', ui: '标', id: '128k' },
|
||||
{ name: '高品', ui: 'HQ', id: '320k' },
|
||||
{ name: '无损', ui: 'SQ', id: 'flac' }
|
||||
{ name: '标准音质', ui: '标', id: '128k' },
|
||||
{ name: '高品音质', ui: 'HQ', id: '320k' },
|
||||
{ name: '无损音质', ui: 'SQ', id: 'flac' }
|
||||
],
|
||||
supportFunc: []
|
||||
supportFunc: ['search_song', 'search_playlist', 'playlist', 'album', 'lyric']
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
@@ -212,7 +247,7 @@ module.exports = {
|
||||
hotSearch: { getList: hotSearch },
|
||||
leaderboard: { getBoards: leaderboard },
|
||||
songList: songList,
|
||||
artists: singer,
|
||||
singer: singer,
|
||||
album: album,
|
||||
getLyric: getLyric,
|
||||
getPic: getPic,
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
var env = global.env || {};
|
||||
var CERU_KEY = env.ceru_key || '';
|
||||
var https = require('https');
|
||||
var http = require('http');
|
||||
var crypto = require('crypto');
|
||||
@@ -53,6 +56,30 @@ function requestUrl(urlStr, method, headers, body) {
|
||||
return doRequest(protocol, options, postData);
|
||||
}
|
||||
|
||||
// ===== 格式化辅助 =====
|
||||
function formatPlayTime(time) {
|
||||
if (!time) return '--/--';
|
||||
var m = Math.floor(time / 60);
|
||||
var s = Math.floor(time % 60);
|
||||
if (m === 0 && s === 0) return '--/--';
|
||||
return (m < 10 ? '0' + m : m) + ':' + (s < 10 ? '0' + s : s);
|
||||
}
|
||||
|
||||
function sizeFormate(bytes) {
|
||||
if (typeof bytes === 'string') bytes = parseFloat(bytes.replace(/[^0-9.]/g, ''));
|
||||
var n = parseFloat(bytes);
|
||||
if (isNaN(n) || n < 0) return '0.00MB';
|
||||
var mb = n / (1024 * 1024);
|
||||
return mb.toFixed(2) + 'MB';
|
||||
}
|
||||
|
||||
function formatSingerName(arr, key) {
|
||||
if (!arr || !arr.length) return '';
|
||||
var names = [];
|
||||
for (var i = 0; i < arr.length; i++) names.push(arr[i][key] || arr[i]);
|
||||
return names.join('、');
|
||||
}
|
||||
|
||||
// ===== QQ音乐zzcSign =====
|
||||
var PART_1_INDEXES = [23, 14, 6, 36, 16, 40, 7, 19];
|
||||
var PART_2_INDEXES = [16, 1, 32, 12, 19, 27, 8, 5];
|
||||
@@ -102,13 +129,6 @@ function signRequest(data) {
|
||||
}, JSON.stringify(data));
|
||||
}
|
||||
|
||||
function formatPlayTime(seconds) {
|
||||
if (!seconds) return '00:00';
|
||||
var m = Math.floor(seconds / 60);
|
||||
var s = Math.floor(seconds % 60);
|
||||
return (m < 10 ? '0' + m : m) + ':' + (s < 10 ? '0' + s : s);
|
||||
}
|
||||
|
||||
// ===== 搜索实现 =====
|
||||
function musicSearch(str, page, limit) {
|
||||
var body = {
|
||||
@@ -123,26 +143,24 @@ function musicSearch(str, page, limit) {
|
||||
|
||||
function handleSearchResult(rawList) {
|
||||
var list = [];
|
||||
if (!rawList) return list;
|
||||
for (var i = 0; i < rawList.length; i++) {
|
||||
var item = rawList[i];
|
||||
if (!item.file || !item.file.media_mid) continue;
|
||||
var qualities = {};
|
||||
if (item.file.size_128mp3) qualities.standard = String(item.file.size_128mp3);
|
||||
if (item.file.size_320mp3) qualities.exhigh = String(item.file.size_320mp3);
|
||||
if (item.file.size_flac) qualities.lossless = String(item.file.size_flac);
|
||||
if (item.file.size_hires) qualities.hires = String(item.file.size_hires);
|
||||
var file = item.file;
|
||||
if (file.size_128mp3) qualities['128k'] = sizeFormate(file.size_128mp3);
|
||||
if (file.size_320mp3) qualities['320k'] = sizeFormate(file.size_320mp3);
|
||||
if (file.size_flac) qualities['flac'] = sizeFormate(file.size_flac);
|
||||
var albumId = '';
|
||||
var albumName = '';
|
||||
if (item.album) { albumName = item.album.name; albumId = item.album.mid; }
|
||||
var singerName = '';
|
||||
if (item.singer && item.singer.length) {
|
||||
var ns = [];
|
||||
for (var j = 0; j < item.singer.length; j++) ns.push(item.singer[j].name);
|
||||
singerName = ns.join('、');
|
||||
}
|
||||
var picUrl = albumId ? 'https://y.gtimg.cn/music/photo_new/T002R500x500M000' + albumId + '.jpg' : (item.singer && item.singer.length ? 'https://y.gtimg.cn/music/photo_new/T001R500x500M000' + item.singer[0].mid + '.jpg' : '');
|
||||
var singerName = formatSingerName(item.singer, 'name');
|
||||
var picUrl = albumId && albumId !== '空'
|
||||
? 'https://y.gtimg.cn/music/photo_new/T002R500x500M000' + albumId + '.jpg'
|
||||
: (item.singer && item.singer.length ? 'https://y.gtimg.cn/music/photo_new/T001R500x500M000' + item.singer[0].mid + '.jpg' : '');
|
||||
list.push({
|
||||
id: item.mid,
|
||||
id: String(item.mid),
|
||||
name: item.name + (item.title_extra || ''),
|
||||
artists: singerName,
|
||||
source: 'tx',
|
||||
@@ -150,8 +168,8 @@ function handleSearchResult(rawList) {
|
||||
mPic: picUrl,
|
||||
sPic: picUrl,
|
||||
albumName: albumName,
|
||||
albumId: albumId,
|
||||
interval: formatPlayTime(item.interval),
|
||||
albumId: String(albumId || ''),
|
||||
interval: String(formatPlayTime(item.interval) || '--/--'),
|
||||
qualities: qualities
|
||||
});
|
||||
}
|
||||
@@ -172,13 +190,13 @@ function search(str, page, limit, retryNum) {
|
||||
}
|
||||
|
||||
// ===== 播放链接 =====
|
||||
function getUrl(songInfo, type) {
|
||||
var q = type || '128k';
|
||||
var songId = songInfo.id || '';
|
||||
var ceruKey = process.env.ceru_key || '';
|
||||
function getUrl(songId, quality) {
|
||||
songId = String(songId || '');
|
||||
quality = String(quality || '128k');
|
||||
var ceruKey = CERU_KEY || '';
|
||||
var headers = { 'User-Agent': 'QZMusic/2.0' };
|
||||
if (ceruKey) headers['X-API-Key'] = ceruKey;
|
||||
return requestUrl('https://source.shiqianjiang.cn/api/music/url?source=tx&songId=' + encodeURIComponent(songId) + '&quality=' + encodeURIComponent(q), 'GET', headers)
|
||||
return requestUrl('https://source.shiqianjiang.cn/api/music/url?source=tx&songId=' + encodeURIComponent(songId) + '&quality=' + encodeURIComponent(quality), 'GET', headers)
|
||||
.then(function(res) {
|
||||
if (res.body && typeof res.body === 'object' && res.body.url) return res.body.url;
|
||||
if (res.body && typeof res.body === 'object' && res.body.data && res.body.data.url) return res.body.data.url;
|
||||
@@ -189,15 +207,15 @@ function getUrl(songInfo, type) {
|
||||
|
||||
// ===== 封面图 =====
|
||||
function getPic(songInfo) {
|
||||
if (songInfo.pic) return Promise.resolve(songInfo.pic);
|
||||
var albumId = songInfo.albumId || '';
|
||||
if (songInfo && songInfo.pic) return Promise.resolve(songInfo.pic);
|
||||
var albumId = songInfo && songInfo.albumId ? String(songInfo.albumId) : '';
|
||||
if (albumId) return Promise.resolve('https://y.gtimg.cn/music/photo_new/T002R500x500M000' + albumId + '.jpg');
|
||||
return Promise.resolve('');
|
||||
}
|
||||
|
||||
// ===== 歌词 =====
|
||||
function getLyric(songInfo) {
|
||||
var songmid = songInfo.id || '';
|
||||
var songmid = (songInfo && songInfo.id) || (songInfo && songInfo.songId) || '';
|
||||
return requestUrl('https://c.y.qq.com/lyric/fcgi-bin/fcg_query_lyric_new.fcg?format=json&nobase64=1&songmid=' + encodeURIComponent(songmid), 'GET', {
|
||||
'User-Agent': 'Mozilla/5.0 (Linux; Android 10)',
|
||||
'Referer': 'https://y.qq.com/portal/player.html'
|
||||
@@ -220,11 +238,10 @@ function musicDetail(songmid) {
|
||||
if (res.body && res.body.req && res.body.req.data && res.body.req.data.info && res.body.req.data.info.track_info) {
|
||||
var t = res.body.req.data.info.track_info;
|
||||
var albumId = t.album ? t.album.mid : '';
|
||||
var singerName = '';
|
||||
if (t.singer && t.singer.length) { var ns = []; for (var j = 0; j < t.singer.length; j++) ns.push(t.singer[j].name); singerName = ns.join('、'); }
|
||||
var singerName = formatSingerName(t.singer, 'name');
|
||||
var picUrl = albumId ? 'https://y.gtimg.cn/music/photo_new/T002R500x500M000' + albumId + '.jpg' : '';
|
||||
return {
|
||||
id: t.mid,
|
||||
id: String(t.mid),
|
||||
name: t.name,
|
||||
artists: singerName,
|
||||
source: 'tx',
|
||||
@@ -232,8 +249,8 @@ function musicDetail(songmid) {
|
||||
mPic: picUrl,
|
||||
sPic: picUrl,
|
||||
albumName: t.album ? t.album.name : '',
|
||||
albumId: albumId,
|
||||
interval: formatPlayTime(t.interval),
|
||||
albumId: String(albumId || ''),
|
||||
interval: String(formatPlayTime(t.interval) || '--/--'),
|
||||
qualities: {}
|
||||
};
|
||||
}
|
||||
@@ -293,18 +310,18 @@ var pluginInfo = {
|
||||
info: {
|
||||
id: 'koneko_ceru_tx',
|
||||
name: 'QQ音乐 - Koneko 聆澜',
|
||||
version: '0.1.0',
|
||||
version: '0.1.2',
|
||||
source: 'tx',
|
||||
description: 'QQ音乐音源,基于 CeruMusic musicSdk 搜索 + Ceru 播放接口'
|
||||
},
|
||||
ext: [],
|
||||
env: [{ key: 'ceru_key', name: 'Ceru API Key', description: '聆澜播放接口密钥' }],
|
||||
quality: [
|
||||
{ name: '标准', ui: '标', id: '128k' },
|
||||
{ name: '高品', ui: 'HQ', id: '320k' },
|
||||
{ name: '无损', ui: 'SQ', id: 'flac' }
|
||||
{ name: '标准音质', ui: '标', id: '128k' },
|
||||
{ name: '高品音质', ui: 'HQ', id: '320k' },
|
||||
{ name: '无损音质', ui: 'SQ', id: 'flac' }
|
||||
],
|
||||
supportFunc: []
|
||||
supportFunc: ['search_song', 'search_playlist', 'playlist', 'album', 'lyric']
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
@@ -313,7 +330,7 @@ module.exports = {
|
||||
hotSearch: { getList: hotSearch },
|
||||
leaderboard: { getBoards: leaderboard },
|
||||
songList: songList,
|
||||
artists: singer,
|
||||
singer: singer,
|
||||
album: album,
|
||||
getLyric: getLyric,
|
||||
getPic: getPic,
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
var env = global.env || {};
|
||||
var CERU_KEY = env.ceru_key || '';
|
||||
var https = require('https');
|
||||
var http = require('http');
|
||||
var crypto = require('crypto');
|
||||
@@ -53,13 +56,23 @@ function requestUrl(urlStr, method, headers, body) {
|
||||
return doRequest(protocol, options, postData);
|
||||
}
|
||||
|
||||
function formatPlayTime(seconds) {
|
||||
if (!seconds) return '00:00';
|
||||
var m = Math.floor(seconds / 60);
|
||||
var s = Math.floor(seconds % 60);
|
||||
// ===== 格式化辅助 =====
|
||||
function formatPlayTime(time) {
|
||||
if (!time) return '--/--';
|
||||
var m = Math.floor(time / 60);
|
||||
var s = Math.floor(time % 60);
|
||||
if (m === 0 && s === 0) return '--/--';
|
||||
return (m < 10 ? '0' + m : m) + ':' + (s < 10 ? '0' + s : s);
|
||||
}
|
||||
|
||||
function sizeFormate(bytes) {
|
||||
if (typeof bytes === 'string') bytes = parseFloat(bytes.replace(/[^0-9.]/g, ''));
|
||||
var n = parseFloat(bytes);
|
||||
if (isNaN(n) || n < 0) return '0.00MB';
|
||||
var mb = n / (1024 * 1024);
|
||||
return mb.toFixed(2) + 'MB';
|
||||
}
|
||||
|
||||
// ===== 搜索实现 =====
|
||||
function musicSearch(str, page, limit) {
|
||||
var url = 'https://jadeite.migu.cn/music_search/v3/search?text=' + encodeURIComponent(str) + '&pageNo=' + page + '&pageSize=' + limit + '&searchSwitch={"song":1}';
|
||||
@@ -75,21 +88,24 @@ function musicSearch(str, page, limit) {
|
||||
|
||||
function handleSearchResult(rawList) {
|
||||
var list = [];
|
||||
if (!rawList) return list;
|
||||
for (var i = 0; i < rawList.length; i++) {
|
||||
var item = rawList[i];
|
||||
var qualities = {};
|
||||
if (item.newRateFormats) {
|
||||
for (var j = 0; j < item.newRateFormats.length; j++) {
|
||||
var fmt = item.newRateFormats[j];
|
||||
if (fmt.formatType === 'SQ' && fmt.size) qualities.lossless = String(fmt.size);
|
||||
if (fmt.formatType === 'HQ' && fmt.size) qualities.exhigh = String(fmt.size);
|
||||
if (fmt.formatType === 'LQ' && fmt.size) qualities.standard = String(fmt.size);
|
||||
if (fmt.formatType === 'LQ' && fmt.size) qualities['128k'] = sizeFormate(fmt.size);
|
||||
if (fmt.formatType === 'HQ' && fmt.size) qualities['320k'] = sizeFormate(fmt.size);
|
||||
if (fmt.formatType === 'SQ' && fmt.size) qualities['flac'] = sizeFormate(fmt.size);
|
||||
}
|
||||
}
|
||||
var picUrl = item.img || (item.albumImgs && item.albumImgs.length ? item.albumImgs[0].img : '');
|
||||
if (picUrl && picUrl.startsWith('/')) picUrl = 'https://d.musicapp.migu.cn' + picUrl;
|
||||
if (picUrl && picUrl.indexOf('/') === 0) picUrl = 'https://d.musicapp.migu.cn' + picUrl;
|
||||
var intervalStr = item.length ? String(item.length).replace(/.*(\d\d:\d\d)$/, '$1') : '--/--';
|
||||
if (!intervalStr) intervalStr = '--/--';
|
||||
list.push({
|
||||
id: item.copyrightId || item.id || '',
|
||||
id: String(item.copyrightId || item.id || ''),
|
||||
name: item.title || item.songName || '',
|
||||
artists: item.artist || item.singerName || '',
|
||||
source: 'mg',
|
||||
@@ -97,8 +113,8 @@ function handleSearchResult(rawList) {
|
||||
mPic: picUrl,
|
||||
sPic: picUrl,
|
||||
albumName: item.album || item.albumName || '',
|
||||
albumId: item.albumId || '',
|
||||
interval: item.length ? item.length.replace(/.*(\d\d:\d\d)$/, '$1') : '',
|
||||
albumId: String(item.albumId || ''),
|
||||
interval: intervalStr,
|
||||
qualities: qualities
|
||||
});
|
||||
}
|
||||
@@ -116,13 +132,13 @@ function search(str, page, limit, retryNum) {
|
||||
}
|
||||
|
||||
// ===== 播放链接 =====
|
||||
function getUrl(songInfo, type) {
|
||||
var q = type || '128k';
|
||||
var songId = songInfo.id || '';
|
||||
var ceruKey = process.env.ceru_key || '';
|
||||
function getUrl(songId, quality) {
|
||||
songId = String(songId || '');
|
||||
quality = String(quality || '128k');
|
||||
var ceruKey = CERU_KEY || '';
|
||||
var headers = { 'User-Agent': 'QZMusic/2.0' };
|
||||
if (ceruKey) headers['X-API-Key'] = ceruKey;
|
||||
return requestUrl('https://source.shiqianjiang.cn/api/music/url?source=mg&songId=' + encodeURIComponent(songId) + '&quality=' + encodeURIComponent(q), 'GET', headers)
|
||||
return requestUrl('https://source.shiqianjiang.cn/api/music/url?source=mg&songId=' + encodeURIComponent(songId) + '&quality=' + encodeURIComponent(quality), 'GET', headers)
|
||||
.then(function(res) {
|
||||
if (res.body && typeof res.body === 'object' && res.body.url) return res.body.url;
|
||||
if (res.body && typeof res.body === 'object' && res.body.data && res.body.data.url) return res.body.data.url;
|
||||
@@ -133,13 +149,13 @@ function getUrl(songInfo, type) {
|
||||
|
||||
// ===== 封面图 =====
|
||||
function getPic(songInfo) {
|
||||
if (songInfo.pic) return Promise.resolve(songInfo.pic);
|
||||
if (songInfo && songInfo.pic) return Promise.resolve(songInfo.pic);
|
||||
return Promise.resolve('');
|
||||
}
|
||||
|
||||
// ===== 歌词 =====
|
||||
function getLyric(songInfo) {
|
||||
var copyrightId = songInfo.id || '';
|
||||
var copyrightId = (songInfo && songInfo.id) || '';
|
||||
if (!copyrightId) return Promise.resolve('');
|
||||
return requestUrl('http://music.migu.cn/v3/api/music/audioPlayer/getLyric?copyrightId=' + encodeURIComponent(copyrightId), 'GET', {
|
||||
'User-Agent': 'Mozilla/5.0 (Linux; Android 10)',
|
||||
@@ -179,18 +195,18 @@ var pluginInfo = {
|
||||
info: {
|
||||
id: 'koneko_ceru_mg',
|
||||
name: '咪咕音乐 - Koneko 聆澜',
|
||||
version: '0.1.0',
|
||||
version: '0.1.2',
|
||||
source: 'mg',
|
||||
description: '咪咕音乐音源,基于 CeruMusic musicSdk 搜索 + Ceru 播放接口'
|
||||
},
|
||||
ext: [],
|
||||
env: [{ key: 'ceru_key', name: 'Ceru API Key', description: '聆澜播放接口密钥' }],
|
||||
quality: [
|
||||
{ name: '标准', ui: '标', id: '128k' },
|
||||
{ name: '高品', ui: 'HQ', id: '320k' },
|
||||
{ name: '无损', ui: 'SQ', id: 'flac' }
|
||||
{ name: '标准音质', ui: '标', id: '128k' },
|
||||
{ name: '高品音质', ui: 'HQ', id: '320k' },
|
||||
{ name: '无损音质', ui: 'SQ', id: 'flac' }
|
||||
],
|
||||
supportFunc: []
|
||||
supportFunc: ['search_song', 'search_playlist', 'playlist', 'album', 'lyric']
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
@@ -199,7 +215,7 @@ module.exports = {
|
||||
hotSearch: { getList: hotSearch },
|
||||
leaderboard: { getBoards: leaderboard },
|
||||
songList: songList,
|
||||
artists: singer,
|
||||
singer: singer,
|
||||
album: album,
|
||||
getLyric: getLyric,
|
||||
getPic: getPic,
|
||||
@@ -1,362 +0,0 @@
|
||||
var https = require('https');
|
||||
var http = require('http');
|
||||
var crypto = require('crypto');
|
||||
var querystring = require('querystring');
|
||||
|
||||
// ===== 通用HTTP请求 =====
|
||||
function doRequest(protocol, options, postData) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
var client = protocol === 'https' ? https : http;
|
||||
var req = client.request(options, function(res) {
|
||||
var chunks = [];
|
||||
res.on('data', function(chunk) { chunks.push(chunk); });
|
||||
res.on('end', function() {
|
||||
var buf = Buffer.concat(chunks);
|
||||
var body;
|
||||
try {
|
||||
body = JSON.parse(buf.toString('utf8'));
|
||||
} catch (e) {
|
||||
body = buf.toString('utf8');
|
||||
}
|
||||
resolve({ body: body, statusCode: res.statusCode, headers: res.headers });
|
||||
});
|
||||
});
|
||||
req.on('error', function(err) { reject(err); });
|
||||
req.setTimeout(15000, function() { req.destroy(); reject(new Error('timeout')); });
|
||||
if (postData) req.write(postData);
|
||||
req.end();
|
||||
});
|
||||
}
|
||||
|
||||
function requestUrl(urlStr, method, headers, body) {
|
||||
var parsed = new URL(urlStr);
|
||||
var protocol = parsed.protocol.replace(':', '');
|
||||
var options = {
|
||||
hostname: parsed.hostname,
|
||||
port: parsed.port || (protocol === 'https' ? 443 : 80),
|
||||
path: parsed.pathname + parsed.search,
|
||||
method: method || 'GET',
|
||||
headers: headers || {}
|
||||
};
|
||||
var postData = null;
|
||||
if (body) {
|
||||
if (typeof body === 'string') {
|
||||
postData = Buffer.from(body, 'utf8');
|
||||
} else if (Buffer.isBuffer(body)) {
|
||||
postData = body;
|
||||
} else {
|
||||
postData = Buffer.from(JSON.stringify(body), 'utf8');
|
||||
if (!options.headers['Content-Type']) options.headers['Content-Type'] = 'application/json';
|
||||
}
|
||||
if (postData) options.headers['Content-Length'] = postData.length;
|
||||
}
|
||||
return doRequest(protocol, options, postData);
|
||||
}
|
||||
|
||||
// ===== 网易云eapi加密 =====
|
||||
var EAPI_KEY = 'e82ckenh8dichen8';
|
||||
function aesEncryptEapi(text) {
|
||||
var cipher = crypto.createCipheriv('aes-128-ecb', EAPI_KEY, '');
|
||||
var encrypted = cipher.update(text, 'utf8', 'base64');
|
||||
encrypted += cipher.final('base64');
|
||||
return encrypted;
|
||||
}
|
||||
function eapi(url, params) {
|
||||
var payload = JSON.stringify({
|
||||
method: 'POST',
|
||||
url: url,
|
||||
params: params
|
||||
});
|
||||
return { params: aesEncryptEapi(payload) };
|
||||
}
|
||||
|
||||
// ===== weapi加密(简化版,用于歌词等) =====
|
||||
var WEAPI_IV = '0102030405060708';
|
||||
var WEAPI_PRESET_KEY = '0CoJUm6Qyw8W8jud';
|
||||
var WEAPI_RSA_PUBKEY = '010001';
|
||||
var WEAPI_RSA_MODULUS = '00e0b509f6259df8642dbc35662901477df22677ec152b5ff68ace615bb7b725152b3ab17a876aea8a5aa76d2e417629ec4ee341f56135fccf695280104e0312ecbda92557c93870114af6c9d05c4f7f0c3685b7a46bee255932575cce10b424d813cfe4875d3e82047b97ddef52741d546b8e289dc6935b3ece0462db0a22b8e7';
|
||||
function aesEncryptWeapi(text, key) {
|
||||
var cipher = crypto.createCipheriv('aes-128-cbc', key, WEAPI_IV);
|
||||
var encrypted = cipher.update(text, 'utf8', 'base64');
|
||||
encrypted += cipher.final('base64');
|
||||
return encrypted;
|
||||
}
|
||||
function rsaEncryptWeapi(text) {
|
||||
var reversed = text.split('').reverse().join('');
|
||||
var input = Buffer.from(reversed, 'utf8').toString('hex');
|
||||
var bigInput = BigInt('0x' + input);
|
||||
var bigExp = BigInt('0x' + WEAPI_RSA_PUBKEY);
|
||||
var bigMod = BigInt('0x' + WEAPI_RSA_MODULUS);
|
||||
var bigResult = 1n;
|
||||
var e = bigExp;
|
||||
var b = bigInput;
|
||||
while (e > 0n) {
|
||||
if (e % 2n === 1n) bigResult = (bigResult * b) % bigMod;
|
||||
b = (b * b) % bigMod;
|
||||
e = e / 2n;
|
||||
}
|
||||
var result = bigResult.toString(16).padStart(256, '0');
|
||||
return result;
|
||||
}
|
||||
function weapi(params) {
|
||||
var text = JSON.stringify(params);
|
||||
var secretKey = '';
|
||||
for (var i = 0; i < 16; i++) secretKey += String.fromCharCode(97 + Math.floor(Math.random() * 25));
|
||||
var encrypted = aesEncryptWeapi(aesEncryptWeapi(text, WEAPI_PRESET_KEY), secretKey);
|
||||
var encSecKey = rsaEncryptWeapi(secretKey);
|
||||
return { params: encrypted, encSecKey: encSecKey };
|
||||
}
|
||||
|
||||
// ===== 格式化辅助 =====
|
||||
function formatPlayTime(seconds) {
|
||||
var m = Math.floor(seconds / 60);
|
||||
var s = Math.floor(seconds % 60);
|
||||
return (m < 10 ? '0' + m : m) + ':' + (s < 10 ? '0' + s : s);
|
||||
}
|
||||
|
||||
function formatSingerName(arr, key) {
|
||||
if (!arr || !arr.length) return '';
|
||||
var names = [];
|
||||
for (var i = 0; i < arr.length; i++) names.push(arr[i][key] || arr[i]);
|
||||
return names.join('、');
|
||||
}
|
||||
|
||||
// ===== 搜索实现 =====
|
||||
function musicSearch(str, page, limit) {
|
||||
var form = eapi('/api/search/song/list/page', {
|
||||
keyword: str,
|
||||
needCorrect: '1',
|
||||
channel: 'typing',
|
||||
offset: limit * (page - 1),
|
||||
scene: 'normal',
|
||||
total: page == 1,
|
||||
limit: limit
|
||||
});
|
||||
return requestUrl('http://interface3.music.163.com/eapi/search/song/list/page', 'POST', {
|
||||
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36',
|
||||
'Origin': 'https://music.163.com',
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}, querystring.stringify(form)).then(function(res) {
|
||||
return res.body;
|
||||
});
|
||||
}
|
||||
|
||||
function handleSearchResult(rawList) {
|
||||
if (!rawList) return [];
|
||||
var list = [];
|
||||
for (var i = 0; i < rawList.length; i++) {
|
||||
var item = rawList[i];
|
||||
if (!item.baseInfo || !item.baseInfo.simpleSongData) continue;
|
||||
var s = item.baseInfo.simpleSongData;
|
||||
var qualities = {};
|
||||
if (s.l && s.l.size) qualities.standard = String(s.l.size);
|
||||
if (s.m && s.m.size) qualities.standard = String(s.m.size);
|
||||
if (s.h && s.h.size) qualities.exhigh = String(s.h.size);
|
||||
if (s.sq && s.sq.size) qualities.lossless = String(s.sq.size);
|
||||
if (s.hr && s.hr.size) qualities.hires = String(s.hr.size);
|
||||
var picUrl = s.al && s.al.picUrl ? s.al.picUrl : '';
|
||||
list.push({
|
||||
id: s.id,
|
||||
name: s.name,
|
||||
artists: formatSingerName(s.ar, 'name'),
|
||||
source: 'wy',
|
||||
pic: picUrl,
|
||||
mPic: picUrl,
|
||||
sPic: picUrl,
|
||||
albumName: s.al && s.al.name ? s.al.name : '',
|
||||
albumId: s.al && s.al.id ? s.al.id : '',
|
||||
interval: formatPlayTime((s.dt || 0) / 1000),
|
||||
qualities: qualities
|
||||
});
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
function search(str, page, limit, retryNum) {
|
||||
if (retryNum === undefined) retryNum = 0;
|
||||
if (++retryNum > 3) return Promise.reject(new Error('try max num'));
|
||||
if (!limit) limit = 30;
|
||||
return musicSearch(str, page, limit).then(function(result) {
|
||||
if (!result || result.code !== 200) return search(str, page, limit, retryNum);
|
||||
var list = handleSearchResult(result.data && result.data.resources ? result.data.resources : []);
|
||||
if (!list || list.length === 0) return search(str, page, limit, retryNum);
|
||||
var total = result.data && result.data.totalCount ? result.data.totalCount : 0;
|
||||
return {
|
||||
list: list,
|
||||
allPage: Math.ceil(total / limit),
|
||||
limit: limit,
|
||||
total: total,
|
||||
source: 'wy'
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
// ===== 播放链接 =====
|
||||
function getUrl(songInfo, type) {
|
||||
var q = type || '128k';
|
||||
var songId = songInfo.id || '';
|
||||
var ceruKey = process.env.ceru_key || '';
|
||||
var headers = { 'User-Agent': 'QZMusic/2.0' };
|
||||
if (ceruKey) headers['X-API-Key'] = ceruKey;
|
||||
return requestUrl('https://source.shiqianjiang.cn/api/music/url?source=wy&songId=' + encodeURIComponent(songId) + '&quality=' + encodeURIComponent(q), 'GET', headers)
|
||||
.then(function(res) {
|
||||
if (res.body && typeof res.body === 'object' && res.body.url) return res.body.url;
|
||||
if (res.body && typeof res.body === 'object' && res.body.data && res.body.data.url) return res.body.data.url;
|
||||
if (typeof res.body === 'string' && res.body.indexOf('http') === 0) return res.body;
|
||||
return '';
|
||||
})
|
||||
.catch(function() { return ''; });
|
||||
}
|
||||
|
||||
// ===== 封面图 =====
|
||||
function getPic(songInfo) {
|
||||
if (songInfo.pic) return Promise.resolve(songInfo.pic);
|
||||
return requestUrl('https://music.163.com/weapi/v3/song/detail', 'POST', {
|
||||
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36',
|
||||
'Referer': 'https://music.163.com/song?id=' + songInfo.id,
|
||||
'Origin': 'https://music.163.com',
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}, querystring.stringify(weapi({ c: '[{"id":' + songInfo.id + '}]', ids: '[' + songInfo.id + ']' })))
|
||||
.then(function(res) {
|
||||
if (res.body && res.body.songs && res.body.songs.length) return res.body.songs[0].al.picUrl;
|
||||
return '';
|
||||
})
|
||||
.catch(function() { return ''; });
|
||||
}
|
||||
|
||||
// ===== 歌词 =====
|
||||
function getLyric(songInfo) {
|
||||
var songmid = songInfo.id || '';
|
||||
return requestUrl('https://music.163.com/api/song/lyric?id=' + songmid + '&lv=1&kv=1&tv=-1', 'GET', {
|
||||
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36',
|
||||
'Referer': 'https://music.163.com/song?id=' + songmid
|
||||
}).then(function(res) {
|
||||
if (res.body && res.body.lrc && res.body.lrc.lyric) return res.body.lrc.lyric;
|
||||
return '';
|
||||
}).catch(function() { return ''; });
|
||||
}
|
||||
|
||||
// ===== 音乐详情 =====
|
||||
function musicDetail(songmid) {
|
||||
return requestUrl('https://music.163.com/weapi/v3/song/detail', 'POST', {
|
||||
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36',
|
||||
'Origin': 'https://music.163.com',
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}, querystring.stringify(weapi({ c: '[{"id":' + songmid + '}]', ids: '[' + songmid + ']' })))
|
||||
.then(function(res) {
|
||||
if (res.body && res.body.songs && res.body.songs.length) {
|
||||
var s = res.body.songs[0];
|
||||
var picUrl = s.al && s.al.picUrl ? s.al.picUrl : '';
|
||||
return {
|
||||
id: s.id,
|
||||
name: s.name,
|
||||
artists: formatSingerName(s.ar, 'name'),
|
||||
source: 'wy',
|
||||
pic: picUrl,
|
||||
mPic: picUrl,
|
||||
sPic: picUrl,
|
||||
albumName: s.al && s.al.name ? s.al.name : '',
|
||||
albumId: s.al && s.al.id ? s.al.id : '',
|
||||
interval: formatPlayTime((s.dt || 0) / 1000),
|
||||
qualities: {}
|
||||
};
|
||||
}
|
||||
return null;
|
||||
})
|
||||
.catch(function() { return null; });
|
||||
}
|
||||
|
||||
function musicInfo(songmid) {
|
||||
return musicDetail(songmid);
|
||||
}
|
||||
|
||||
// ===== 热搜 =====
|
||||
function hotSearch() {
|
||||
return requestUrl('https://music.163.com/weapi/search/hot', 'POST', {
|
||||
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36',
|
||||
'Origin': 'https://music.163.com',
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}, querystring.stringify(weapi({ type: 1111 })))
|
||||
.then(function(res) {
|
||||
var list = [];
|
||||
if (res.body && res.body.result && res.body.result.hots) {
|
||||
for (var i = 0; i < res.body.result.hots.length; i++) list.push(res.body.result.hots[i].first);
|
||||
}
|
||||
return { source: 'wy', list: list };
|
||||
})
|
||||
.catch(function() { return { source: 'wy', list: [] }; });
|
||||
}
|
||||
|
||||
// ===== 搜索建议 =====
|
||||
function tipSearch(str) {
|
||||
return requestUrl('https://music.163.com/weapi/search/suggest/web', 'POST', {
|
||||
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36',
|
||||
'Origin': 'https://music.163.com',
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}, querystring.stringify(weapi({ s: str, limit: 10 })))
|
||||
.then(function(res) {
|
||||
var result = { order: [], songs: [], artists: [], albums: [], playlists: [] };
|
||||
if (res.body && res.body.result) {
|
||||
var r = res.body.result;
|
||||
if (r.songs) { result.order.push('songs'); result.songs = r.songs.map(function(s) { return { name: s.name, id: s.id, source: 'wy' }; }); }
|
||||
if (r.artists) { result.order.push('artists'); result.artists = r.artists.map(function(a) { return { name: a.name, id: a.id, source: 'wy' }; }); }
|
||||
}
|
||||
return result;
|
||||
})
|
||||
.catch(function() { return { order: [], songs: [], artists: [], albums: [], playlists: [] }; });
|
||||
}
|
||||
|
||||
// ===== 榜单 =====
|
||||
function leaderboard() {
|
||||
return Promise.resolve([]);
|
||||
}
|
||||
|
||||
// ===== 歌单 =====
|
||||
function songList() {
|
||||
return Promise.resolve({ list: [], total: 0, page: 1, source: 'wy' });
|
||||
}
|
||||
|
||||
// ===== 歌手 =====
|
||||
function singer() {
|
||||
return Promise.resolve({ source: 'wy', list: [], total: 0 });
|
||||
}
|
||||
|
||||
// ===== 专辑 =====
|
||||
function album() {
|
||||
return Promise.resolve({ source: 'wy', list: [], total: 0 });
|
||||
}
|
||||
|
||||
// ===== 插件信息 =====
|
||||
var pluginInfo = {
|
||||
info: {
|
||||
id: 'koneko_ceru_wy',
|
||||
name: '网易云音乐 - Koneko 聆澜',
|
||||
version: '0.1.0',
|
||||
source: 'wy',
|
||||
description: '网易云音乐音源,基于 CeruMusic musicSdk 搜索 + Ceru 播放接口'
|
||||
},
|
||||
ext: [],
|
||||
env: [{ key: 'ceru_key', name: 'Ceru API Key', description: '聆澜播放接口密钥' }],
|
||||
quality: [
|
||||
{ name: '标准', ui: '标', id: '128k' },
|
||||
{ name: '高品', ui: 'HQ', id: '320k' },
|
||||
{ name: '无损', ui: 'SQ', id: 'flac' }
|
||||
],
|
||||
supportFunc: []
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
musicSearch: { search: search },
|
||||
tipSearch: { search: tipSearch },
|
||||
hotSearch: { getList: hotSearch },
|
||||
leaderboard: { getBoards: leaderboard },
|
||||
songList: songList,
|
||||
artists: singer,
|
||||
album: album,
|
||||
getLyric: getLyric,
|
||||
getPic: getPic,
|
||||
getUrl: getUrl,
|
||||
musicDetail: musicDetail,
|
||||
musicInfo: musicInfo,
|
||||
pluginInfo: pluginInfo
|
||||
};
|
||||
661
聆澜/Koneko_聆澜_网易云音乐_v0.1.2_QZv2.js
Normal file
661
聆澜/Koneko_聆澜_网易云音乐_v0.1.2_QZv2.js
Normal file
@@ -0,0 +1,661 @@
|
||||
|
||||
var env = global.env || {};
|
||||
var CERU_KEY = env.ceru_key || '';
|
||||
var WY_COOKIE = env.cookie || '';
|
||||
var https = require('https');
|
||||
var http = require('http');
|
||||
var crypto = require('crypto');
|
||||
var querystring = require('querystring');
|
||||
|
||||
// ===== 通用HTTP请求 =====
|
||||
function doRequest(protocol, options, postData) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
var client = protocol === 'https' ? https : http;
|
||||
var req = client.request(options, function(res) {
|
||||
var chunks = [];
|
||||
res.on('data', function(chunk) { chunks.push(chunk); });
|
||||
res.on('end', function() {
|
||||
var buf = Buffer.concat(chunks);
|
||||
var body;
|
||||
try {
|
||||
body = JSON.parse(buf.toString('utf8'));
|
||||
} catch (e) {
|
||||
body = buf.toString('utf8');
|
||||
}
|
||||
resolve({ body: body, statusCode: res.statusCode, headers: res.headers });
|
||||
});
|
||||
});
|
||||
req.on('error', function(err) { reject(err); });
|
||||
req.setTimeout(15000, function() { req.destroy(); reject(new Error('timeout')); });
|
||||
if (postData) req.write(postData);
|
||||
req.end();
|
||||
});
|
||||
}
|
||||
|
||||
function requestUrl(urlStr, method, headers, body) {
|
||||
var parsed = new URL(urlStr);
|
||||
var protocol = parsed.protocol.replace(':', '');
|
||||
var options = {
|
||||
hostname: parsed.hostname,
|
||||
port: parsed.port || (protocol === 'https' ? 443 : 80),
|
||||
path: parsed.pathname + parsed.search,
|
||||
method: method || 'GET',
|
||||
headers: headers || {}
|
||||
};
|
||||
var postData = null;
|
||||
if (body) {
|
||||
if (typeof body === 'string') {
|
||||
postData = Buffer.from(body, 'utf8');
|
||||
} else if (Buffer.isBuffer(body)) {
|
||||
postData = body;
|
||||
} else {
|
||||
postData = Buffer.from(JSON.stringify(body), 'utf8');
|
||||
if (!options.headers['Content-Type']) options.headers['Content-Type'] = 'application/json';
|
||||
}
|
||||
if (postData) options.headers['Content-Length'] = postData.length;
|
||||
}
|
||||
return doRequest(protocol, options, postData);
|
||||
}
|
||||
|
||||
// ===== 网易云eapi加密 =====
|
||||
var EAPI_KEY = 'e82ckenh8dichen8';
|
||||
function aesEncryptEapi(text) {
|
||||
var cipher = crypto.createCipheriv('aes-128-ecb', EAPI_KEY, '');
|
||||
var encrypted = cipher.update(text, 'utf8', 'base64');
|
||||
encrypted += cipher.final('base64');
|
||||
return encrypted;
|
||||
}
|
||||
function eapi(url, params) {
|
||||
var payload = JSON.stringify({
|
||||
method: 'POST',
|
||||
url: url,
|
||||
params: params
|
||||
});
|
||||
return { params: aesEncryptEapi(payload) };
|
||||
}
|
||||
|
||||
// ===== weapi加密(简化版,用于歌词等) =====
|
||||
var WEAPI_IV = '0102030405060708';
|
||||
var WEAPI_PRESET_KEY = '0CoJUm6Qyw8W8jud';
|
||||
var WEAPI_RSA_PUBKEY = '010001';
|
||||
var WEAPI_RSA_MODULUS = '00e0b509f6259df8642dbc35662901477df22677ec152b5ff68ace615bb7b725152b3ab17a876aea8a5aa76d2e417629ec4ee341f56135fccf695280104e0312ecbda92557c93870114af6c9d05c4f7f0c3685b7a46bee255932575cce10b424d813cfe4875d3e82047b97ddef52741d546b8e289dc6935b3ece0462db0a22b8e7';
|
||||
function aesEncryptWeapi(text, key) {
|
||||
var cipher = crypto.createCipheriv('aes-128-cbc', key, WEAPI_IV);
|
||||
var encrypted = cipher.update(text, 'utf8', 'base64');
|
||||
encrypted += cipher.final('base64');
|
||||
return encrypted;
|
||||
}
|
||||
function rsaEncryptWeapi(text) {
|
||||
var reversed = text.split('').reverse().join('');
|
||||
var input = Buffer.from(reversed, 'utf8').toString('hex');
|
||||
var bigInput = BigInt('0x' + input);
|
||||
var bigExp = BigInt('0x' + WEAPI_RSA_PUBKEY);
|
||||
var bigMod = BigInt('0x' + WEAPI_RSA_MODULUS);
|
||||
var bigResult = 1n;
|
||||
var e = bigExp;
|
||||
var b = bigInput;
|
||||
while (e > 0n) {
|
||||
if (e % 2n === 1n) bigResult = (bigResult * b) % bigMod;
|
||||
b = (b * b) % bigMod;
|
||||
e = e / 2n;
|
||||
}
|
||||
var result = bigResult.toString(16).padStart(256, '0');
|
||||
return result;
|
||||
}
|
||||
function weapi(params) {
|
||||
var text = JSON.stringify(params);
|
||||
var secretKey = '';
|
||||
for (var i = 0; i < 16; i++) secretKey += String.fromCharCode(97 + Math.floor(Math.random() * 25));
|
||||
var encrypted = aesEncryptWeapi(aesEncryptWeapi(text, WEAPI_PRESET_KEY), secretKey);
|
||||
var encSecKey = rsaEncryptWeapi(secretKey);
|
||||
return { params: encrypted, encSecKey: encSecKey };
|
||||
}
|
||||
|
||||
// ===== 格式化辅助 =====
|
||||
function formatPlayTime(time) {
|
||||
if (!time) return '--/--';
|
||||
var m = Math.floor(time / 60);
|
||||
var s = Math.floor(time % 60);
|
||||
if (m === 0 && s === 0) return '--/--';
|
||||
return (m < 10 ? '0' + m : m) + ':' + (s < 10 ? '0' + s : s);
|
||||
}
|
||||
|
||||
function sizeFormate(bytes) {
|
||||
if (typeof bytes === 'string') bytes = parseFloat(bytes.replace(/[^0-9.]/g, ''));
|
||||
var n = parseFloat(bytes);
|
||||
if (isNaN(n) || n < 0) return '0.00MB';
|
||||
var mb = n / (1024 * 1024);
|
||||
return mb.toFixed(2) + 'MB';
|
||||
}
|
||||
|
||||
function formatSingerName(arr, key) {
|
||||
if (!arr || !arr.length) return '';
|
||||
var names = [];
|
||||
for (var i = 0; i < arr.length; i++) names.push(arr[i][key] || arr[i]);
|
||||
return names.join('、');
|
||||
}
|
||||
|
||||
function formatPlayCount(count) {
|
||||
if (!count && count !== 0) return '';
|
||||
if (count >= 100000000) return (count / 100000000).toFixed(1) + '亿';
|
||||
if (count >= 10000) return (count / 10000).toFixed(1) + '万';
|
||||
return String(count);
|
||||
}
|
||||
|
||||
// ===== 搜索实现 =====
|
||||
function musicSearch(str, page, limit) {
|
||||
var form = eapi('/api/search/song/list/page', {
|
||||
keyword: str,
|
||||
needCorrect: '1',
|
||||
channel: 'typing',
|
||||
offset: limit * (page - 1),
|
||||
scene: 'normal',
|
||||
total: page == 1,
|
||||
limit: limit
|
||||
});
|
||||
return requestUrl('http://interface3.music.163.com/eapi/search/song/list/page', 'POST', {
|
||||
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36',
|
||||
'Origin': 'https://music.163.com',
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'Cookie': WY_COOKIE
|
||||
}, querystring.stringify(form)).then(function(res) {
|
||||
return res.body;
|
||||
});
|
||||
}
|
||||
|
||||
function handleSearchResult(rawList) {
|
||||
if (!rawList) return [];
|
||||
var list = [];
|
||||
for (var i = 0; i < rawList.length; i++) {
|
||||
var item = rawList[i];
|
||||
if (!item.baseInfo || !item.baseInfo.simpleSongData) continue;
|
||||
var s = item.baseInfo.simpleSongData;
|
||||
var qualities = {};
|
||||
if (s.l && s.l.size) qualities['128k'] = sizeFormate(s.l.size);
|
||||
if (s.h && s.h.size) qualities['320k'] = sizeFormate(s.h.size);
|
||||
if (s.sq && s.sq.size) qualities['flac'] = sizeFormate(s.sq.size);
|
||||
var picUrl = s.al && s.al.picUrl ? s.al.picUrl : '';
|
||||
list.push({
|
||||
id: String(s.id),
|
||||
name: s.name,
|
||||
artists: formatSingerName(s.ar, 'name'),
|
||||
source: 'wy',
|
||||
pic: picUrl,
|
||||
mPic: picUrl,
|
||||
sPic: picUrl,
|
||||
albumName: s.al && s.al.name ? s.al.name : '',
|
||||
albumId: String(s.al && s.al.id ? s.al.id : ''),
|
||||
interval: String(formatPlayTime((s.dt || 0) / 1000) || '--/--'),
|
||||
qualities: qualities
|
||||
});
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
function search(str, page, limit, retryNum) {
|
||||
if (retryNum === undefined) retryNum = 0;
|
||||
if (++retryNum > 3) return Promise.reject(new Error('try max num'));
|
||||
if (!limit) limit = 30;
|
||||
return musicSearch(str, page, limit).then(function(result) {
|
||||
if (!result || result.code !== 200) return search(str, page, limit, retryNum);
|
||||
var list = handleSearchResult(result.data && result.data.resources ? result.data.resources : []);
|
||||
if (!list || list.length === 0) return search(str, page, limit, retryNum);
|
||||
var total = result.data && result.data.totalCount ? result.data.totalCount : 0;
|
||||
return {
|
||||
list: list,
|
||||
allPage: Math.ceil(total / limit),
|
||||
limit: limit,
|
||||
total: total,
|
||||
source: 'wy'
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
// ===== 播放链接 =====
|
||||
function getUrl(songId, quality) {
|
||||
songId = String(songId || '');
|
||||
quality = String(quality || '128k');
|
||||
var ceruKey = CERU_KEY || '';
|
||||
var headers = { 'User-Agent': 'QZMusic/2.0' };
|
||||
if (ceruKey) headers['X-API-Key'] = ceruKey;
|
||||
return requestUrl('https://source.shiqianjiang.cn/api/music/url?source=wy&songId=' + encodeURIComponent(songId) + '&quality=' + encodeURIComponent(quality), 'GET', headers)
|
||||
.then(function(res) {
|
||||
if (res.body && typeof res.body === 'object' && res.body.url) return res.body.url;
|
||||
if (res.body && typeof res.body === 'object' && res.body.data && res.body.data.url) return res.body.data.url;
|
||||
if (typeof res.body === 'string' && res.body.indexOf('http') === 0) return res.body;
|
||||
return '';
|
||||
})
|
||||
.catch(function() { return ''; });
|
||||
}
|
||||
|
||||
// ===== 封面图 =====
|
||||
function getPic(songInfo) {
|
||||
if (songInfo && songInfo.pic) return Promise.resolve(songInfo.pic);
|
||||
var id = songInfo && songInfo.id ? String(songInfo.id) : '';
|
||||
if (!id) return Promise.resolve('');
|
||||
return requestUrl('https://music.163.com/weapi/v3/song/detail', 'POST', {
|
||||
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36',
|
||||
'Referer': 'https://music.163.com/song?id=' + id,
|
||||
'Origin': 'https://music.163.com',
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'Cookie': WY_COOKIE
|
||||
}, querystring.stringify(weapi({ c: '[{"id":' + id + '}]', ids: '[' + id + ']' })))
|
||||
.then(function(res) {
|
||||
if (res.body && res.body.songs && res.body.songs.length) return res.body.songs[0].al.picUrl;
|
||||
return '';
|
||||
})
|
||||
.catch(function() { return ''; });
|
||||
}
|
||||
|
||||
// ===== 歌词 =====
|
||||
function getLyric(songInfo) {
|
||||
var songmid = (songInfo && songInfo.id) || '';
|
||||
return requestUrl('https://music.163.com/api/song/lyric?id=' + encodeURIComponent(songmid) + '&lv=1&kv=1&tv=-1', 'GET', {
|
||||
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36',
|
||||
'Referer': 'https://music.163.com/song?id=' + songmid,
|
||||
'Cookie': WY_COOKIE
|
||||
}).then(function(res) {
|
||||
if (res.body && res.body.lrc && res.body.lrc.lyric) return res.body.lrc.lyric;
|
||||
return '';
|
||||
}).catch(function() { return ''; });
|
||||
}
|
||||
|
||||
// ===== 音乐详情 =====
|
||||
function musicDetail(songmid) {
|
||||
return requestUrl('https://music.163.com/weapi/v3/song/detail', 'POST', {
|
||||
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36',
|
||||
'Origin': 'https://music.163.com',
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'Cookie': WY_COOKIE
|
||||
}, querystring.stringify(weapi({ c: '[{"id":' + songmid + '}]', ids: '[' + songmid + ']' })))
|
||||
.then(function(res) {
|
||||
if (res.body && res.body.songs && res.body.songs.length) {
|
||||
var s = res.body.songs[0];
|
||||
var picUrl = s.al && s.al.picUrl ? s.al.picUrl : '';
|
||||
return {
|
||||
id: String(s.id),
|
||||
name: s.name,
|
||||
artists: formatSingerName(s.ar, 'name'),
|
||||
source: 'wy',
|
||||
pic: picUrl,
|
||||
mPic: picUrl,
|
||||
sPic: picUrl,
|
||||
albumName: s.al && s.al.name ? s.al.name : '',
|
||||
albumId: String(s.al && s.al.id ? s.al.id : ''),
|
||||
interval: String(formatPlayTime((s.dt || 0) / 1000) || '--/--'),
|
||||
qualities: {}
|
||||
};
|
||||
}
|
||||
return null;
|
||||
})
|
||||
.catch(function() { return null; });
|
||||
}
|
||||
|
||||
function musicInfo(songmid) {
|
||||
return musicDetail(songmid);
|
||||
}
|
||||
|
||||
// ===== 热搜 =====
|
||||
function hotSearch() {
|
||||
return requestUrl('https://music.163.com/weapi/search/hot', 'POST', {
|
||||
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36',
|
||||
'Origin': 'https://music.163.com',
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'Cookie': WY_COOKIE
|
||||
}, querystring.stringify(weapi({ type: 1111 })))
|
||||
.then(function(res) {
|
||||
var list = [];
|
||||
if (res.body && res.body.result && res.body.result.hots) {
|
||||
for (var i = 0; i < res.body.result.hots.length; i++) list.push(res.body.result.hots[i].first);
|
||||
}
|
||||
return { source: 'wy', list: list };
|
||||
})
|
||||
.catch(function() { return { source: 'wy', list: [] }; });
|
||||
}
|
||||
|
||||
// ===== 搜索建议 =====
|
||||
function tipSearch(str) {
|
||||
return requestUrl('https://music.163.com/weapi/search/suggest/web', 'POST', {
|
||||
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36',
|
||||
'Origin': 'https://music.163.com',
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'Cookie': WY_COOKIE
|
||||
}, querystring.stringify(weapi({ s: str, limit: 10 })))
|
||||
.then(function(res) {
|
||||
var result = { order: [], songs: [], artists: [], albums: [], playlists: [] };
|
||||
if (res.body && res.body.result) {
|
||||
var r = res.body.result;
|
||||
if (r.songs) { result.order.push('songs'); result.songs = r.songs.map(function(s) { return { name: s.name, id: s.id, source: 'wy' }; }); }
|
||||
if (r.artists) { result.order.push('artists'); result.artists = r.artists.map(function(a) { return { name: a.name, id: a.id, source: 'wy' }; }); }
|
||||
}
|
||||
return result;
|
||||
})
|
||||
.catch(function() { return { order: [], songs: [], artists: [], albums: [], playlists: [] }; });
|
||||
}
|
||||
|
||||
// ===== 榜单 =====
|
||||
var BOARD_LIST = [
|
||||
{ id: '19723756', name: '飙升榜', source: 'wy' },
|
||||
{ id: '3779629', name: '新歌榜', source: 'wy' },
|
||||
{ id: '2884035', name: '原创榜', source: 'wy' },
|
||||
{ id: '3778678', name: '热歌榜', source: 'wy' },
|
||||
{ id: '1978921795', name: '云音乐电音榜', source: 'wy' },
|
||||
{ id: '991319590', name: '云音乐说唱榜', source: 'wy' },
|
||||
{ id: '5059633707', name: '云音乐摇滚榜', source: 'wy' },
|
||||
{ id: '5059642708', name: '云音乐古风榜', source: 'wy' },
|
||||
{ id: '5059644681', name: '云音乐民谣榜', source: 'wy' },
|
||||
{ id: '180106', name: 'UK排行榜周榜', source: 'wy' },
|
||||
{ id: '60198', name: '美国Billboard周榜', source: 'wy' },
|
||||
{ id: '11641212', name: 'KTV唛榜', source: 'wy' },
|
||||
{ id: '112463', name: 'iTunes榜', source: 'wy' },
|
||||
{ id: '112504', name: '日本Oricon周榜', source: 'wy' },
|
||||
{ id: '250341', name: '云音乐MV榜', source: 'wy' }
|
||||
];
|
||||
|
||||
function leaderboardGetBoards() {
|
||||
return Promise.resolve(BOARD_LIST);
|
||||
}
|
||||
|
||||
function leaderboardGetList(id, page) {
|
||||
if (!page) page = 1;
|
||||
var limit = 1000;
|
||||
var form = weapi({ id: id, n: limit, s: 8 });
|
||||
return requestUrl('https://music.163.com/weapi/v3/playlist/detail', 'POST', {
|
||||
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36',
|
||||
'Origin': 'https://music.163.com',
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'Cookie': WY_COOKIE
|
||||
}, querystring.stringify(form)).then(function(res) {
|
||||
if (!res.body || !res.body.playlist) return { list: [], total: 0, source: 'wy' };
|
||||
var tracks = res.body.playlist.tracks || [];
|
||||
var list = [];
|
||||
for (var i = 0; i < tracks.length; i++) {
|
||||
var item = tracks[i];
|
||||
var picUrl = item.al && item.al.picUrl ? item.al.picUrl : '';
|
||||
list.push({
|
||||
id: String(item.id),
|
||||
name: item.name,
|
||||
artists: formatSingerName(item.ar, 'name'),
|
||||
source: 'wy',
|
||||
pic: picUrl,
|
||||
mPic: picUrl,
|
||||
sPic: picUrl,
|
||||
albumName: item.al && item.al.name ? item.al.name : '',
|
||||
albumId: String(item.al && item.al.id ? item.al.id : ''),
|
||||
interval: String(formatPlayTime((item.dt || 0) / 1000) || '--/--'),
|
||||
qualities: {}
|
||||
});
|
||||
}
|
||||
return { list: list, total: list.length, source: 'wy', limit: limit, page: page };
|
||||
}).catch(function() { return { list: [], total: 0, source: 'wy' }; });
|
||||
}
|
||||
|
||||
function leaderboard() {
|
||||
return Promise.resolve(BOARD_LIST);
|
||||
}
|
||||
|
||||
// ===== 歌单 =====
|
||||
var songList = {
|
||||
limit_list: 30,
|
||||
sortList: [
|
||||
{ name: '最热', id: 'hot' }
|
||||
],
|
||||
getTags: function() {
|
||||
return requestUrl('https://music.163.com/weapi/playlist/catalogue', 'POST', {
|
||||
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36',
|
||||
'Origin': 'https://music.163.com',
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'Cookie': WY_COOKIE
|
||||
}, querystring.stringify(weapi({}))).then(function(res) {
|
||||
if (!res.body || res.body.code !== 200) return { tags: [], hotTag: [], source: 'wy' };
|
||||
var categories = res.body.categories || {};
|
||||
var sub = res.body.sub || [];
|
||||
var subList = {};
|
||||
for (var i = 0; i < sub.length; i++) {
|
||||
var item = sub[i];
|
||||
if (!subList[item.category]) subList[item.category] = [];
|
||||
subList[item.category].push({ parent_name: categories[item.category], name: item.name, id: item.name, source: 'wy' });
|
||||
}
|
||||
var tags = [];
|
||||
var keys = Object.keys(categories);
|
||||
for (var j = 0; j < keys.length; j++) {
|
||||
tags.push({ name: categories[keys[j]], list: subList[keys[j]] || [], source: 'wy' });
|
||||
}
|
||||
return { tags: tags, hotTag: [], source: 'wy' };
|
||||
}).catch(function() { return { tags: [], hotTag: [], source: 'wy' }; });
|
||||
},
|
||||
getList: function(sortId, tagId, page) {
|
||||
if (!page) page = 1;
|
||||
var limit = this.limit_list;
|
||||
return requestUrl('https://music.163.com/weapi/playlist/list', 'POST', {
|
||||
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36',
|
||||
'Origin': 'https://music.163.com',
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'Cookie': WY_COOKIE
|
||||
}, querystring.stringify(weapi({
|
||||
cat: tagId || '全部',
|
||||
order: sortId || 'hot',
|
||||
limit: limit,
|
||||
offset: limit * (page - 1),
|
||||
total: true
|
||||
}))).then(function(res) {
|
||||
if (!res.body || res.body.code !== 200) return { list: [], total: 0, page: page, limit: limit, source: 'wy' };
|
||||
var playlists = res.body.playlists || [];
|
||||
var list = [];
|
||||
for (var i = 0; i < playlists.length; i++) {
|
||||
var p = playlists[i];
|
||||
list.push({
|
||||
id: String(p.id),
|
||||
name: p.name,
|
||||
author: p.creator && p.creator.nickname ? p.creator.nickname : '',
|
||||
img: p.coverImgUrl || '',
|
||||
play_count: formatPlayCount(p.playCount),
|
||||
total: p.trackCount || 0,
|
||||
desc: p.description || '',
|
||||
source: 'wy'
|
||||
});
|
||||
}
|
||||
return { list: list, total: res.body.total || 0, page: page, limit: limit, source: 'wy' };
|
||||
}).catch(function() { return { list: [], total: 0, page: page, limit: limit, source: 'wy' }; });
|
||||
},
|
||||
getListDetail: function(id, page) {
|
||||
if (!page) page = 1;
|
||||
var limit = 1000;
|
||||
return requestUrl('https://music.163.com/weapi/v3/playlist/detail', 'POST', {
|
||||
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36',
|
||||
'Origin': 'https://music.163.com',
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'Cookie': WY_COOKIE
|
||||
}, querystring.stringify(weapi({ id: id, n: limit, s: 8 }))).then(function(res) {
|
||||
if (!res.body || !res.body.playlist) return { list: [], total: 0, source: 'wy' };
|
||||
var playlist = res.body.playlist;
|
||||
var tracks = playlist.tracks || [];
|
||||
var list = [];
|
||||
for (var i = 0; i < tracks.length; i++) {
|
||||
var item = tracks[i];
|
||||
var picUrl = item.al && item.al.picUrl ? item.al.picUrl : '';
|
||||
list.push({
|
||||
id: String(item.id),
|
||||
name: item.name,
|
||||
artists: formatSingerName(item.ar, 'name'),
|
||||
source: 'wy',
|
||||
pic: picUrl, mPic: picUrl, sPic: picUrl,
|
||||
albumName: item.al && item.al.name ? item.al.name : '',
|
||||
albumId: String(item.al && item.al.id ? item.al.id : ''),
|
||||
interval: String(formatPlayTime((item.dt || 0) / 1000) || '--/--'),
|
||||
qualities: {}
|
||||
});
|
||||
}
|
||||
return {
|
||||
list: list, page: page, limit: limit,
|
||||
total: playlist.trackIds ? playlist.trackIds.length : list.length,
|
||||
source: 'wy',
|
||||
info: { name: playlist.name, img: playlist.coverImgUrl, desc: playlist.description, author: playlist.creator && playlist.creator.nickname ? playlist.creator.nickname : '' }
|
||||
};
|
||||
}).catch(function() { return { list: [], total: 0, source: 'wy' }; });
|
||||
},
|
||||
search: function(text, page, limit) {
|
||||
if (!page) page = 1;
|
||||
if (!limit) limit = 20;
|
||||
var form = eapi('/api/cloudsearch/pc', { s: text, type: 1000, limit: limit, total: page == 1, offset: limit * (page - 1) });
|
||||
return requestUrl('http://interface3.music.163.com/eapi/cloudsearch/pc', 'POST', {
|
||||
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36',
|
||||
'Origin': 'https://music.163.com',
|
||||
'Cookie': WY_COOKIE
|
||||
}, querystring.stringify(form)).then(function(res) {
|
||||
if (!res.body || res.body.code !== 200) return { list: [], total: 0, source: 'wy' };
|
||||
var playlists = res.body.result && res.body.result.playlists ? res.body.result.playlists : [];
|
||||
var list = [];
|
||||
for (var i = 0; i < playlists.length; i++) {
|
||||
var p = playlists[i];
|
||||
list.push({ id: String(p.id), name: p.name, author: p.creator && p.creator.nickname ? p.creator.nickname : '', img: p.coverImgUrl || '', play_count: formatPlayCount(p.playCount), total: p.trackCount || 0, source: 'wy' });
|
||||
}
|
||||
return { list: list, total: res.body.result.playlistCount || 0, page: page, limit: limit, source: 'wy' };
|
||||
}).catch(function() { return { list: [], total: 0, source: 'wy' }; });
|
||||
}
|
||||
};
|
||||
|
||||
// ===== 歌手 =====
|
||||
var singer = {
|
||||
getInfo: function(id) {
|
||||
var form = eapi('/api/artist/head/info/get', { id: id });
|
||||
return requestUrl('http://interface3.music.163.com/eapi/artist/head/info/get', 'POST', {
|
||||
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36',
|
||||
'Cookie': WY_COOKIE
|
||||
}, querystring.stringify(form)).then(function(res) {
|
||||
if (!res.body || res.body.code !== 200) return null;
|
||||
return {
|
||||
source: 'wy', id: res.body.artist.id,
|
||||
info: { name: res.body.artist.name, desc: res.body.artist.briefDesc, avatar: res.body.user && res.body.user.avatarUrl ? res.body.user.avatarUrl : '' },
|
||||
count: { music: res.body.artist.musicSize, album: res.body.artist.albumSize }
|
||||
};
|
||||
}).catch(function() { return null; });
|
||||
},
|
||||
getSongList: function(id, page, limit) {
|
||||
if (!page) page = 1;
|
||||
if (!limit) limit = 100;
|
||||
var offset = (page - 1) * limit;
|
||||
var form = eapi('/api/v2/artist/songs', { id: id, limit: limit, offset: offset });
|
||||
return requestUrl('http://interface3.music.163.com/eapi/v2/artist/songs', 'POST', {
|
||||
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36',
|
||||
'Cookie': WY_COOKIE
|
||||
}, querystring.stringify(form)).then(function(res) {
|
||||
if (!res.body || !res.body.songs) return { list: [], total: 0, source: 'wy' };
|
||||
var list = [];
|
||||
for (var i = 0; i < res.body.songs.length; i++) {
|
||||
var item = res.body.songs[i];
|
||||
var picUrl = item.al && item.al.picUrl ? item.al.picUrl : '';
|
||||
list.push({
|
||||
id: String(item.id), name: item.name, artists: formatSingerName(item.artists, 'name'),
|
||||
source: 'wy', pic: picUrl, mPic: picUrl, sPic: picUrl,
|
||||
albumName: item.album && item.album.name ? item.album.name : '',
|
||||
albumId: String(item.album && item.album.id ? item.album.id : ''),
|
||||
interval: String(formatPlayTime((item.duration || 0) / 1000) || '--/--'), qualities: {}
|
||||
});
|
||||
}
|
||||
return { list: list, total: res.body.total || 0, page: page, limit: limit, source: 'wy' };
|
||||
}).catch(function() { return { list: [], total: 0, source: 'wy' }; });
|
||||
},
|
||||
getAlbumList: function(id, page, limit) {
|
||||
if (!page) page = 1;
|
||||
if (!limit) limit = 10;
|
||||
var offset = (page - 1) * limit;
|
||||
var form = eapi('/api/artist/albums/' + id, { limit: limit, offset: offset });
|
||||
return requestUrl('http://interface3.music.163.com/eapi/artist/albums/' + id, 'POST', {
|
||||
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36',
|
||||
'Cookie': WY_COOKIE
|
||||
}, querystring.stringify(form)).then(function(res) {
|
||||
if (!res.body || !res.body.hotAlbums) return { list: [], total: 0, source: 'wy' };
|
||||
var list = [];
|
||||
for (var i = 0; i < res.body.hotAlbums.length; i++) {
|
||||
var item = res.body.hotAlbums[i];
|
||||
list.push({ id: item.id, count: item.size, info: { name: item.name, author: formatSingerName(item.artists), img: item.picUrl, desc: null } });
|
||||
}
|
||||
return { list: list, total: res.body.artist && res.body.artist.albumSize ? res.body.artist.albumSize : 0, page: page, limit: limit, source: 'wy' };
|
||||
}).catch(function() { return { list: [], total: 0, source: 'wy' }; });
|
||||
}
|
||||
};
|
||||
|
||||
// ===== 专辑 =====
|
||||
var album = {
|
||||
getInfo: function(id) {
|
||||
var form = weapi({ id: id });
|
||||
return requestUrl('https://music.163.com/weapi/v1/album/' + id, 'POST', {
|
||||
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36',
|
||||
'Origin': 'https://music.163.com',
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'Cookie': WY_COOKIE
|
||||
}, querystring.stringify(form)).then(function(res) {
|
||||
if (!res.body || !res.body.album) return null;
|
||||
var a = res.body.album;
|
||||
return { source: 'wy', id: a.id, info: { name: a.name, author: formatSingerName(a.artists), img: a.picUrl, desc: a.description || '' }, count: { song: a.size } };
|
||||
}).catch(function() { return null; });
|
||||
},
|
||||
getSongList: function(id, page, limit) {
|
||||
if (!page) page = 1;
|
||||
if (!limit) limit = 100;
|
||||
var form = weapi({ id: id });
|
||||
return requestUrl('https://music.163.com/weapi/v1/album/' + id, 'POST', {
|
||||
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36',
|
||||
'Origin': 'https://music.163.com',
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'Cookie': WY_COOKIE
|
||||
}, querystring.stringify(form)).then(function(res) {
|
||||
if (!res.body || !res.body.songs) return { list: [], total: 0, source: 'wy' };
|
||||
var list = [];
|
||||
for (var i = 0; i < res.body.songs.length; i++) {
|
||||
var item = res.body.songs[i];
|
||||
var picUrl = item.al && item.al.picUrl ? item.al.picUrl : '';
|
||||
list.push({
|
||||
id: String(item.id), name: item.name, artists: formatSingerName(item.ar, 'name'),
|
||||
source: 'wy', pic: picUrl, mPic: picUrl, sPic: picUrl,
|
||||
albumName: item.al && item.al.name ? item.al.name : '',
|
||||
albumId: String(item.al && item.al.id ? item.al.id : ''),
|
||||
interval: String(formatPlayTime((item.dt || 0) / 1000) || '--/--'), qualities: {}
|
||||
});
|
||||
}
|
||||
return { list: list, total: list.length, page: page, limit: limit, source: 'wy' };
|
||||
}).catch(function() { return { list: [], total: 0, source: 'wy' }; });
|
||||
}
|
||||
};
|
||||
|
||||
// ===== 插件信息 =====
|
||||
var pluginInfo = {
|
||||
info: {
|
||||
id: 'koneko_ceru_wy',
|
||||
name: '网易云音乐 - Koneko 聆澜',
|
||||
version: '0.1.2',
|
||||
source: 'wy',
|
||||
description: '网易云音乐音源,基于 CeruMusic musicSdk 搜索 + Ceru 播放接口'
|
||||
},
|
||||
ext: [
|
||||
{ type: 'homePage', url: 'https://music.163.com/', name: '网易云音乐主页', description: '网易云音乐主页', entry: '' },
|
||||
{ type: 'share', url: 'https://music.163.com/song/media/outer/url?id={id}.mp3', name: '外链分享', description: '外链分享', entry: '' }
|
||||
],
|
||||
env: [
|
||||
{ key: 'ceru_key', name: 'Ceru API Key', description: '聆澜播放接口密钥' },
|
||||
{ key: 'cookie', name: '网易云Cookie', description: '网易云音乐登录Cookie(需包含MUSIC_U=),用于个人歌单、收藏等功能' }
|
||||
],
|
||||
quality: [
|
||||
{ name: '标准音质', ui: '标', id: '128k' },
|
||||
{ name: '高品音质', ui: 'HQ', id: '320k' },
|
||||
{ name: '无损音质', ui: 'SQ', id: 'flac' }
|
||||
],
|
||||
supportFunc: ['search_song', 'search_playlist', 'playlist', 'album', 'lyric']
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
musicSearch: { search: search },
|
||||
tipSearch: { search: tipSearch },
|
||||
hotSearch: { getList: hotSearch },
|
||||
leaderboard: { getBoards: leaderboardGetBoards, getList: leaderboardGetList },
|
||||
songList: songList,
|
||||
singer: singer,
|
||||
album: album,
|
||||
getLyric: getLyric,
|
||||
getPic: getPic,
|
||||
getUrl: getUrl,
|
||||
musicDetail: musicDetail,
|
||||
musicInfo: musicInfo,
|
||||
pluginInfo: pluginInfo
|
||||
};
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
var env = global.env || {};
|
||||
var CERU_KEY = env.ceru_key || '';
|
||||
var https = require('https');
|
||||
var http = require('http');
|
||||
var crypto = require('crypto');
|
||||
@@ -53,13 +56,23 @@ function requestUrl(urlStr, method, headers, body) {
|
||||
return doRequest(protocol, options, postData);
|
||||
}
|
||||
|
||||
function formatPlayTime(seconds) {
|
||||
if (!seconds) return '00:00';
|
||||
var m = Math.floor(seconds / 60);
|
||||
var s = Math.floor(seconds % 60);
|
||||
// ===== 格式化辅助 =====
|
||||
function formatPlayTime(time) {
|
||||
if (!time) return '--/--';
|
||||
var m = Math.floor(time / 60);
|
||||
var s = Math.floor(time % 60);
|
||||
if (m === 0 && s === 0) return '--/--';
|
||||
return (m < 10 ? '0' + m : m) + ':' + (s < 10 ? '0' + s : s);
|
||||
}
|
||||
|
||||
function sizeFormate(bytes) {
|
||||
if (typeof bytes === 'string') bytes = parseFloat(bytes.replace(/[^0-9.]/g, ''));
|
||||
var n = parseFloat(bytes);
|
||||
if (isNaN(n) || n < 0) return '0.00MB';
|
||||
var mb = n / (1024 * 1024);
|
||||
return mb.toFixed(2) + 'MB';
|
||||
}
|
||||
|
||||
// ===== 搜索实现 =====
|
||||
function musicSearch(str, page, limit) {
|
||||
var url = 'https://kuwo-api.vercel.app/api/search?key=' + encodeURIComponent(str) + '&page=' + page + '&limit=' + limit;
|
||||
@@ -71,15 +84,19 @@ function musicSearch(str, page, limit) {
|
||||
|
||||
function handleSearchResult(rawList) {
|
||||
var list = [];
|
||||
if (!rawList) return list;
|
||||
for (var i = 0; i < rawList.length; i++) {
|
||||
var item = rawList[i];
|
||||
var qualities = {};
|
||||
if (item.filesize) qualities.standard = String(item.filesize);
|
||||
if (item.sqfilesize) qualities.exhigh = String(item.sqfilesize);
|
||||
if (item.flacfilesize) qualities.lossless = String(item.flacfilesize);
|
||||
var picUrl = item.pic || '';
|
||||
var size128 = item.filesize || item.mp3size || item.mp3Size || 0;
|
||||
var size320 = item.sqfilesize || item.hqsize || item['320size'] || item['320filesize'] || 0;
|
||||
var sizeFlac = item.flacfilesize || item.flacsize || item.flacSize || 0;
|
||||
if (size128) qualities['128k'] = sizeFormate(size128);
|
||||
if (size320) qualities['320k'] = sizeFormate(size320);
|
||||
if (sizeFlac) qualities['flac'] = sizeFormate(sizeFlac);
|
||||
var picUrl = item.pic || item.albumpic || '';
|
||||
list.push({
|
||||
id: item.id || item.rid || '',
|
||||
id: String(item.rid || item.id || ''),
|
||||
name: item.name || '',
|
||||
artists: item.artist || '',
|
||||
source: 'kw',
|
||||
@@ -87,8 +104,8 @@ function handleSearchResult(rawList) {
|
||||
mPic: picUrl,
|
||||
sPic: picUrl,
|
||||
albumName: item.album || '',
|
||||
albumId: item.albumid || '',
|
||||
interval: item.duration ? formatPlayTime(item.duration) : '',
|
||||
albumId: String(item.albumid || ''),
|
||||
interval: String(formatPlayTime(item.duration) || '--/--'),
|
||||
qualities: qualities
|
||||
});
|
||||
}
|
||||
@@ -106,13 +123,13 @@ function search(str, page, limit, retryNum) {
|
||||
}
|
||||
|
||||
// ===== 播放链接 =====
|
||||
function getUrl(songInfo, type) {
|
||||
var q = type || '128k';
|
||||
var songId = songInfo.id || '';
|
||||
var ceruKey = process.env.ceru_key || '';
|
||||
function getUrl(songId, quality) {
|
||||
songId = String(songId || '');
|
||||
quality = String(quality || '128k');
|
||||
var ceruKey = CERU_KEY || '';
|
||||
var headers = { 'User-Agent': 'QZMusic/2.0' };
|
||||
if (ceruKey) headers['X-API-Key'] = ceruKey;
|
||||
return requestUrl('https://source.shiqianjiang.cn/api/music/url?source=kw&songId=' + encodeURIComponent(songId) + '&quality=' + encodeURIComponent(q), 'GET', headers)
|
||||
return requestUrl('https://source.shiqianjiang.cn/api/music/url?source=kw&songId=' + encodeURIComponent(songId) + '&quality=' + encodeURIComponent(quality), 'GET', headers)
|
||||
.then(function(res) {
|
||||
if (res.body && typeof res.body === 'object' && res.body.url) return res.body.url;
|
||||
if (res.body && typeof res.body === 'object' && res.body.data && res.body.data.url) return res.body.data.url;
|
||||
@@ -123,13 +140,13 @@ function getUrl(songInfo, type) {
|
||||
|
||||
// ===== 封面图 =====
|
||||
function getPic(songInfo) {
|
||||
if (songInfo.pic) return Promise.resolve(songInfo.pic);
|
||||
if (songInfo && songInfo.pic) return Promise.resolve(songInfo.pic);
|
||||
return Promise.resolve('');
|
||||
}
|
||||
|
||||
// ===== 歌词 =====
|
||||
function getLyric(songInfo) {
|
||||
var rid = songInfo.id || '';
|
||||
var rid = (songInfo && songInfo.id) || '';
|
||||
if (!rid) return Promise.resolve('');
|
||||
return requestUrl('https://kuwo-api.vercel.app/api/lyric?id=' + encodeURIComponent(rid), 'GET', {
|
||||
'User-Agent': 'Mozilla/5.0 (Linux; Android 10)'
|
||||
@@ -168,18 +185,18 @@ var pluginInfo = {
|
||||
info: {
|
||||
id: 'koneko_ceru_kw',
|
||||
name: '酷我音乐 - Koneko 聆澜',
|
||||
version: '0.1.0',
|
||||
version: '0.1.2',
|
||||
source: 'kw',
|
||||
description: '酷我音乐音源,基于 CeruMusic musicSdk 搜索 + Ceru 播放接口'
|
||||
},
|
||||
ext: [],
|
||||
env: [{ key: 'ceru_key', name: 'Ceru API Key', description: '聆澜播放接口密钥' }],
|
||||
quality: [
|
||||
{ name: '标准', ui: '标', id: '128k' },
|
||||
{ name: '高品', ui: 'HQ', id: '320k' },
|
||||
{ name: '无损', ui: 'SQ', id: 'flac' }
|
||||
{ name: '标准音质', ui: '标', id: '128k' },
|
||||
{ name: '高品音质', ui: 'HQ', id: '320k' },
|
||||
{ name: '无损音质', ui: 'SQ', id: 'flac' }
|
||||
],
|
||||
supportFunc: []
|
||||
supportFunc: ['search_song', 'search_playlist', 'playlist', 'album', 'lyric']
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
@@ -188,7 +205,7 @@ module.exports = {
|
||||
hotSearch: { getList: hotSearch },
|
||||
leaderboard: { getBoards: leaderboard },
|
||||
songList: songList,
|
||||
artists: singer,
|
||||
singer: singer,
|
||||
album: album,
|
||||
getLyric: getLyric,
|
||||
getPic: getPic,
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
var env = global.env || {};
|
||||
var CERU_KEY = env.ceru_key || '';
|
||||
var https = require('https');
|
||||
var http = require('http');
|
||||
var crypto = require('crypto');
|
||||
@@ -53,33 +56,44 @@ function requestUrl(urlStr, method, headers, body) {
|
||||
return doRequest(protocol, options, postData);
|
||||
}
|
||||
|
||||
function formatPlayTime(seconds) {
|
||||
if (!seconds) return '00:00';
|
||||
var m = Math.floor(seconds / 60);
|
||||
var s = Math.floor(seconds % 60);
|
||||
// ===== 格式化辅助 =====
|
||||
function formatPlayTime(time) {
|
||||
if (!time) return '--/--';
|
||||
var m = Math.floor(time / 60);
|
||||
var s = Math.floor(time % 60);
|
||||
if (m === 0 && s === 0) return '--/--';
|
||||
return (m < 10 ? '0' + m : m) + ':' + (s < 10 ? '0' + s : s);
|
||||
}
|
||||
|
||||
function sizeFormate(bytes) {
|
||||
if (typeof bytes === 'string') bytes = parseFloat(bytes.replace(/[^0-9.]/g, ''));
|
||||
var n = parseFloat(bytes);
|
||||
if (isNaN(n) || n < 0) return '0.00MB';
|
||||
var mb = n / (1024 * 1024);
|
||||
return mb.toFixed(2) + 'MB';
|
||||
}
|
||||
|
||||
// ===== 搜索实现 =====
|
||||
function musicSearch(str, page, limit) {
|
||||
var url = 'http://mobilecdn.kugou.com/api/v3/search/song?showtype=14&highlight=em&pagesize=' + limit + '&page=' + page + '&keyword=' + encodeURIComponent(str);
|
||||
return requestUrl(url, 'GET', { 'User-Agent': 'Mozilla/5.0 (Linux; Android 10)' }).then(function(res) {
|
||||
if (res.body && res.body.data && res.body.data.info) return res.body.data.info;
|
||||
if (res.body && res.body.data && res.body.data.info) return res.body.data;
|
||||
throw new Error('kg search failed');
|
||||
});
|
||||
}
|
||||
|
||||
function handleSearchResult(rawList) {
|
||||
var list = [];
|
||||
if (!rawList) return list;
|
||||
for (var i = 0; i < rawList.length; i++) {
|
||||
var item = rawList[i];
|
||||
var qualities = {};
|
||||
if (item.filesize) qualities.standard = String(item.filesize);
|
||||
if (item.sqfilesize) qualities.exhigh = String(item.sqfilesize);
|
||||
if (item.flacfilesize) qualities.lossless = String(item.flacfilesize);
|
||||
if (item.filesize) qualities['128k'] = sizeFormate(item.filesize);
|
||||
if (item.sqfilesize) qualities['320k'] = sizeFormate(item.sqfilesize);
|
||||
if (item.flacfilesize) qualities['flac'] = sizeFormate(item.flacfilesize);
|
||||
var picUrl = item.img || '';
|
||||
list.push({
|
||||
id: item.hash || item.audio_id || '',
|
||||
id: String(item.hash || item.audio_id || ''),
|
||||
name: item.songname || '',
|
||||
artists: item.singername || '',
|
||||
source: 'kg',
|
||||
@@ -87,8 +101,8 @@ function handleSearchResult(rawList) {
|
||||
mPic: picUrl,
|
||||
sPic: picUrl,
|
||||
albumName: item.album_name || '',
|
||||
albumId: item.album_id || '',
|
||||
interval: item.duration ? formatPlayTime(item.duration) : '',
|
||||
albumId: String(item.album_id || ''),
|
||||
interval: String(formatPlayTime(item.duration) || '--/--'),
|
||||
qualities: qualities
|
||||
});
|
||||
}
|
||||
@@ -99,20 +113,22 @@ function search(str, page, limit, retryNum) {
|
||||
if (retryNum === undefined) retryNum = 0;
|
||||
if (++retryNum > 3) return Promise.reject(new Error('try max num'));
|
||||
if (!limit) limit = 30;
|
||||
return musicSearch(str, page, limit).then(function(rawList) {
|
||||
return musicSearch(str, page, limit).then(function(data) {
|
||||
var rawList = data.info || [];
|
||||
var total = data.total || rawList.length * 10;
|
||||
var list = handleSearchResult(rawList);
|
||||
return { list: list, allPage: page + 1, limit: limit, total: list.length * 10, source: 'kg' };
|
||||
return { list: list, allPage: Math.ceil(total / limit), limit: limit, total: total, source: 'kg' };
|
||||
});
|
||||
}
|
||||
|
||||
// ===== 播放链接 =====
|
||||
function getUrl(songInfo, type) {
|
||||
var q = type || '128k';
|
||||
var songId = songInfo.id || '';
|
||||
var ceruKey = process.env.ceru_key || '';
|
||||
function getUrl(songId, quality) {
|
||||
songId = String(songId || '');
|
||||
quality = String(quality || '128k');
|
||||
var ceruKey = CERU_KEY || '';
|
||||
var headers = { 'User-Agent': 'QZMusic/2.0' };
|
||||
if (ceruKey) headers['X-API-Key'] = ceruKey;
|
||||
return requestUrl('https://source.shiqianjiang.cn/api/music/url?source=kg&songId=' + encodeURIComponent(songId) + '&quality=' + encodeURIComponent(q), 'GET', headers)
|
||||
return requestUrl('https://source.shiqianjiang.cn/api/music/url?source=kg&songId=' + encodeURIComponent(songId) + '&quality=' + encodeURIComponent(quality), 'GET', headers)
|
||||
.then(function(res) {
|
||||
if (res.body && typeof res.body === 'object' && res.body.url) return res.body.url;
|
||||
if (res.body && typeof res.body === 'object' && res.body.data && res.body.data.url) return res.body.data.url;
|
||||
@@ -123,13 +139,13 @@ function getUrl(songInfo, type) {
|
||||
|
||||
// ===== 封面图 =====
|
||||
function getPic(songInfo) {
|
||||
if (songInfo.pic) return Promise.resolve(songInfo.pic);
|
||||
if (songInfo && songInfo.pic) return Promise.resolve(songInfo.pic);
|
||||
return Promise.resolve('');
|
||||
}
|
||||
|
||||
// ===== 歌词 =====
|
||||
function getLyric(songInfo) {
|
||||
var hash = songInfo.id || '';
|
||||
var hash = (songInfo && songInfo.id) || '';
|
||||
if (!hash) return Promise.resolve('');
|
||||
return requestUrl('https://krcs.kugou.com/search?ver=1&man=yes&client=mobi&keyword=&duration=&hash=' + encodeURIComponent(hash) + '&album_audio_id=', 'GET', {
|
||||
'User-Agent': 'Mozilla/5.0 (Linux; Android 10)'
|
||||
@@ -179,18 +195,18 @@ var pluginInfo = {
|
||||
info: {
|
||||
id: 'koneko_ceru_kg',
|
||||
name: '酷狗音乐 - Koneko 聆澜',
|
||||
version: '0.1.0',
|
||||
version: '0.1.2',
|
||||
source: 'kg',
|
||||
description: '酷狗音乐音源,基于 CeruMusic musicSdk 搜索 + Ceru 播放接口'
|
||||
},
|
||||
ext: [],
|
||||
env: [{ key: 'ceru_key', name: 'Ceru API Key', description: '聆澜播放接口密钥' }],
|
||||
quality: [
|
||||
{ name: '标准', ui: '标', id: '128k' },
|
||||
{ name: '高品', ui: 'HQ', id: '320k' },
|
||||
{ name: '无损', ui: 'SQ', id: 'flac' }
|
||||
{ name: '标准音质', ui: '标', id: '128k' },
|
||||
{ name: '高品音质', ui: 'HQ', id: '320k' },
|
||||
{ name: '无损音质', ui: 'SQ', id: 'flac' }
|
||||
],
|
||||
supportFunc: []
|
||||
supportFunc: ['search_song', 'search_playlist', 'playlist', 'album', 'lyric']
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
@@ -199,7 +215,7 @@ module.exports = {
|
||||
hotSearch: { getList: hotSearch },
|
||||
leaderboard: { getBoards: leaderboard },
|
||||
songList: songList,
|
||||
artists: singer,
|
||||
singer: singer,
|
||||
album: album,
|
||||
getLyric: getLyric,
|
||||
getPic: getPic,
|
||||
Reference in New Issue
Block a user