mirror of
				https://git.unlock-music.dev/um/web.git
				synced 2025-11-04 15:33:28 +08:00 
			
		
		
		
	Write meta for qq music mp3
This commit is contained in:
		
							parent
							
								
									6b1c08663a
								
							
						
					
					
						commit
						e2d4283003
					
				@ -76,12 +76,14 @@ export async function Decrypt(file, raw_filename, raw_ext) {
 | 
				
			|||||||
            if (imageInfo.url !== "") {
 | 
					            if (imageInfo.url !== "") {
 | 
				
			||||||
                imgUrl = imageInfo.url
 | 
					                imgUrl = imageInfo.url
 | 
				
			||||||
                if (ext === "mp3") {
 | 
					                if (ext === "mp3") {
 | 
				
			||||||
                    let writer = new ID3Writer(audioData)
 | 
					                    let writer = new ID3Writer(musicDecoded)
 | 
				
			||||||
                    writer.setFrame('APIC', {
 | 
					                    writer.setFrame('APIC', {
 | 
				
			||||||
                        type: 3,
 | 
					                        type: 3,
 | 
				
			||||||
                        data: imageInfo.buffer,
 | 
					                        data: imageInfo.buffer,
 | 
				
			||||||
                        description: "Cover",
 | 
					                        description: "Cover",
 | 
				
			||||||
                    })
 | 
					                    })
 | 
				
			||||||
 | 
					                    writer.addTag();
 | 
				
			||||||
 | 
					                    musicDecoded = writer.arrayBuffer
 | 
				
			||||||
                    musicBlob = new Blob([musicDecoded], {type: mime});
 | 
					                    musicBlob = new Blob([musicDecoded], {type: mime});
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
@ -133,11 +135,12 @@ async function queryAlbumCoverImage(artist, title, album) {
 | 
				
			|||||||
        jsonpData = await RequestJsonp(song_query_url, "callback");
 | 
					        jsonpData = await RequestJsonp(song_query_url, "callback");
 | 
				
			||||||
        queriedSong = jsonpData["data"]["song"]["list"][0];
 | 
					        queriedSong = jsonpData["data"]["song"]["list"][0];
 | 
				
			||||||
    } catch (e) {
 | 
					    } catch (e) {
 | 
				
			||||||
 | 
					        console.log(e)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    let imgUrl = "";
 | 
					    let imgUrl = "";
 | 
				
			||||||
    if (!!queriedSong && !!queriedSong["album"]) {
 | 
					    if (!!queriedSong && !!queriedSong["album"]) {
 | 
				
			||||||
        if (queriedSong["album"]["pmid"] !== undefined) {
 | 
					        if (queriedSong["album"]["pmid"] !== undefined) {
 | 
				
			||||||
            imgUrl = "https://stats.ixarea.com/collect/qq-cover/1/" + queriedSong["album"]["pmid"]
 | 
					            imgUrl = "https://stats.ixarea.com/collect/music/qq-cover/1/" + queriedSong["album"]["pmid"]
 | 
				
			||||||
        } else if (queriedSong["album"]["id"] !== undefined) {
 | 
					        } else if (queriedSong["album"]["id"] !== undefined) {
 | 
				
			||||||
            imgUrl = "https://stats.ixarea.com/collect/music/qq-cover/2/" + queriedSong["album"]["id"]
 | 
					            imgUrl = "https://stats.ixarea.com/collect/music/qq-cover/2/" + queriedSong["album"]["id"]
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user