Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: qq music play error #1163

Merged
merged 1 commit into from
Dec 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions js/provider/qq.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,8 @@ class qq {
const songmidList = [songId];
const uin = '0';

const fileType = '320';
// server won't response with 320kbps request, downgrade to 128kbps
const fileType = '128';
const fileConfig = {
m4a: {
s: 'C400',
Expand Down Expand Up @@ -458,7 +459,7 @@ class qq {
`${fileInfo.s}${songId}${songId}${fileInfo.e}`;

const reqData = {
req_0: {
req_1: {
module: 'vkey.GetVkeyServer',
method: 'CgiGetVkey',
param: {
Expand All @@ -479,20 +480,16 @@ class qq {
cv: 0,
},
};
const params = {
format: 'json',
data: JSON.stringify(reqData),
};
axios.get(target_url, { params }).then((response) => {
axios.post(target_url, reqData).then((response) => {
const { data } = response;
const { purl } = data.req_0.data.midurlinfo[0];
const { purl } = data.req_1.data.midurlinfo[0];

if (purl === '') {
// vip
failure(sound);
return;
}
const url = data.req_0.data.sip[0] + purl;
const url = data.req_1.data.sip[0] + purl;
sound.url = url;
const prefix = purl.slice(0, 4);
const found = Object.values(fileConfig).filter((i) => i.s === prefix);
Expand Down
Loading