nips/35.md

70 lines
2.8 KiB
Markdown
Raw Normal View History

2024-04-14 13:22:01 -04:00
NIP-35
======
Torrents
--------
2024-04-14 13:22:01 -04:00
`draft` `optional`
This NIP defined a new `kind 2003` which is a Torrent.
2024-04-14 13:22:01 -04:00
`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
2024-05-16 10:28:04 -04:00
- `x`: V1 BitTorrent Info Hash, as seen in the [magnet link](https://www.bittorrent.org/beps/bep_0053.html) `magnet:?xt=urn:btih:HASH`
2024-04-14 13:22:01 -04:00
- `file`: A file entry inside the torrent, including the full path ie. `info/example.txt`
- `tracker`: (Optional) A tracker to use for this torrent
2024-04-14 13:22:01 -04:00
In order to make torrents searchable by general category, you SHOULD include a few tags like `movie`, `tv`, `HD`, `UHD` etc.
## Tag prefixes
2024-05-16 10:28:04 -04:00
Tag prefixes are used to label the content with references, ie. `["i", "imdb:1234"]`
2024-04-14 13:22:01 -04:00
2024-05-16 10:28:04 -04:00
- `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.
2024-04-14 13:22:01 -04:00
- `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.
```jsonc
2024-04-14 13:22:01 -04:00
{
2024-04-14 13:23:41 -04:00
"kind": 2003,
2024-04-14 13:22:01 -04:00
"content": "<long-description-pre-formatted>",
"tags": [
["title", "<torrent-title>"],
2024-05-16 10:28:04 -04:00
["x", "<bittorrent-info-hash>"],
2024-04-14 13:22:01 -04:00
["file", "<file-name>", "<file-size-in-bytes>"],
["file", "<file-name>", "<file-size-in-bytes>"],
["tracker", "udp://mytacker.com:1337"],
["tracker", "http://1337-tracker.net/announce"],
2024-05-16 10:28:04 -04:00
["i", "tcat:video,movie,4k"],
["i", "newznab:2045"],
["i", "imdb:tt15239678"],
["i", "tmdb:movie:693134"],
["i", "ttvdb:movie:290272"],
2024-04-14 13:22:01 -04:00
["t", "movie"],
["t", "4k"],
]
}
```
## 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.
2024-04-14 13:22:01 -04:00
## Implementations
1. [dtan.xyz](https://git.v0l.io/Kieran/dtan)
2. [nostrudel.ninja](https://github.com/hzrd149/nostrudel/tree/next/src/views/torrents)