diff --git a/src/mscz.ts b/src/mscz.ts index e12f308..9bce25c 100644 --- a/src/mscz.ts +++ b/src/mscz.ts @@ -6,9 +6,11 @@ let msczBufferP: Promise | undefined export const fetchMscz = async (): Promise => { if (!msczBufferP) { - const url = scoreinfo.msczUrl + const url = scoreinfo.msczCidUrl msczBufferP = (async (): Promise => { - const r = await fetch(url) + const r0 = await fetch(url) + const { Cid: { '/': cid } } = await r0.json() + const r = await fetch(`https://ipfs.infura.io/ipfs/${cid as string}`) const data = await r.arrayBuffer() return data })() diff --git a/src/scoreinfo.ts b/src/scoreinfo.ts index ac28a77..fa8bb18 100644 --- a/src/scoreinfo.ts +++ b/src/scoreinfo.ts @@ -71,8 +71,8 @@ export const scoreinfo = { return `/ipns/${IPNS_KEY}/${this.id}.mscz` }, - get msczUrl (this: typeof scoreinfo): string { - return `https://ipfs.infura.io:5001/api/v0/cat?arg=${this.msczIpfsRef}` + get msczCidUrl (this: typeof scoreinfo): string { + return `https://ipfs.infura.io:5001/api/v0/dag/resolve?arg=${this.msczIpfsRef}` }, get sheetImgType (): 'svg' | 'png' {