Skip to content

Commit

Permalink
更新音乐uel获取
Browse files Browse the repository at this point in the history
  • Loading branch information
MakcRe committed Aug 27, 2023
1 parent 1c152de commit d2b3e08
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
4 changes: 2 additions & 2 deletions module/lyric.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ module.exports = (params, useAxios) => {

return new Promise((resolve, reject) => {
useAxios({
baseURL: 'https://lyrics.kugou.com',
url: '/download',
baseURL: 'https://lyrics.kugou.com',
url: '/download',
method: 'GET',
params: dataMap,
cookie: params?.cookie || {},
Expand Down
24 changes: 23 additions & 1 deletion module/song_url.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
// 获取音乐urls
// quality 支持 魔法音乐
// piano 钢琴
// acappella 人声 伴奏 分离
// subwoofer 乐器
// ancient 尤克里里
// dj dj
module.exports = (params, useAxios) => {
const quality = ['piano', 'acappella', 'subwoofer', 'ancient', 'dj'].includes(params.quality) ? `magic_${params?.quality}` : params.quality;

const dataMap = {
album_audio_id: Number(params.album_audio_id ?? 0),
area_code: 1,
hash: params?.hash || '',
vipType: params?.cookie?.vip_type || params?.vipType || 0, // 该参数不影响url获取
vipToken: params?.cookie?.vip_token || params?.vipToken || '', // 该参数不影响url获取
Expand All @@ -10,15 +20,27 @@ module.exports = (params, useAxios) => {
version: 9541,
pidversion: 3001,
IsFreePart: params?.free_part ? 1 : 0, //是否返回试听部分(仅部分歌曲)
album_id: Number(params.album_id ?? 0),
ssa_flag: 'is_fromtrack',
version: 11709,
page_id: 151369488,
quality: quality || 128,
pid: 2,
cmd: 26,
ppage_id: '463467626,350369493,788954147',
cdnBackup: 1,
kcard: 0,
module: 'collection',
};

return useAxios({
url: '/v3/url',
url: '/v5/url',
method: 'GET',
params: dataMap,
encryptType: 'android',
headers: { 'x-router': 'tracker.kugou.com' },
encryptKey: true,
notSign: true,
cookie: params?.cookie || {},
});
};

0 comments on commit d2b3e08

Please sign in to comment.