fix(kw): expand cover URL detection with more field names and fallback patterns v0.0.2
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* @name 酷我音乐 - Koneko
|
* @name 酷我音乐 - Koneko
|
||||||
* @description 聚合音源插件: 官方搜索 + 多API音源容灾
|
* @description 聚合音源插件: 官方搜索 + 多API音源容灾
|
||||||
* @version 0.0.1
|
* @version 0.0.2
|
||||||
* @author Miao-moe
|
* @author Miao-moe
|
||||||
*
|
*
|
||||||
* 环境变量:
|
* 环境变量:
|
||||||
@@ -102,13 +102,25 @@ var musicSearch = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
var picUrl = ''
|
var picUrl = ''
|
||||||
var albumId = safeGet(info, ['ALBUMID', 'albumid', 'album_id', 'AlbumID'])
|
picUrl = safeGet(info, ['pic', 'image', 'cover', 'web_album_pic', 'album_pic', 'artist_pic', 'web_cover_url'])
|
||||||
|
if (!picUrl || picUrl === '') {
|
||||||
|
var albumId = safeGet(info, ['ALBUMID', 'albumid', 'album_id', 'AlbumID', 'albumId', 'ALBUM_ID', 'coverid', 'coverId'])
|
||||||
if (albumId) {
|
if (albumId) {
|
||||||
picUrl = 'https://img2.kuwo.cn/star/albumcover/300/' + albumId + '.jpg'
|
picUrl = 'https://img2.kuwo.cn/star/albumcover/300/' + albumId + '.jpg'
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (!picUrl || picUrl === '') {
|
||||||
|
var albumId = safeGet(info, ['ALBUMID', 'albumid', 'album_id', 'AlbumID', 'albumId', 'ALBUM_ID', 'coverid', 'coverId'])
|
||||||
|
if (albumId) {
|
||||||
|
picUrl = 'http://img.kuwo.cn/star/albumcover/300/' + albumId + '.jpg'
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!picUrl || picUrl === '') {
|
if (!picUrl || picUrl === '') {
|
||||||
picUrl = 'http://artistpicserver.kuwo.cn/pic.web?corp=kuwo&type=rid_pic&pictype=500&size=500&rid=MUSIC_' + songId
|
picUrl = 'http://artistpicserver.kuwo.cn/pic.web?corp=kuwo&type=rid_pic&pictype=500&size=500&rid=MUSIC_' + songId
|
||||||
}
|
}
|
||||||
|
if (!picUrl || picUrl === '') {
|
||||||
|
picUrl = 'https://img.kuwo.cn/star/albumcover/300/' + songId + '.jpg'
|
||||||
|
}
|
||||||
var artistStr = safeGet(info, ['ARTIST', 'artist', 'singer', 'author'])
|
var artistStr = safeGet(info, ['ARTIST', 'artist', 'singer', 'author'])
|
||||||
if (artistStr) artistStr = String(artistStr).replace(/&/g, '、')
|
if (artistStr) artistStr = String(artistStr).replace(/&/g, '、')
|
||||||
var duration = parseInt(safeGet(info, ['DURATION', 'duration', 'Duration', 'time'])) || 0
|
var duration = parseInt(safeGet(info, ['DURATION', 'duration', 'Duration', 'time'])) || 0
|
||||||
@@ -351,7 +363,7 @@ function musicDetail(id) { return Promise.resolve(null) }
|
|||||||
function musicInfo(id) { return Promise.resolve(null) }
|
function musicInfo(id) { return Promise.resolve(null) }
|
||||||
|
|
||||||
var pluginInfo = {
|
var pluginInfo = {
|
||||||
info: { id: 'koneko_kw', name: '酷我音乐 - Koneko', version: '0.0.1', description: '酷我音乐聚合音源插件,官方搜索+多API音源,自动测速容灾切换' },
|
info: { id: 'koneko_kw', name: '酷我音乐 - Koneko', version: '0.0.2', description: '酷我音乐聚合音源插件,官方搜索+多API音源,自动测速容灾切换' },
|
||||||
env: [{ key: 'ceru_key', name: '聆澜API Key', description: '聆澜音源API密钥,留空则跳过聆澜音源' }],
|
env: [{ key: 'ceru_key', name: '聆澜API Key', description: '聆澜音源API密钥,留空则跳过聆澜音源' }],
|
||||||
ext: [],
|
ext: [],
|
||||||
quality: [
|
quality: [
|
||||||
|
|||||||
Reference in New Issue
Block a user