Skip to content

Commit

Permalink
fix: kuwo search api error
Browse files Browse the repository at this point in the history
  • Loading branch information
listen1 committed Jul 13, 2023
1 parent 1b57938 commit 85cd58f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions js/provider/kuwo.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
/* eslint-disable no-unused-vars */
/* global async getParameterByName isElectron */
class kuwo {
static forgeMD5(message) {
return forge.md5
.create()
.update(forge.util.encodeUtf8(message))
.digest()
.toHex();
}

// Convert html code
static html_decode(str) {
let text = str;
Expand Down Expand Up @@ -165,7 +173,7 @@ class kuwo {
isRetryValue = isRetry;
}
const domain = 'https://www.kuwo.cn';
const name = 'kw_token';
const name = 'Hm_token';

cookieGet(
{
Expand All @@ -191,7 +199,7 @@ class kuwo {
axios
.get(url, {
headers: {
csrf: token,
Cross: this.forgeMD5(token),
},
})
.then((response) => {
Expand All @@ -201,7 +209,7 @@ class kuwo {
axios
.get(url, {
headers: {
csrf: token2,
Cross: this.forgeMD5(token2),
},
})
.then((res) => {
Expand Down

0 comments on commit 85cd58f

Please sign in to comment.