diff options
| author | Kieran <kieran@harkin.me> | 2024-05-22 09:36:56 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-22 09:36:56 +0100 |
| commit | 5971aa2fbea75db9b65eb4e60e37a84e1fb619e7 (patch) | |
| tree | 776a19a023747b9b3727ca7479d047f85aadff67 | |
| parent | d68899881c647bc031c4e62fd0501323e8bad7f8 (diff) | |
| parent | dda408f48774eb41f116aad8024a84e73ab894ac (diff) | |
Merge pull request #1175 from nostr-protocol/feat/nip35
NIP-35: Torrents
| -rw-r--r-- | 35.md | 70 | ||||
| -rw-r--r-- | README.md | 2 |
2 files changed, 72 insertions, 0 deletions
| @@ -0,0 +1,70 @@ | |||
| 1 | NIP-35 | ||
| 2 | ====== | ||
| 3 | |||
| 4 | Torrents | ||
| 5 | ----------- | ||
| 6 | |||
| 7 | `draft` `optional` | ||
| 8 | |||
| 9 | This NIP defined a new `kind 2003` which is a Torrent. | ||
| 10 | |||
| 11 | `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. | ||
| 12 | |||
| 13 | ## Tags | ||
| 14 | - `x`: V1 BitTorrent Info Hash, as seen in the [magnet link](https://www.bittorrent.org/beps/bep_0053.html) `magnet:?xt=urn:btih:HASH` | ||
| 15 | - `file`: A file entry inside the torrent, including the full path ie. `info/example.txt` | ||
| 16 | - `tracker`: (Optional) A tracker to use for this torrent | ||
| 17 | |||
| 18 | In order to make torrents searchable by general category, you SHOULD include a few tags like `movie`, `tv`, `HD`, `UHD` etc. | ||
| 19 | |||
| 20 | ## Tag prefixes | ||
| 21 | |||
| 22 | Tag prefixes are used to label the content with references, ie. `["i", "imdb:1234"]` | ||
| 23 | |||
| 24 | - `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. | ||
| 25 | - `newznab`: The category ID from [newznab](https://github.com/Prowlarr/Prowlarr/blob/develop/src/NzbDrone.Core/Indexers/NewznabStandardCategory.cs) | ||
| 26 | - `tmdb`: [The movie database](https://www.themoviedb.org/) id. | ||
| 27 | - `ttvdb`: [TV database](https://thetvdb.com/) id. | ||
| 28 | - `imdb`: [IMDB](https://www.imdb.com/) id. | ||
| 29 | - `mal`: [MyAnimeList](https://myanimelist.net/) id. | ||
| 30 | - `anilist`: [AniList](https://anilist.co/) id. | ||
| 31 | |||
| 32 | A second level prefix should be included where the database supports multiple media types. | ||
| 33 | - `tmdb:movie:693134` maps to `themoviedb.org/movie/693134` | ||
| 34 | - `ttvdb:movie:290272` maps to `thetvdb.com/movies/dune-part-two` | ||
| 35 | - `mal:anime:9253` maps to `myanimelist.net/anime/9253` | ||
| 36 | - `mal:manga:17517` maps to `myanimelist.net/manga/17517` | ||
| 37 | |||
| 38 | 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. | ||
| 39 | |||
| 40 | ```jsonc | ||
| 41 | { | ||
| 42 | "kind": 2003, | ||
| 43 | "content": "<long-description-pre-formatted>", | ||
| 44 | "tags": [ | ||
| 45 | ["title", "<torrent-title>"], | ||
| 46 | ["x", "<bittorrent-info-hash>"], | ||
| 47 | ["file", "<file-name>", "<file-size-in-bytes>"], | ||
| 48 | ["file", "<file-name>", "<file-size-in-bytes>"], | ||
| 49 | ["tracker", "udp://mytacker.com:1337"], | ||
| 50 | ["tracker", "http://1337-tracker.net/announce"], | ||
| 51 | ["i", "tcat:video,movie,4k"], | ||
| 52 | ["i", "newznab:2045"], | ||
| 53 | ["i", "imdb:tt15239678"], | ||
| 54 | ["i", "tmdb:movie:693134"], | ||
| 55 | ["i", "ttvdb:movie:290272"], | ||
| 56 | ["t", "movie"], | ||
| 57 | ["t", "4k"], | ||
| 58 | ] | ||
| 59 | } | ||
| 60 | ``` | ||
| 61 | |||
| 62 | ## Torrent Comments | ||
| 63 | |||
| 64 | A torrent comment is a `kind 2004` event which is used to reply to a torrent event. | ||
| 65 | |||
| 66 | This event works exactly like a `kind 1` and should follow `NIP-10` for tagging. | ||
| 67 | |||
| 68 | ## Implementations | ||
| 69 | 1. [dtan.xyz](https://git.v0l.io/Kieran/dtan) | ||
| 70 | 2. [nostrudel.ninja](https://github.com/hzrd149/nostrudel/tree/next/src/views/torrents) \ No newline at end of file | ||
| @@ -123,6 +123,8 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | |||
| 123 | | `1971` | Problem Tracker | [nostrocket][nostrocket] | | 123 | | `1971` | Problem Tracker | [nostrocket][nostrocket] | |
| 124 | | `1984` | Reporting | [56](56.md) | | 124 | | `1984` | Reporting | [56](56.md) | |
| 125 | | `1985` | Label | [32](32.md) | | 125 | | `1985` | Label | [32](32.md) | |
| 126 | | `2003` | Torrent | [35](35.md) | | ||
| 127 | | `2004` | Torrent Comment | [35](35.md) | | ||
| 126 | | `4550` | Community Post Approval | [72](72.md) | | 128 | | `4550` | Community Post Approval | [72](72.md) | |
| 127 | | `5000`-`5999` | Job Request | [90](90.md) | | 129 | | `5000`-`5999` | Job Request | [90](90.md) | |
| 128 | | `6000`-`6999` | Job Result | [90](90.md) | | 130 | | `6000`-`6999` | Job Result | [90](90.md) | |