Change IXarea Api Endpoint

This commit is contained in:
MengYX 2020-07-18 21:58:07 +08:00
parent 438383979d
commit 62e36ef228
No known key found for this signature in database
GPG Key ID: E63F9C7303E8F604
3 changed files with 15 additions and 6 deletions

View File

@ -62,6 +62,7 @@
import preview from "./component/preview"
import {DownloadBlobMusic, RemoveBlobMusic} from "./component/util"
import config from "../package"
import {IXAREA_API_ENDPOINT} from "./decrypt/util";
export default {
name: 'app',
@ -91,7 +92,7 @@
if (!!mask) mask.remove();
let updateInfo;
try {
const resp = await fetch("https://stats.ixarea.com/collect/music/app-version", {
const resp = await fetch(IXAREA_API_ENDPOINT + "/music/app-version", {
method: "POST", headers: {"Content-Type": "application/json"},
body: JSON.stringify({"Version": this.version})
});

View File

@ -1,4 +1,12 @@
import {AudioMimeType, DetectAudioExt, GetArrayBuffer, GetFileInfo, GetMetaCoverURL, GetWebImage} from "./util";
import {
AudioMimeType,
DetectAudioExt,
GetArrayBuffer,
GetFileInfo,
GetMetaCoverURL,
GetWebImage,
IXAREA_API_ENDPOINT
} from "./util";
import {QmcMaskCreate58, QmcMaskDetectMflac, QmcMaskDetectMgg, QmcMaskGetDefault} from "./qmcMask";
import {fromByteArray as Base64Encode, toByteArray as Base64Decode} from 'base64-js'
@ -101,7 +109,7 @@ export async function Decrypt(file, raw_filename, raw_ext) {
}
function reportKeyUsage(keyData, maskData, artist, title, album, filename, format) {
fetch("https://stats.ixarea.com/collect/qmcmask/usage", {
fetch(IXAREA_API_ENDPOINT + "/qmcmask/usage", {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify({
@ -113,7 +121,7 @@ function reportKeyUsage(keyData, maskData, artist, title, album, filename, forma
async function queryKeyInfo(keyData, filename, format) {
try {
const resp = await fetch("https://stats.ixarea.com/collect/qmcmask/query", {
const resp = await fetch(IXAREA_API_ENDPOINT + "/qmcmask/query", {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify({Format: format, Key: Base64Encode(keyData), Filename: filename, Type: 44}),
@ -126,8 +134,7 @@ async function queryKeyInfo(keyData, filename, format) {
}
async function queryAlbumCoverImage(artist, title, album) {
//https://stats.ixarea.com/collect
const song_query_url = "http://localhost:6580/music/qq-cover"
const song_query_url = IXAREA_API_ENDPOINT + "/music/qq-cover"
try {
const resp = await fetch(song_query_url, {
method: "POST",

View File

@ -16,6 +16,7 @@ export const AudioMimeType = {
wma: "audio/x-ms-wma",
wav: "audio/x-wav"
};
export const IXAREA_API_ENDPOINT = "https://stats.ixarea.com/apis"
// Also a new draft API: blob.arrayBuffer()
export async function GetArrayBuffer(blobObject) {