Spaces:
Paused
Paused
File size: 886 Bytes
5ed446f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
import { get_playlist } from "./playlist.js";
import { get_song_url, get_song_info, get_pic } from "./song.js";
import { get_lyric } from "./lyric.js"
const support_type = ['url', 'pic', 'lrc', 'song', 'playlist']
const handle = async (type, id, cookie = '') => {
let result;
switch (type) {
case 'lrc':
result = await get_lyric(id)
break
case 'pic':
result = await get_pic(id)
break
case 'url':
result = await get_song_url(id)
break
case 'song':
result = await get_song_info(id)
break
case 'playlist':
result = await get_playlist(id)
break
default:
return -1;
}
return result
}
export default {
register: (ctx) => {
ctx.register('tencent', { handle, support_type })
}
}
|