migu-api-enhanced 2.9.0 → 2.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -13,6 +13,17 @@
13
13
 
14
14
  ## API 接口
15
15
 
16
+ - **搜索** - 歌曲、歌手、专辑、MV、歌词、短视频、彩铃、演唱会、票务、热门搜索、搜索建议
17
+ - **专辑** - 详情、歌曲列表
18
+ - **歌单** - 信息、列表歌曲、歌单广场、电台歌曲列表
19
+ - **歌手** - 歌手信息、歌手歌曲、歌手专辑、相似歌手
20
+ - **播放地址** - 多版本播放地址接口(v1/v2/h5v2.4)
21
+ - **推荐** - 歌曲、歌单、相似歌曲、电台
22
+ - **MV** - MV 详情、MV 推荐、MV 播放地址(mp4 & m3u8)
23
+ - **资源** - 获取歌词、资源信息、播放次数、检查可听性
24
+ - **用户** - 用户信息、我喜欢、收藏、自建歌单管理
25
+ - **登录认证** - 手机号登录、短信登录、一键登录
26
+
16
27
  更新于 [API 文档](https://domdkw.github.io/miguMusic-api-enhanced/)
17
28
 
18
29
  ## 特性
@@ -110,6 +121,9 @@ npm install migu-api-enhanced
110
121
  ```ts
111
122
  import { getAlbumInfo, getUrlV2 } from 'migu-api-enhanced';
112
123
  const album = await getAlbumInfo('1123');
124
+ // or
125
+ import * as migu from 'migu-api-enhanced';
126
+ const album = await migu.getAlbumInfo('1123');
113
127
  ```
114
128
  ### 方式二:`createClient` 工厂函数
115
129
  ```ts
package/dist/index.cjs CHANGED
@@ -46,6 +46,10 @@ __export(index_exports, {
46
46
  getAlbumSong: () => getAlbumSong,
47
47
  getColumnInfo: () => getColumnInfo,
48
48
  getComment: () => getComment,
49
+ getConcertComment: () => getConcertComment,
50
+ getConcertDetail: () => getConcertDetail,
51
+ getConcertInfo: () => getConcertInfo,
52
+ getConcertUrl: () => getConcertUrl,
49
53
  getDeviceId: () => getDeviceId,
50
54
  getLyric: () => getLyric,
51
55
  getMVRecommend: () => getMVRecommend,
@@ -72,6 +76,7 @@ __export(index_exports, {
72
76
  getSVideoSearchSuggest: () => getSVideoSearchSuggest,
73
77
  getSVideoUrl: () => getSVideoUrl,
74
78
  getSVideoUserContent: () => getSVideoUserContent,
79
+ getSVideoUserInfo: () => getSVideoUserInfo,
75
80
  getSceneRecommend: () => getSceneRecommend,
76
81
  getSearchDefault: () => getSearchDefault,
77
82
  getSearchHot: () => getSearchHot,
@@ -134,6 +139,10 @@ __export(modules_exports, {
134
139
  getAlbumSong: () => getAlbumSong,
135
140
  getColumnInfo: () => getColumnInfo,
136
141
  getComment: () => getComment,
142
+ getConcertComment: () => getConcertComment,
143
+ getConcertDetail: () => getConcertDetail,
144
+ getConcertInfo: () => getConcertInfo,
145
+ getConcertUrl: () => getConcertUrl,
137
146
  getLyric: () => getLyric,
138
147
  getMVRecommend: () => getMVRecommend,
139
148
  getMvHls: () => getMvHls,
@@ -158,6 +167,7 @@ __export(modules_exports, {
158
167
  getSVideoSearchSuggest: () => getSVideoSearchSuggest,
159
168
  getSVideoUrl: () => getSVideoUrl,
160
169
  getSVideoUserContent: () => getSVideoUserContent,
170
+ getSVideoUserInfo: () => getSVideoUserInfo,
161
171
  getSceneRecommend: () => getSceneRecommend,
162
172
  getSearchDefault: () => getSearchDefault,
163
173
  getSearchHot: () => getSearchHot,
@@ -1542,6 +1552,47 @@ var removeSongFromMyList = async (pacmtoken, playlistId, contentId) => {
1542
1552
  return { data: res.data, newPacmToken };
1543
1553
  };
1544
1554
 
1555
+ // src/modules/svideo_userInfo.ts
1556
+ var getSVideoUserInfo = async (type, uid = "", videoUserId = "") => {
1557
+ let url = "https://app.c.nf.migu.cn/resource/video-user";
1558
+ if (type === "uid") {
1559
+ url += `/by-uid/v1.0?uid=${uid}`;
1560
+ } else if (type === "videoUserId") {
1561
+ url += `/by-id/v1.0?videoUserId=${videoUserId}`;
1562
+ } else {
1563
+ return { error: "Invalid parameter type", success: false };
1564
+ }
1565
+ return h5fetch(url);
1566
+ };
1567
+
1568
+ // src/modules/concert_info.ts
1569
+ var getConcertInfo = async (concertId) => {
1570
+ return await h5fetch(`http://c.musicapp.migu.cn/MIGUM2.0/v2.0/content/queryConcertSummary.do?columnId=${concertId}`);
1571
+ };
1572
+
1573
+ // src/modules/concert_url.ts
1574
+ var getConcertUrl = async (concertId, liveId, rateLevel = 1) => {
1575
+ return await h5fetch(
1576
+ `http://c.musicapp.migu.cn/MIGUM2.0/v2.1/danmaku/liveServerHosts.do?concertId=${concertId}&liveId=${liveId}&liveType=1&rateLevel=${rateLevel}`,
1577
+ {
1578
+ headers: {
1579
+ "channel": "0146921"
1580
+ //android client
1581
+ }
1582
+ }
1583
+ );
1584
+ };
1585
+
1586
+ // src/modules/concert_detail.ts
1587
+ var getConcertDetail = async (concertId) => {
1588
+ return await h5fetch(`http://c.musicapp.migu.cn/MIGUM2.0/v2.0/content/queryConcertDetail.do?columnId=${concertId}`);
1589
+ };
1590
+
1591
+ // src/modules/concert_comment.ts
1592
+ var getConcertComment = async (concertId, page = 1, size = 20) => {
1593
+ return await h5fetch(`http://b.musicapp.migu.cn/MIGUM2.0/v1.0/danmaku/danmakuHisListPage.do?page=${page}&pageSize=${size}&resourceId=${concertId}`);
1594
+ };
1595
+
1545
1596
  // src/utils/index.ts
1546
1597
  var utils_exports = {};
1547
1598
  __export(utils_exports, {
@@ -1587,6 +1638,10 @@ function createClient() {
1587
1638
  getAlbumSong,
1588
1639
  getColumnInfo,
1589
1640
  getComment,
1641
+ getConcertComment,
1642
+ getConcertDetail,
1643
+ getConcertInfo,
1644
+ getConcertUrl,
1590
1645
  getDeviceId,
1591
1646
  getLyric,
1592
1647
  getMVRecommend,
@@ -1613,6 +1668,7 @@ function createClient() {
1613
1668
  getSVideoSearchSuggest,
1614
1669
  getSVideoUrl,
1615
1670
  getSVideoUserContent,
1671
+ getSVideoUserInfo,
1616
1672
  getSceneRecommend,
1617
1673
  getSearchDefault,
1618
1674
  getSearchHot,