This commit is contained in:
bietiaop
2025-02-14 21:26:16 +08:00
parent c88a68c9a8
commit df3e302a9d

View File

@@ -1,19 +1,21 @@
import { PlayMode } from '@/const/enum' import { PlayMode } from '@/const/enum'
import WebUIManager from '@/controllers/webui_manager'
import type { import type {
FinalMusic, FinalMusic,
Music163ListResponse, Music163ListResponse,
Music163URLResponse Music163URLResponse
} from '@/types/music' } from '@/types/music'
import WebUIManager from '@/controllers/webui_manager'
/** /**
* 获取网易云音乐歌单 * 获取网易云音乐歌单
* @param id 歌单id * @param id 歌单id
* @returns 歌单信息 * @returns 歌单信息
*/ */
export const get163MusicList = async (id: string) => { export const get163MusicList = async (id: string) => {
let res = await WebUIManager.proxy<Music163ListResponse>('https://wavesgame.top/playlist/track/all?id=' + id); let res = await WebUIManager.proxy<Music163ListResponse>(
'https://wavesgame.top/playlist/track/all?id=' + id
)
// const res = await request.get<Music163ListResponse>( // const res = await request.get<Music163ListResponse>(
// `https://wavesgame.top/playlist/track/all?id=${id}` // `https://wavesgame.top/playlist/track/all?id=${id}`
// ) // )
@@ -71,7 +73,7 @@ export const get163MusicListSongs = async (id: string) => {
if (songURL) { if (songURL) {
finalMusic.push({ finalMusic.push({
id: song.id, id: song.id,
url: songURL, url: songURL.replace(/http:\/\//, '//').replace(/https:\/\//, '//'),
title: song.name, title: song.name,
artist: song.ar.map((p) => p.name).join('/'), artist: song.ar.map((p) => p.name).join('/'),
cover: song.al.picUrl cover: song.al.picUrl