ipfs-shipyard / is-ipfs

A set of utilities to help identify IPFS resources on the web
https://www.npmjs.com/package/is-ipfs
Other
127 stars 22 forks source link

returns false for a valid ipfs url/path! #48

Open xylanreeves opened 2 years ago

xylanreeves commented 2 years ago

isIPFS.urlOrPath("ipfs://bafybeihbsysdkemc3kyylegtfopkrcfiih4exnasoql2q36fb4zawlrwhy/volcano.json")

returns false when it is a valid ipfs url/path!

TimDaub commented 2 years ago

yeah I was wondering the same thing. I'm currently crawling Zora's NFT contracts and many image URIs are the IANA ipfs scheme ipfs:// and I can't find a good way of "just" downloading them by looking at the docs. Am I missing something?

Edit: Seems even zora isn't capable of doing this: https://github.com/ourzora/nft-hooks/blob/6f0b9635b196051a5ff1242ebbf8e1335a742f6c/src/fetcher/UriUtils.ts#L5

Edit2: Found ipfs at IANA: https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml

NCGThompson commented 2 years ago

I don't remember where, but I did read somewhere that ipfs:(without the //) and ipfs:/ should also be interpreted as ipfs urls. The same goes for ipns://.

In addition, dweb://ipfs/ and dweb://ipns/ (or something like them) are also ipfs urls.