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

Commit

Permalink
update getHome
Browse files Browse the repository at this point in the history
  • Loading branch information
phamhiep2506 committed Jun 23, 2022
1 parent 171d5b2 commit 5e71f58
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 19 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,9 @@ ZingMp3.getDetailPlaylist("ZWZB969E").then((data) => {
```
### Get Home
> param {page} : 1, 2, 3, 4...
```javascript
ZingMp3.getHome("1").then((data) => {
ZingMp3.getHome().then((data) => {
console.log(data)
})
```
Expand Down Expand Up @@ -129,4 +128,4 @@ ZingMp3.getCategoryMV("IWZ9Z08I").then((data) => {
ZingMp3.getVideo("ZWEW9WI8").then((data) => {
console.log(data)
})
```
```
2 changes: 1 addition & 1 deletion dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ declare class ZingMp3Api {
private requestZingMp3;
getSong(songId: string): Promise<any>;
getDetailPlaylist(playlistId: string): Promise<any>;
getHome(page: string): Promise<any>;
getHome(): Promise<any>;
getTop100(): Promise<any>;
getChartHome(): Promise<any>;
getNewReleaseChart(): Promise<any>;
Expand Down
2 changes: 1 addition & 1 deletion dist/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zingmp3-api-full",
"version": "1.0.12",
"version": "1.0.13",
"description": "zingmp3-api-full",
"main": "dist/index.js",
"types": "dist",
Expand Down
13 changes: 7 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ class ZingMp3Api {
)
}

private hashParamHome(path: string, page: string) {
private hashParamHome(path: string) {
return this.getHmac512(
path + this.getHash256(`ctime=${this.CTIME}page=${page}version=${this.VERSION}`),
path + this.getHash256(`count=30ctime=${this.CTIME}page=1version=${this.VERSION}`),
this.SECRET_KEY
)
}
Expand Down Expand Up @@ -155,12 +155,13 @@ class ZingMp3Api {
}

// getHome
public getHome(page: string): Promise<any> {
public getHome(): Promise<any> {
return new Promise<any>((resolve, rejects) => {
this.requestZingMp3("/api/v2/page/get/home", {
page: page,
page: 1,
segmentId: "-1",
sig: this.hashParamHome("/api/v2/page/get/home", page)
count: "30",
sig: this.hashParamHome("/api/v2/page/get/home")
})
.then((res) => {
resolve(res)
Expand Down Expand Up @@ -337,7 +338,7 @@ class ZingMp3Api {

// instance default
export const ZingMp3 = new ZingMp3Api(
"1.5.4", // VERSION
"1.6.34", // VERSION
"https://zingmp3.vn", // URL
"2aa2d1c561e809b267f3638c4a307aab", // SECRET_KEY
"88265e23d4284f25963e6eedac8fbfa3", // API_KEY
Expand Down

0 comments on commit 5e71f58

Please sign in to comment.