Skip to content

NIP-94: Add optional 'download' flag - #645

Open
michaelhall923 wants to merge 3 commits into
nostr-protocol:masterfrom
michaelhall923:patch-2
Open

NIP-94: Add optional 'download' flag#645
michaelhall923 wants to merge 3 commits into
nostr-protocol:masterfrom
michaelhall923:patch-2

Conversation

@michaelhall923

Copy link
Copy Markdown
Contributor

In Stemstr, we have notes that present the same audio file as both a downloadable wav file and a streamable m3u8. We would like other clients to know that the wav is meant to be downloaded and the m3u8 is meant to be played inline.

The proposed change is adding a "download" flag to NIP-94 to signal this intent.

In Stemstr, we have notes that present the same audio file as both a downloadable wav file and a streamable m3u8. We would like other clients to know that the wav is meant to be downloaded and the m3u8 is meant to be played inline.

The proposed change is adding a "download" flag to NIP-94 to signal this intent.
@arthurfranca

Copy link
Copy Markdown
Contributor

I think it is a good addition and is similar to HTTP Content-Disposition header that is either "inline" or "attachment", so download tag "0" or "1".

@michaelhall923

Copy link
Copy Markdown
Contributor Author

Didn't know about that header. This might be redundant if we can just set a Content-Disposition header. I guess the question is are clients likely to honor that header?

@arthurfranca

arthurfranca commented Jul 8, 2023

Copy link
Copy Markdown
Contributor

Browsers honor it but custom clients may not. And a NIP-94 event received by websocket won't have a header.

If you were thinking of using urls directly instead of NIP-94, you could use NIP-54 - Inline Resource Metadata that accepts all NIP-94 tags and make an url like https://xyz.com/example.wav#download=1 which clients would know it is to be downloaded without needing to request the file to learn the header.

So it's good to add it to NIP-94 so to make it available to NIP-54.

@vitorpamplona

vitorpamplona commented Jul 18, 2023

Copy link
Copy Markdown
Collaborator

I would invert this. I'd keep the wav in the url tag, to avoid having to modify how to hash/verify the file, and use the tag ["streaming", "<url>"] for the less common m3u8 file which cannot be verified with the hash. Clients supporting streaming protocols can use streaming and keep url as a fallback.

Comment thread 94.md
* `magnet` (optional) URI to magnet file
* `i` (optional) torrent infohash
* `blurhash`(optional) the [blurhash](https://github.com/woltapp/blurhash) to show while the file is being loaded by the client
* `download` (optional) expresses that this file is intended to be presented as a download link, rather than played inline. Client's may choose to ignore this. Use "1" for true, "0" for false.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about the tag being present instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that makes sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants