四个主流平台从「搜索 + 取流」补到能力对齐,新增 playlist/parse (tx、wy 另加 userPlaylist),顺带修掉酷我直链的一个真实缺陷。 - kw:酷我 CDN 回吐的 query 用 `$` 顶替 `=`(`?bitrate$320&format$mp3…`), `$` 非 URL 标准分隔符,播放器与解析器普遍不认,导致拿到直链也放不出声; 统一还原成 `=` 再对外返回 - wy:补齐 album/playlist/parse/userPlaylist,与 kg/tx 能力对齐 - kg/kw/tx:接入 parse(跨平台精确匹配的输入源)与歌单 为什么单独一次提交:这批改动不动架构,只做能力补齐与 URL 规范化, 与新增平台的注册表改动分开,出问题时便于单独回滚。
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import leaderboard from './leaderboard.ts'
|
|
import lyric from './lyric.ts'
|
|
import songList from './songList.ts'
|
|
import musicSearch from './musicSearch.ts'
|
|
import txApi from '../apis/tx.ts'
|
|
import hotSearch from './hotSearch.ts'
|
|
import comment from './comment.ts'
|
|
import singer from './singer.ts'
|
|
import album from './album.ts'
|
|
import playlist from './playlist.ts'
|
|
import parse from './parse.ts'
|
|
import userPlaylist from './userPlaylist.ts'
|
|
|
|
const tx = {
|
|
leaderboard,
|
|
songList,
|
|
musicSearch,
|
|
hotSearch,
|
|
comment,
|
|
singer,
|
|
album,
|
|
playlist,
|
|
parse,
|
|
userPlaylist,
|
|
|
|
getMusicUrl(songInfo, type) {
|
|
return txApi.getMusicUrl(songInfo, type)
|
|
},
|
|
getLyric(songInfo) {
|
|
// let singer = songInfo.singer.indexOf('、') > -1 ? songInfo.singer.split('、')[0] : songInfo.singer
|
|
return lyric.getLyric(songInfo)
|
|
},
|
|
async getPic(songInfo) {
|
|
return `https://y.gtimg.cn/music/photo_new/T002R500x500M000${songInfo.albumId}.jpg`
|
|
},
|
|
getMusicDetailPageUrl(songInfo) {
|
|
return `https://y.qq.com/n/yqq/song/${songInfo.songmid}.html`
|
|
},
|
|
}
|
|
|
|
export default tx
|