refactor(api)!: 平台 id 收尾统一——migu→mg、apple→ap
补上最后两个多字母 id,至此 15 个平台对外 id 全部为两字母: kw kg tx wy qs xm me qt lr mg bd jx bl 5s ap **破坏性变更**:id 出现在所有 URL、/sources 返回以及 data/auth.json 的 凭据键里,咪咕与 Apple Music 已存的登录态会失效,需重新登录。 - sdk/index.ts:id 与 supportQuality 映射键(展示名 `咪咕音乐` / `Apple Music` 保持不动) - sdk/types.ts:Source 联合类型 - src/routes.ts:/stream 的 enum ['qs','migu'] → ['qs','mg'],以及 /url/mg、/stream/mg 等路径与 schema 描述 - src/http/migu-stream.ts、src/routes-login.ts、src/server.ts - test/smoke-test.ts、README.md、docs/API.md 同步 有意未改:域名与 API 路径(music.migu.cn、music.apple.com、 amp-api.music.apple.com、/v1/catalog/cn/apple-curators/…)、 标识符(registerMiguStream、appleAmpGet、APPLE_AMP_API_URL 等)、 sdk/migu 与 sdk/apple 的目录与文件名、错误文案里的平台名。 验证:typecheck ✓、pnpm test 112/112 ✓;另起临时实例实证 /sources (15/15 平台 id 与展示名全对)与 /login/status,旧 id 零残留。
This commit is contained in:
1 parent
3381e9b906
commit
1b972ec4dd
20 files changed
+106
-106
No files matched your search
+3
-3
@@ -38,7 +38,7 @@ const ENCRYPTED_APP_CODE = Buffer.from([
|
||||
])
|
||||
|
||||
export const getMiguCookie = (): string => {
|
||||
const cred = getCredentials('migu') as { cookie?: string } | null
|
||||
const cred = getCredentials('mg') as { cookie?: string } | null
|
||||
return String(cred?.cookie ?? '').trim()
|
||||
}
|
||||
|
||||
@@ -269,7 +269,7 @@ export interface MiguSong {
|
||||
payPlay?: boolean
|
||||
/** 源特有元数据(取流/歌词需要):contentId/resourceType/formatType/copyrightId/songId/albumId */
|
||||
extra: Record<string, string>
|
||||
source: 'migu'
|
||||
source: 'mg'
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
@@ -369,7 +369,7 @@ export const convertItemToSong = (item: MiguSongItem, allowPaid = true): MiguSon
|
||||
payPlay: isVIP,
|
||||
// 路由/取流需要 content_id|resource_type|format_type 三元组与版权号,放在 extra 里
|
||||
extra: { ...extra, link: miguSongLink(linkID) },
|
||||
source: 'migu',
|
||||
source: 'mg',
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user