Content
If your source provides a JSON response, you will want to use the "api" element that contains a JSON Object.
All keys and elements are case sensitive.
Currently, weyd only processes torrents from an API source, so "is_torrent" must be true. In the future, weyd will be able to process direct downloads from an API source; for this, you would set "is_direct" to true.
The elements of the JSON Object are:
- "path_to_array" - String (optional) - If the source provides a JSON Document, then you need to tell weyd where to find the array that contains the links. If the source provides an array of JSON Objects, then you must omit this.
- "path_title" - String (required) - This points to the element in the JSON Object that contains the title or filename (that contains the title). The value of this element from the source must map to the actual show/movie title and contain the year/season & episode so weyd can validate that this link matches the search criteria.
- "path_size" - String (required) - The size element should contain an integer or long of the filesize. If the source JSON doesn't provide the filesize, then you may point it to an invalid/missing element. The filesize is used to sort links properly; this should be included, if possible.
-
"path_seeders" - String (required) - Some APIs return the number of seeders directly in an element, if that's the case then this should be the key of that element. Some APIs return this as a nested JSON Object. In those instances, you should put {} between the nested keys
- If the seeders are nested in the source JSON as { "swarm": { "seeders": 3 } }, then "path_seeders" would contain "swarm{}seeders"
- "path_magnet" - String (optional) - This points to a properly formatted magnet. If the source JSON does not contain the magnet, but contains the hash instead, you should omit this and use "path_hash". The hash will be extracted from the magnet, and the hash is what is sent to the Debrid service.
- "path_hash" - String (optional) - If "path_magnet" is omited, then this is required. This is the hash of the torrent info for the link.
- "path_torrent" - String (optional) - This is not implemented yet, but has been requested and will be used in the future. If the source does not return a hash, but instead returns a URL to a .torrent file, then this will tell weyd where to look for the .torrent file. weyd will extract the info hash from the file. All URLs must be HTTPS, contain a FQDN, and the target must use a Valid SSL Certificate issued by a Trusted CA.
-
"token" - JSON Object (optional - not implemented yet) - The presence of this JSON Object indicates that a token must be obtained from the API Endpoint and contains instructions on creating/obtaining the token.
- specifications pending.
Examples
Source returns an array of JSON Objects
- Source
[
{
"name": "The name of the file - 2020",
"size": 1234961182,
"seeders": 3,
"hash": "9a128abc02e872ff871add827165"
},
{
"name": "The name of the file - 2020",
"size": 2334961182,
"seeders": 1,
"hash": "871add8271659a128abc02e872ff"
}
]
- Scraper JSON
{
"api": {
"path_title": "name",
"path_size": "size",
"path_seeders": "seeders",
"path_hash": "hash"
}
}
Source returns a JSON Document
- Source
{
"results": [
{
"file_name": "The name of the file - 2020",
"file_size": 1234961182,
"number_seeders": 3,
"magnet": "magnet:?xt=urn:btih:4873f340feabb89d1ec8c2347120250e"
},
{
"file_name": "The name of the file - 2020",
"file_size": 2334961182,
"number_seeders": 1,
"magnet": "magnet:?xt=urn:btih:0cea4783a322f3690d2947152f106bff"
}
]
}
- Scraper JSON
{
"api": {
"path_to_array": "results",
"path_title": "file_name",
"path_size": "file_size",
"path_seeders": "number_seeders",
"path_magnet": "magnet"
}
}
Source returns a link to .torrent instead of a hash
- Source
[
{
"name": "The name of the file - 2020",
"size": 1234961182,
"seeders": 3,
"torrent": "https://website.com/torrent?id=12345"
},
{
"name": "The name of the file - 2020",
"size": 2334961182,
"seeders": 1,
"torrent": "https://website.com/torrent?id=54321"
}
]
- Scraper JSON
{
"api": {
"path_title": "name",
"path_size": "size",
"path_seeders": "seeders",
"path_torrent": "torrent"
}
}