mirror of
				https://git.unlock-music.dev/um/web.git
				synced 2025-11-04 15:33:28 +08:00 
			
		
		
		
	Change IXarea Api Endpoint
This commit is contained in:
		
							parent
							
								
									438383979d
								
							
						
					
					
						commit
						62e36ef228
					
				@ -62,6 +62,7 @@
 | 
				
			|||||||
    import preview from "./component/preview"
 | 
					    import preview from "./component/preview"
 | 
				
			||||||
    import {DownloadBlobMusic, RemoveBlobMusic} from "./component/util"
 | 
					    import {DownloadBlobMusic, RemoveBlobMusic} from "./component/util"
 | 
				
			||||||
    import config from "../package"
 | 
					    import config from "../package"
 | 
				
			||||||
 | 
					    import {IXAREA_API_ENDPOINT} from "./decrypt/util";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    export default {
 | 
					    export default {
 | 
				
			||||||
        name: 'app',
 | 
					        name: 'app',
 | 
				
			||||||
@ -91,7 +92,7 @@
 | 
				
			|||||||
                if (!!mask) mask.remove();
 | 
					                if (!!mask) mask.remove();
 | 
				
			||||||
                let updateInfo;
 | 
					                let updateInfo;
 | 
				
			||||||
                try {
 | 
					                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"},
 | 
					                        method: "POST", headers: {"Content-Type": "application/json"},
 | 
				
			||||||
                        body: JSON.stringify({"Version": this.version})
 | 
					                        body: JSON.stringify({"Version": this.version})
 | 
				
			||||||
                    });
 | 
					                    });
 | 
				
			||||||
 | 
				
			|||||||
@ -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 {QmcMaskCreate58, QmcMaskDetectMflac, QmcMaskDetectMgg, QmcMaskGetDefault} from "./qmcMask";
 | 
				
			||||||
import {fromByteArray as Base64Encode, toByteArray as Base64Decode} from 'base64-js'
 | 
					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) {
 | 
					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",
 | 
					        method: "POST",
 | 
				
			||||||
        headers: {"Content-Type": "application/json"},
 | 
					        headers: {"Content-Type": "application/json"},
 | 
				
			||||||
        body: JSON.stringify({
 | 
					        body: JSON.stringify({
 | 
				
			||||||
@ -113,7 +121,7 @@ function reportKeyUsage(keyData, maskData, artist, title, album, filename, forma
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
async function queryKeyInfo(keyData, filename, format) {
 | 
					async function queryKeyInfo(keyData, filename, format) {
 | 
				
			||||||
    try {
 | 
					    try {
 | 
				
			||||||
        const resp = await fetch("https://stats.ixarea.com/collect/qmcmask/query", {
 | 
					        const resp = await fetch(IXAREA_API_ENDPOINT + "/qmcmask/query", {
 | 
				
			||||||
            method: "POST",
 | 
					            method: "POST",
 | 
				
			||||||
            headers: {"Content-Type": "application/json"},
 | 
					            headers: {"Content-Type": "application/json"},
 | 
				
			||||||
            body: JSON.stringify({Format: format, Key: Base64Encode(keyData), Filename: filename, Type: 44}),
 | 
					            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) {
 | 
					async function queryAlbumCoverImage(artist, title, album) {
 | 
				
			||||||
    //https://stats.ixarea.com/collect
 | 
					    const song_query_url = IXAREA_API_ENDPOINT + "/music/qq-cover"
 | 
				
			||||||
    const song_query_url = "http://localhost:6580/music/qq-cover"
 | 
					 | 
				
			||||||
    try {
 | 
					    try {
 | 
				
			||||||
        const resp = await fetch(song_query_url, {
 | 
					        const resp = await fetch(song_query_url, {
 | 
				
			||||||
            method: "POST",
 | 
					            method: "POST",
 | 
				
			||||||
 | 
				
			|||||||
@ -16,6 +16,7 @@ export const AudioMimeType = {
 | 
				
			|||||||
    wma: "audio/x-ms-wma",
 | 
					    wma: "audio/x-ms-wma",
 | 
				
			||||||
    wav: "audio/x-wav"
 | 
					    wav: "audio/x-wav"
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					export const IXAREA_API_ENDPOINT = "https://stats.ixarea.com/apis"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Also a new draft API: blob.arrayBuffer()
 | 
					// Also a new draft API: blob.arrayBuffer()
 | 
				
			||||||
export async function GetArrayBuffer(blobObject) {
 | 
					export async function GetArrayBuffer(blobObject) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user