Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit 092df9d

Browse files
committed
update version 1.0.14
1 parent 5e71f58 commit 092df9d

File tree

7 files changed

+64
-16
lines changed

7 files changed

+64
-16
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
### Music Player Use ZingMp3 Api
44
[https://github.com/phamhiep2506/music-player](https://github.com/phamhiep2506/music-player)
55

6-
### Demo
7-
[https://music-player-pink.vercel.app](https://music-player-pink.vercel.app)
8-
96
### ⚠️ Please create server use module **zingmp3-api-full** + **Node.js** + **Express.js**
107

118
### Based module [ZingMp3API](https://github.com/whoant/ZingMp3API). Thank whoant 😘
@@ -90,6 +87,13 @@ ZingMp3.getArtist("sontungmtp").then((data) => {
9087
})
9188
```
9289
90+
### Get List Song Artist
91+
> param {id, page, count}
92+
```javascript
93+
ZingMp3.getListArtistSong("IWZ9ZD8A", "1", "15").then((data) => {
94+
console.log(data)
95+
})
96+
```
9397
### Get Lyric Song
9498
> param {id}
9599
```javascript

dist/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ declare class ZingMp3Api {
2121
getChartHome(): Promise<any>;
2222
getNewReleaseChart(): Promise<any>;
2323
getInfoSong(songId: string): Promise<any>;
24+
getListArtistSong(artistId: string, page: string, count: string): Promise<any>;
2425
getArtist(name: string): Promise<any>;
2526
getLyric(songId: string): Promise<any>;
2627
search(name: string): Promise<any>;

dist/index.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js

Lines changed: 26 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "zingmp3-api-full",
3-
"version": "1.0.13",
3+
"version": "1.0.14",
44
"description": "zingmp3-api-full",
55
"main": "dist/index.js",
66
"types": "dist",

src/index.ts

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,13 @@ class ZingMp3Api {
7272
axios.get(`${this.URL}`)
7373
.then((res) => {
7474
// TODO: Skip Error Object is possibly 'undefined'
75-
res.headers["set-cookie"].map((element, index) => {
76-
if(index == 1) {
77-
resolve(element) // return cookie
78-
}
79-
})
75+
if(res.headers["set-cookie"]) {
76+
res.headers["set-cookie"].map((element, index) => {
77+
if(index == 1) {
78+
resolve(element) // return cookie
79+
}
80+
})
81+
}
8082
})
8183
.catch((err) => {
8284
rejects(err) // return error value if any
@@ -233,6 +235,26 @@ class ZingMp3Api {
233235
})
234236
}
235237

238+
public getListArtistSong(artistId: string, page: string, count: string): Promise<any> {
239+
return new Promise<any>((resolve, rejects) => {
240+
this.requestZingMp3("/api/v2/song/get/list", {
241+
id: artistId,
242+
type: "artist",
243+
page: page,
244+
count: count,
245+
sort: "new",
246+
sectionId: "aSong",
247+
sig: this.hashListMV("/api/v2/song/get/list", artistId, "artist", page, count)
248+
})
249+
.then((res) => {
250+
resolve(res)
251+
})
252+
.catch((err) => {
253+
rejects(err)
254+
})
255+
})
256+
}
257+
236258
// getArtist
237259
public getArtist(name: string): Promise<any> {
238260
return new Promise<any>((resolve, rejects) => {

0 commit comments

Comments
 (0)