upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/35.md
blob: 33ed2bebd9cf96f6f2a41cae41d63c680b12b7df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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": "<long-description-pre-formatted>",
  "tags": [
    ["title", "<torrent-title>"],
    ["btih", "<bittorrent-info-hash>"],
    ["file", "<file-name>", "<file-size-in-bytes>"],
    ["file", "<file-name>", "<file-size-in-bytes>"],
    ["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)