From 824d0b7eacceed0dd4ae3d3a4225f6c9722d05c2 Mon Sep 17 00:00:00 2001 From: kieran Date: Sun, 14 Apr 2024 18:22:01 +0100 Subject: [PATCH 1/5] torrents --- 35.md | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 35.md diff --git a/35.md b/35.md new file mode 100644 index 00000000..878e9357 --- /dev/null +++ b/35.md @@ -0,0 +1,61 @@ +NIP-35 +====== + +Torrents +----------- + +`draft` `optional` + +This NIP defined a new `kind 2003` which is Torrent. + +`kind 2003` is a simple torrent index where there is enough information to search for content and construct the magnet link. No torrent files exist on nostr. + +## Tags +- `btih`: V1 BitTorrent Info Hash, as seen in the [magnet link](https://www.bittorrent.org/beps/bep_0053.html) `magnet:?xt=urn:btih:HASH` +- `file`: A file entry inside the torrent, including the full path ie. `info/example.txt` + +In order to make torrents searchable by general category, you SHOULD include a few tags like `movie`, `tv`, `HD`, `UHD` etc. + +## Tag prefixes + +Tag prefixes are used to label the content with references, ie. `["t", "imdb:1234"]` + +- `tcat`: A comma separated text category path, ie. `["t", "tcat:video,movie,4k"]`, this should also match the `newznab` category in a best effort approach. +- `newznab`: The category ID from [newznab](https://github.com/Prowlarr/Prowlarr/blob/develop/src/NzbDrone.Core/Indexers/NewznabStandardCategory.cs) +- `tmdb`: [The movie database](https://www.themoviedb.org/) id. +- `ttvdb`: [TV database](https://thetvdb.com/) id. +- `imdb`: [IMDB](https://www.imdb.com/) id. +- `mal`: [MyAnimeList](https://myanimelist.net/) id. +- `anilist`: [AniList](https://anilist.co/) id. + +A second level prefix should be included where the database supports multiple media types. +- `tmdb:movie:693134` maps to `themoviedb.org/movie/693134` +- `ttvdb:movie:290272` maps to `thetvdb.com/movies/dune-part-two` +- `mal:anime:9253` maps to `myanimelist.net/anime/9253` +- `mal:manga:17517` maps to `myanimelist.net/manga/17517` + +In some cases the url mapping isnt direct, mapping the url in general is out of scope for this NIP, the section above is only a guide so that implementers have enough information to succsesfully map the url if they wish. + +```json +{ + "kind": 2003,› + "content": "", + "tags": [ + ["title", ""], + ["btih", ""], + ["file", "", ""], + ["file", "", ""], + ["t", "tcat:video,movie,4k"], + ["t", "newznab:2045"], + ["t", "imdb:tt15239678"], + ["t", "tmdb:movie:693134"], + ["t", "ttvdb:movie:290272"], + ["t", "movie"], + ["t", "4k"], + ] +} +``` + +## Implementations +1. [dtan.xyz](https://git.v0l.io/Kieran/dtan) +2. [nostrudel.ninja](https://github.com/hzrd149/nostrudel/tree/next/src/views/torrents) \ No newline at end of file From 021a8f5bc7fd64ce701f7b57e9a79ee5d1387834 Mon Sep 17 00:00:00 2001 From: kieran Date: Sun, 14 Apr 2024 18:23:41 +0100 Subject: [PATCH 2/5] remove weird char --- 35.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/35.md b/35.md index 878e9357..33ed2beb 100644 --- a/35.md +++ b/35.md @@ -38,7 +38,7 @@ In some cases the url mapping isnt direct, mapping the url in general is out of ```json { - "kind": 2003,› + "kind": 2003, "content": "", "tags": [ ["title", ""], From 33d173b1c9122a26c36c1d0671e3008906966c20 Mon Sep 17 00:00:00 2001 From: kieran Date: Thu, 18 Apr 2024 09:40:20 +0100 Subject: [PATCH 3/5] Add comments / make infohash indexed like NIP94 --- 35.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/35.md b/35.md index 33ed2beb..4e80e3e5 100644 --- a/35.md +++ b/35.md @@ -6,13 +6,14 @@ Torrents `draft` `optional` -This NIP defined a new `kind 2003` which is Torrent. +This NIP defined a new `kind 2003` which is a Torrent. `kind 2003` is a simple torrent index where there is enough information to search for content and construct the magnet link. No torrent files exist on nostr. ## Tags -- `btih`: V1 BitTorrent Info Hash, as seen in the [magnet link](https://www.bittorrent.org/beps/bep_0053.html) `magnet:?xt=urn:btih:HASH` +- `i`: V1 BitTorrent Info Hash, as seen in the [magnet link](https://www.bittorrent.org/beps/bep_0053.html) `magnet:?xt=urn:btih:HASH` - `file`: A file entry inside the torrent, including the full path ie. `info/example.txt` +- `tracker`: (Optional) A tracker to use for this torrent In order to make torrents searchable by general category, you SHOULD include a few tags like `movie`, `tv`, `HD`, `UHD` etc. @@ -36,15 +37,17 @@ A second level prefix should be included where the database supports multiple me In some cases the url mapping isnt direct, mapping the url in general is out of scope for this NIP, the section above is only a guide so that implementers have enough information to succsesfully map the url if they wish. -```json +```jsonc { "kind": 2003, "content": "", "tags": [ ["title", ""], - ["btih", ""], + ["i", ""], ["file", "", ""], ["file", "", ""], + ["tracker", "udp://mytacker.com:1337"], + ["tracker", "http://1337-tracker.net/announce"], ["t", "tcat:video,movie,4k"], ["t", "newznab:2045"], ["t", "imdb:tt15239678"], @@ -56,6 +59,12 @@ In some cases the url mapping isnt direct, mapping the url in general is out of } ``` +## Torrent Comments + +A torrent comment is a `kind 2004` event which is used to reply to a torrent event. + +This event works exactly like a `kind 1` and should follow `NIP-10` for tagging. + ## Implementations 1. [dtan.xyz](https://git.v0l.io/Kieran/dtan) 2. [nostrudel.ninja](https://github.com/hzrd149/nostrudel/tree/next/src/views/torrents) \ No newline at end of file From f59df9c24fb0c3f3e494f26a13cef7f48bd3851d Mon Sep 17 00:00:00 2001 From: kieran Date: Thu, 16 May 2024 15:28:04 +0100 Subject: [PATCH 4/5] update tag keys --- 35.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/35.md b/35.md index 4e80e3e5..04cfb46d 100644 --- a/35.md +++ b/35.md @@ -11,7 +11,7 @@ This NIP defined a new `kind 2003` which is a Torrent. `kind 2003` is a simple torrent index where there is enough information to search for content and construct the magnet link. No torrent files exist on nostr. ## Tags -- `i`: V1 BitTorrent Info Hash, as seen in the [magnet link](https://www.bittorrent.org/beps/bep_0053.html) `magnet:?xt=urn:btih:HASH` +- `x`: V1 BitTorrent Info Hash, as seen in the [magnet link](https://www.bittorrent.org/beps/bep_0053.html) `magnet:?xt=urn:btih:HASH` - `file`: A file entry inside the torrent, including the full path ie. `info/example.txt` - `tracker`: (Optional) A tracker to use for this torrent @@ -19,9 +19,9 @@ In order to make torrents searchable by general category, you SHOULD include a f ## Tag prefixes -Tag prefixes are used to label the content with references, ie. `["t", "imdb:1234"]` +Tag prefixes are used to label the content with references, ie. `["i", "imdb:1234"]` -- `tcat`: A comma separated text category path, ie. `["t", "tcat:video,movie,4k"]`, this should also match the `newznab` category in a best effort approach. +- `tcat`: A comma separated text category path, ie. `["i", "tcat:video,movie,4k"]`, this should also match the `newznab` category in a best effort approach. - `newznab`: The category ID from [newznab](https://github.com/Prowlarr/Prowlarr/blob/develop/src/NzbDrone.Core/Indexers/NewznabStandardCategory.cs) - `tmdb`: [The movie database](https://www.themoviedb.org/) id. - `ttvdb`: [TV database](https://thetvdb.com/) id. @@ -43,16 +43,16 @@ In some cases the url mapping isnt direct, mapping the url in general is out of "content": "", "tags": [ ["title", ""], - ["i", ""], + ["x", ""], ["file", "", ""], ["file", "", ""], ["tracker", "udp://mytacker.com:1337"], ["tracker", "http://1337-tracker.net/announce"], - ["t", "tcat:video,movie,4k"], - ["t", "newznab:2045"], - ["t", "imdb:tt15239678"], - ["t", "tmdb:movie:693134"], - ["t", "ttvdb:movie:290272"], + ["i", "tcat:video,movie,4k"], + ["i", "newznab:2045"], + ["i", "imdb:tt15239678"], + ["i", "tmdb:movie:693134"], + ["i", "ttvdb:movie:290272"], ["t", "movie"], ["t", "4k"], ] From dda408f48774eb41f116aad8024a84e73ab894ac Mon Sep 17 00:00:00 2001 From: kieran Date: Thu, 16 May 2024 15:29:09 +0100 Subject: [PATCH 5/5] update readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index b3736ea4..8847888a 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,8 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | `1971` | Problem Tracker | [nostrocket][nostrocket] | | `1984` | Reporting | [56](56.md) | | `1985` | Label | [32](32.md) | +| `2003` | Torrent | [35](35.md) | +| `2004` | Torrent Comment | [35](35.md) | | `4550` | Community Post Approval | [72](72.md) | | `5000`-`5999` | Job Request | [90](90.md) | | `6000`-`6999` | Job Result | [90](90.md) |