{
  "id": "magnet_link",
  "kind": "datatype",
  "status": "stable",
  "name": "Magnet URI (BitTorrent)",
  "doc": "URI of the magnet: scheme that identifies a file or a torrent by a hash of its content instead of by its location, used by BitTorrent and other peer-to-peer clients. The parameter xt (exact topic) holds a URN such as urn:btih:<info hash> for BitTorrent v1 (BEP 9) or urn:btmh:<multihash> for v2 (BEP 52); optional parameters include dn (display name), tr (tracker URL), ws (web seed) and xs (exact source). The regexp requires an xt parameter, in any position.",
  "parent": "uri",
  "is_pii": false,
  "categories": [
    "internet",
    "identifiers"
  ],
  "langs": [
    "common"
  ],
  "classification": "identifier",
  "regexp": "^magnet:\\?(?:[^\\s&#]*&)*xt(?:\\.[0-9]+)?=urn:[A-Za-z0-9][A-Za-z0-9-]{0,31}:[^\\s&#]+(?:&[^\\s#]*)?$",
  "examples": [
    {
      "value": "magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&tr=udp%3A%2F%2Fexplodie.org%3A6969",
      "description": "Sintel magnet link published by WebTorrent, cut to one tracker",
      "valid": true
    },
    {
      "value": "magnet:?xt=urn:btih:dd8255ecdc7ca55fb0bbf81323d87062db1f6d1c&dn=Big+Buck+Bunny",
      "description": "Big Buck Bunny, published by WebTorrent",
      "valid": true
    },
    {
      "value": "magnet:?dn=Sintel&xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10",
      "description": "Display name before the exact topic",
      "valid": true
    },
    {
      "value": "magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10",
      "description": "Exact topic only",
      "valid": true
    },
    {
      "value": "magnet:?dn=Sintel&tr=udp%3A%2F%2Fexplodie.org%3A6969",
      "description": "No exact topic (xt)",
      "valid": false
    },
    {
      "value": "https://webtorrent.io/torrents/sintel.torrent",
      "description": "URL of a .torrent file",
      "valid": false
    }
  ],
  "links": [
    {
      "type": "wikipedia",
      "url": "https://en.wikipedia.org/wiki/Magnet_URI_scheme"
    },
    {
      "type": "doc",
      "url": "https://www.bittorrent.org/beps/bep_0009.html"
    },
    {
      "type": "doc",
      "url": "https://www.bittorrent.org/beps/bep_0052.html"
    }
  ],
  "translations": {
    "ru": {
      "name": "Magnet-ссылка",
      "doc": "URI схемы magnet:, который указывает файл или торрент по хешу содержимого, а не по адресу."
    }
  },
  "detected_by": {
    "tools": [
      "metacrafter"
    ],
    "metacrafter_rules": [
      {
        "rule": "magnetlinkfield",
        "type": "field",
        "match": "text",
        "file": "common/internet.yaml"
      },
      {
        "rule": "magnetlinkvalue",
        "type": "data",
        "match": "ppr",
        "file": "common/internet.yaml"
      }
    ]
  },
  "quality": {
    "score": 90,
    "missing": [
      "mapping (Wikidata, Schema.org, ...)"
    ]
  },
  "source": {
    "path": "data/datatypes/any/internet/magnet_link.yaml",
    "url": "https://github.com/apicrafter/metacrafter-registry/blob/main/data/datatypes/any/internet/magnet_link.yaml",
    "edit_url": "https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/internet/magnet_link.yaml"
  },
  "urls": {
    "html": "http://registry.apicrafter.io/datatype/magnet_link",
    "json": "http://registry.apicrafter.io/api/v1/datatypes/magnet_link.json"
  }
}