Albirew/nyaa-pantsu
Albirew
/
nyaa-pantsu
Archivé
1
0
Bifurcation 0

Update api to 1.1.0

Cette révision appartient à :
akuma06 2017-07-20 20:55:28 +02:00
Parent c5b3702fcd
révision d423468491
8 fichiers modifiés avec 447 ajouts et 281 suppressions

Voir le fichier

@ -1,245 +0,0 @@
// ------------------------------------------------------------------------------------------
// General apiDoc documentation blocks and old history blocks.
// ------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------
// Current Success.
// ------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------
// Current Errors.
// ------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------
// History.
// ------------------------------------------------------------------------------------------
/**
* @api {get} / Request Torrents index
* @apiVersion 1.0.0
* @apiName GetTorrents
* @apiGroup Torrents
*
* @apiParam {Number} id Torrent unique ID.
*
* @apiSuccess {Object[]} torrents List of torrent object (see view for the properties).
* @apiSuccess {Number} queryRecordCount Number of torrents given.
* @apiSuccess {Number} totalRecordCount Total number of torrents.
*
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* "torrents": [...],
* "queryRecordCount": 50,
* "totalRecordCount": 798414
* }
*
* @apiUse NotFoundError
*/
/**
* @api {get} /view/:id Request Torrent information
* @apiVersion 1.0.0
* @apiName GetTorrent
* @apiGroup Torrents
*
* @apiParam {Number} id Torrent unique ID.
*
* @apiSuccess {Number} id ID of the torrent.
* @apiSuccess {String} name Name of the torrent.
* @apiSuccess {Number} status Status of the torrent.
* @apiSuccess {String} hash Hash of the torrent.
* @apiSuccess {Date} date Uploaded date of the torrent.
* @apiSuccess {Number} filesize File size in Bytes of the torrent.
* @apiSuccess {String} description Description of the torrent.
* @apiSuccess {Object[]} comments Comments of the torrent.
* @apiSuccess {String} sub_category Sub Category of the torrent.
* @apiSuccess {String} category Category of the torrent.
* @apiSuccess {String} anidb_id Anidb ID of the torrent.
* @apiSuccess {Number} uploader_id ID of the torrent uploader.
* @apiSuccess {String} uploader_name Username of the torrent uploader.
* @apiSuccess {String} uploader_old Old username from nyaa of the torrent uploader.
* @apiSuccess {String} website_link External Link of the torrent.
* @apiSuccess {String[]} languages Languages of the torrent.
* @apiSuccess {String} magnet Magnet URI of the torrent.
* @apiSuccess {String} torrent Download URL of the torrent.
* @apiSuccess {Number} seeders Number of seeders of the torrent.
* @apiSuccess {Number} leechers Number of leechers of the torrent.
* @apiSuccess {Number} completed Downloads completed of the torrent.
* @apiSuccess {Date} last_scrape Last statistics update of the torrent.
* @apiSuccess {Object[]} file_list List of files in the torrent.
*
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* "id": 952801,
* "name": "[HorribleSubs] Uchouten Kazoku S2 [720p]",
* "status": 1,
* "hash": "6E4D96F7A0B0456672E80B150CCB7C15868CD47D",
* "date": "2017-07-05T11:01:39Z",
* "filesize": 4056160259,
* "description": "<p>Unofficial batch</p>\n",
* "comments": [],
* "sub_category": "5",
* "category": "3",
* "anidb_id": "",
* "downloads": 0,
* "uploader_id": 7177,
* "uploader_name": "DarAR92",
* "uploader_old": "",
* "website_link": "http://horriblesubs.info/",
* "languages": [
* "en-us"
* ],
* "magnet": "magnet:?xt=urn:btih:6E4D96F7A0B0456672E80B150CCB7C15868CD47D&dn=%5BHorribleSubs%5D+Uchouten+Kazoku+S2+%5B720p%5D&tr=http://nyaa.tracker.wf:7777/announce&tr=http://nyaa.tracker.wf:7777/announce&tr=udp://tracker.doko.moe:6969&tr=http://tracker.anirena.com:80/announce&tr=http://anidex.moe:6969/announce&tr=udp://tracker.opentrackr.org:1337&tr=udp://tracker.coppersurfer.tk:6969&tr=udp://tracker.leechers-paradise.org:6969&tr=udp://zer0day.ch:1337&tr=udp://9.rarbg.com:2710/announce&tr=udp://tracker2.christianbro.pw:6969/announce&tr=udp://tracker.coppersurfer.tk:6969&tr=udp://tracker.leechers-paradise.org:6969&tr=udp://eddie4.nl:6969/announce&tr=udp://tracker.doko.moe:6969/announce",
* "torrent": "https://nyaa.pantsu.cat/download/6E4D96F7A0B0456672E80B150CCB7C15868CD47D",
* "seeders": 4,
* "leechers": 2,
* "completed": 28,
* "last_scrape": "2017-07-07T07:48:32.509635Z",
* "file_list": [
* {
* "path": "[HorribleSubs] Uchouten Kazoku S2 - 01[720p].mkv",
* "filesize": 338250895
* },
* {
* "path": "[HorribleSubs] Uchouten Kazoku S2 - 12 [720p].mkv",
* "filesize": 338556275
* }
* ]
* }
*
* @apiUse NotFoundError
*/
/**
* @api {get} /head/:id Request Torrent Head
* @apiVersion 1.0.0
* @apiName GetTorrentHead
* @apiGroup Torrents
*
* @apiParam {Number} id Torrent unique ID.
*
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
*
* @apiUse NotFoundError
*/
/**
* @api {post} /upload Upload a Torrent
* @apiVersion 1.0.0
* @apiName UploadTorrent
* @apiGroup Torrents
*
* @apiParam {String} username Torrent uploader name.
* @apiParam {String} name Torrent name.
* @apiParam {String} magnet Torrent magnet URI.
* @apiParam {String} category Torrent category.
* @apiParam {Boolean} remake Torrent is a remake.
* @apiParam {String} description Torrent description.
* @apiParam {Number} status Torrent status.
* @apiParam {Boolean} hidden Torrent hidden.
* @apiParam {String} website_link Torrent website link.
* @apiParam {String[]} languages Torrent languages.
* @apiParam {File} torrent Torrent file to upload (you have to send a torrent file or a magnet, not both!).
*
* @apiSuccess {Boolean} ok The request is done without failing
* @apiSuccess {String[]} infos Messages information relative to the request
* @apiSuccess {Object} data The resulting torrent uploaded (see view for the properties)
*
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
*
* @apiUse RequestError
*/
/**
* @api {post} /update/ Update a Torrent
* @apiVersion 1.0.0
* @apiName UpdateTorrent
* @apiGroup Torrents
*
* @apiParam {String} username Torrent uploader name.
* @apiParam {Number} id Torrent ID.
* @apiParam {String} name Torrent name.
* @apiParam {String} category Torrent category.
* @apiParam {Boolean} remake Torrent is a remake.
* @apiParam {String} description Torrent description.
* @apiParam {Number} status Torrent status.
* @apiParam {Boolean} hidden Torrent hidden.
* @apiParam {String} website_link Torrent website link.
* @apiParam {String[]} languages Torrent languages.
*
* @apiSuccess {Boolean} ok The request is done without failing
* @apiSuccess {String[]} infos Messages information relative to the request
* @apiSuccess {Object} data The resulting torrent updated (see view for the properties)
*
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
*
* @apiUse RequestError
*/
/**
* @api {get} /search/ Request Torrents index
* @apiVersion 1.0.0
* @apiName FindTorrents
* @apiGroup Torrents
*
* @apiParam {String[]} c In which categories to search.
* @apiParam {String} q Query to search (torrent name).
* @apiParam {String} limit Number of results per page.
* @apiParam {String} userID Uploader ID owning the torrents.
* @apiParam {String} fromID Show results with torrents ID superior to this.
* @apiParam {String} s Torrent status.
* @apiParam {String} maxage Torrents which have been uploaded the last x days.
* @apiParam {String} toDate Torrents which have been uploaded since x <code>dateType</code>.
* @apiParam {String} fromDate Torrents which have been uploaded the last x <code>dateType</code>.
* @apiParam {String} dateType Which type of date (<code>d</code> for days, <code>m</code> for months, <code>y</code> for years).
* @apiParam {String} minSize Filter by minimal size in <code>sizeType</code>.
* @apiParam {String} maxSize Filter by maximal size in <code>sizeType</code>.
* @apiParam {String} sizeType Which type of size (<code>b</code> for bytes, <code>k</code> for kilobytes, <code>m</code> for megabytes, <code>g</code> for gigabytes).
* @apiParam {String} sort Torrent sorting type (0 = id, 1 = name, 2 = date, 3 = downloads, 4 = size, 5 = seeders, 6 = leechers, 7 = completed).
* @apiParam {Boolean} order Order ascending or descending (true = ascending).
* @apiParam {String[]} lang Filter the languages.
* @apiParam {Number} page Search page.
*
* @apiSuccess {Object[]} torrents List of torrent object (see view for the properties).
*
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* [...]
* }
*
* @apiUse NotFoundError
*/
/**
* @api {post} /login/ Login a user
* @apiVersion 1.0.0
* @apiName Login
* @apiGroup Users
*
* @apiParam {String} username Username or Email.
* @apiParam {String} password Password.
*
* @apiSuccess {Boolean} ok The request is done without failing
* @apiSuccess {String[]} infos Messages information relative to the request
* @apiSuccess {Object} data The connected user object
*
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* data:
* [{
* user_id:1,
* username:"username",
* status:1,
* token:"token",
* md5:"",
* created_at:"date",
* liking_count:0,
* liked_count:0
* }],
* infos: ["Logged", ... ],
* ok:true
* }
*
* @apiUse RequestError
*/

Voir le fichier

@ -1,6 +1,6 @@
{
"name": "nyaapantsu",
"version": "1.0.0",
"version": "1.1.0",
"description": "How to use the Nyaa Pantsu API",
"title": "Nyaa Pantsu API documentation",
"url": "https://nyaa.pantsu.cat/api",

Voir le fichier

@ -2,7 +2,182 @@ define({ "api": [
{
"type": "get",
"url": "/search/",
"title": "Request Torrents index",
"title": "Search Torrents",
"version": "1.1.0",
"name": "FindTorrents",
"group": "Torrents",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "String[]",
"optional": false,
"field": "c",
"description": "<p>In which categories to search.</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "q",
"description": "<p>Query to search (torrent name).</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "limit",
"description": "<p>Number of results per page.</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "userID",
"description": "<p>Uploader ID owning the torrents.</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "fromID",
"description": "<p>Show results with torrents ID superior to this.</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "s",
"description": "<p>Torrent status.</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "maxage",
"description": "<p>Torrents which have been uploaded the last x days.</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "toDate",
"description": "<p>Torrents which have been uploaded since x <code>dateType</code>.</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "fromDate",
"description": "<p>Torrents which have been uploaded the last x <code>dateType</code>.</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "dateType",
"description": "<p>Which type of date (<code>d</code> for days, <code>m</code> for months, <code>y</code> for years).</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "minSize",
"description": "<p>Filter by minimal size in <code>sizeType</code>.</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "maxSize",
"description": "<p>Filter by maximal size in <code>sizeType</code>.</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "sizeType",
"description": "<p>Which type of size (<code>b</code> for bytes, <code>k</code> for kilobytes, <code>m</code> for megabytes, <code>g</code> for gigabytes).</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "sort",
"description": "<p>Torrent sorting type (0 = id, 1 = name, 2 = date, 3 = downloads, 4 = size, 5 = seeders, 6 = leechers, 7 = completed).</p>"
},
{
"group": "Parameter",
"type": "Boolean",
"optional": false,
"field": "order",
"description": "<p>Order ascending or descending (true = ascending).</p>"
},
{
"group": "Parameter",
"type": "String[]",
"optional": false,
"field": "lang",
"description": "<p>Filter the languages.</p>"
},
{
"group": "Parameter",
"type": "Number",
"optional": false,
"field": "page",
"description": "<p>Search page.</p>"
}
]
}
},
"success": {
"fields": {
"Success 200": [
{
"group": "Success 200",
"type": "Object[]",
"optional": false,
"field": "torrents",
"description": "<p>List of torrent object (see view for the properties).</p>"
}
]
},
"examples": [
{
"title": "Success-Response:",
"content": " HTTP/1.1 200 OK\n {\n\t\t\t\"torrents\": [...],\n\t\t\t\"queryRecordCount\": 50,\n\t\t\t\"totalRecordCount\": 798414\n\t\t}",
"type": "json"
}
]
},
"filename": "controllers/api/api.go",
"groupTitle": "Torrents",
"error": {
"fields": {
"Error 4xx": [
{
"group": "Error 4xx",
"type": "String[]",
"optional": false,
"field": "errors",
"description": "<p>List of errors messages with a 404 error message in it.</p>"
}
]
},
"examples": [
{
"title": "Error-Response:",
"content": "HTTP/1.1 404 Not Found\n{\n \"errors\": [ \"404_not_found\", ... ]\n}",
"type": "json"
}
]
}
},
{
"type": "get",
"url": "/search/",
"title": "Search Torrents",
"version": "1.0.0",
"name": "FindTorrents",
"group": "Torrents",
@ -151,7 +326,7 @@ define({ "api": [
}
]
},
"filename": "controllers/api_handler.go",
"filename": "controllers/api/_apidoc.js",
"groupTitle": "Torrents",
"error": {
"fields": {
@ -178,7 +353,7 @@ define({ "api": [
"type": "get",
"url": "/view/:id",
"title": "Request Torrent information",
"version": "1.0.0",
"version": "1.1.0",
"name": "GetTorrent",
"group": "Torrents",
"parameter": {
@ -368,7 +543,7 @@ define({ "api": [
}
]
},
"filename": "controllers/api_handler.go",
"filename": "controllers/api/api.go",
"groupTitle": "Torrents",
"error": {
"fields": {
@ -395,7 +570,7 @@ define({ "api": [
"type": "get",
"url": "/head/:id",
"title": "Request Torrent Head",
"version": "1.0.0",
"version": "1.1.0",
"name": "GetTorrentHead",
"group": "Torrents",
"parameter": {
@ -420,7 +595,7 @@ define({ "api": [
}
]
},
"filename": "controllers/api_handler.go",
"filename": "controllers/api/api.go",
"groupTitle": "Torrents",
"error": {
"fields": {
@ -447,7 +622,7 @@ define({ "api": [
"type": "get",
"url": "/",
"title": "Request Torrents index",
"version": "1.0.0",
"version": "1.1.0",
"name": "GetTorrents",
"group": "Torrents",
"parameter": {
@ -497,7 +672,7 @@ define({ "api": [
}
]
},
"filename": "controllers/api_handler.go",
"filename": "controllers/api/api.go",
"groupTitle": "Torrents",
"error": {
"fields": {
@ -524,7 +699,7 @@ define({ "api": [
"type": "post",
"url": "/update/",
"title": "Update a Torrent",
"version": "1.0.0",
"version": "1.1.0",
"name": "UpdateTorrent",
"group": "Torrents",
"parameter": {
@ -637,7 +812,7 @@ define({ "api": [
}
]
},
"filename": "controllers/api_handler.go",
"filename": "controllers/api/api.go",
"groupTitle": "Torrents",
"error": {
"fields": {
@ -678,7 +853,7 @@ define({ "api": [
"type": "post",
"url": "/upload",
"title": "Upload a Torrent",
"version": "1.0.0",
"version": "1.1.0",
"name": "UploadTorrent",
"group": "Torrents",
"parameter": {
@ -798,7 +973,7 @@ define({ "api": [
}
]
},
"filename": "controllers/api_handler.go",
"filename": "controllers/api/api.go",
"groupTitle": "Torrents",
"error": {
"fields": {
@ -839,7 +1014,7 @@ define({ "api": [
"type": "post",
"url": "/login/",
"title": "Login a user",
"version": "1.0.0",
"version": "1.1.0",
"name": "Login",
"group": "Users",
"parameter": {
@ -896,7 +1071,7 @@ define({ "api": [
}
]
},
"filename": "controllers/api_handler.go",
"filename": "controllers/api/api.go",
"groupTitle": "Users",
"error": {
"fields": {

Voir le fichier

@ -2,7 +2,182 @@
{
"type": "get",
"url": "/search/",
"title": "Request Torrents index",
"title": "Search Torrents",
"version": "1.1.0",
"name": "FindTorrents",
"group": "Torrents",
"parameter": {
"fields": {
"Parameter": [
{
"group": "Parameter",
"type": "String[]",
"optional": false,
"field": "c",
"description": "<p>In which categories to search.</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "q",
"description": "<p>Query to search (torrent name).</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "limit",
"description": "<p>Number of results per page.</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "userID",
"description": "<p>Uploader ID owning the torrents.</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "fromID",
"description": "<p>Show results with torrents ID superior to this.</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "s",
"description": "<p>Torrent status.</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "maxage",
"description": "<p>Torrents which have been uploaded the last x days.</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "toDate",
"description": "<p>Torrents which have been uploaded since x <code>dateType</code>.</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "fromDate",
"description": "<p>Torrents which have been uploaded the last x <code>dateType</code>.</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "dateType",
"description": "<p>Which type of date (<code>d</code> for days, <code>m</code> for months, <code>y</code> for years).</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "minSize",
"description": "<p>Filter by minimal size in <code>sizeType</code>.</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "maxSize",
"description": "<p>Filter by maximal size in <code>sizeType</code>.</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "sizeType",
"description": "<p>Which type of size (<code>b</code> for bytes, <code>k</code> for kilobytes, <code>m</code> for megabytes, <code>g</code> for gigabytes).</p>"
},
{
"group": "Parameter",
"type": "String",
"optional": false,
"field": "sort",
"description": "<p>Torrent sorting type (0 = id, 1 = name, 2 = date, 3 = downloads, 4 = size, 5 = seeders, 6 = leechers, 7 = completed).</p>"
},
{
"group": "Parameter",
"type": "Boolean",
"optional": false,
"field": "order",
"description": "<p>Order ascending or descending (true = ascending).</p>"
},
{
"group": "Parameter",
"type": "String[]",
"optional": false,
"field": "lang",
"description": "<p>Filter the languages.</p>"
},
{
"group": "Parameter",
"type": "Number",
"optional": false,
"field": "page",
"description": "<p>Search page.</p>"
}
]
}
},
"success": {
"fields": {
"Success 200": [
{
"group": "Success 200",
"type": "Object[]",
"optional": false,
"field": "torrents",
"description": "<p>List of torrent object (see view for the properties).</p>"
}
]
},
"examples": [
{
"title": "Success-Response:",
"content": " HTTP/1.1 200 OK\n {\n\t\t\t\"torrents\": [...],\n\t\t\t\"queryRecordCount\": 50,\n\t\t\t\"totalRecordCount\": 798414\n\t\t}",
"type": "json"
}
]
},
"filename": "controllers/api/api.go",
"groupTitle": "Torrents",
"error": {
"fields": {
"Error 4xx": [
{
"group": "Error 4xx",
"type": "String[]",
"optional": false,
"field": "errors",
"description": "<p>List of errors messages with a 404 error message in it.</p>"
}
]
},
"examples": [
{
"title": "Error-Response:",
"content": "HTTP/1.1 404 Not Found\n{\n \"errors\": [ \"404_not_found\", ... ]\n}",
"type": "json"
}
]
}
},
{
"type": "get",
"url": "/search/",
"title": "Search Torrents",
"version": "1.0.0",
"name": "FindTorrents",
"group": "Torrents",
@ -151,7 +326,7 @@
}
]
},
"filename": "controllers/api_handler.go",
"filename": "controllers/api/_apidoc.js",
"groupTitle": "Torrents",
"error": {
"fields": {
@ -178,7 +353,7 @@
"type": "get",
"url": "/view/:id",
"title": "Request Torrent information",
"version": "1.0.0",
"version": "1.1.0",
"name": "GetTorrent",
"group": "Torrents",
"parameter": {
@ -368,7 +543,7 @@
}
]
},
"filename": "controllers/api_handler.go",
"filename": "controllers/api/api.go",
"groupTitle": "Torrents",
"error": {
"fields": {
@ -395,7 +570,7 @@
"type": "get",
"url": "/head/:id",
"title": "Request Torrent Head",
"version": "1.0.0",
"version": "1.1.0",
"name": "GetTorrentHead",
"group": "Torrents",
"parameter": {
@ -420,7 +595,7 @@
}
]
},
"filename": "controllers/api_handler.go",
"filename": "controllers/api/api.go",
"groupTitle": "Torrents",
"error": {
"fields": {
@ -447,7 +622,7 @@
"type": "get",
"url": "/",
"title": "Request Torrents index",
"version": "1.0.0",
"version": "1.1.0",
"name": "GetTorrents",
"group": "Torrents",
"parameter": {
@ -497,7 +672,7 @@
}
]
},
"filename": "controllers/api_handler.go",
"filename": "controllers/api/api.go",
"groupTitle": "Torrents",
"error": {
"fields": {
@ -524,7 +699,7 @@
"type": "post",
"url": "/update/",
"title": "Update a Torrent",
"version": "1.0.0",
"version": "1.1.0",
"name": "UpdateTorrent",
"group": "Torrents",
"parameter": {
@ -637,7 +812,7 @@
}
]
},
"filename": "controllers/api_handler.go",
"filename": "controllers/api/api.go",
"groupTitle": "Torrents",
"error": {
"fields": {
@ -678,7 +853,7 @@
"type": "post",
"url": "/upload",
"title": "Upload a Torrent",
"version": "1.0.0",
"version": "1.1.0",
"name": "UploadTorrent",
"group": "Torrents",
"parameter": {
@ -798,7 +973,7 @@
}
]
},
"filename": "controllers/api_handler.go",
"filename": "controllers/api/api.go",
"groupTitle": "Torrents",
"error": {
"fields": {
@ -839,7 +1014,7 @@
"type": "post",
"url": "/login/",
"title": "Login a user",
"version": "1.0.0",
"version": "1.1.0",
"name": "Login",
"group": "Users",
"parameter": {
@ -896,7 +1071,7 @@
}
]
},
"filename": "controllers/api_handler.go",
"filename": "controllers/api/api.go",
"groupTitle": "Users",
"error": {
"fields": {

Voir le fichier

@ -1,6 +1,6 @@
define({
"name": "nyaapantsu",
"version": "1.0.0",
"version": "1.1.0",
"description": "How to use the Nyaa Pantsu API",
"title": "Nyaa Pantsu API documentation",
"url": "https://nyaa.pantsu.cat/api",
@ -26,7 +26,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
"time": "2017-07-09T12:38:21.771Z",
"time": "2017-07-20T18:53:30.209Z",
"url": "http://apidocjs.com",
"version": "0.17.6"
}

Voir le fichier

@ -1,6 +1,6 @@
{
"name": "nyaapantsu",
"version": "1.0.0",
"version": "1.1.0",
"description": "How to use the Nyaa Pantsu API",
"title": "Nyaa Pantsu API documentation",
"url": "https://nyaa.pantsu.cat/api",
@ -26,7 +26,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
"time": "2017-07-09T12:38:21.771Z",
"time": "2017-07-20T18:53:30.209Z",
"url": "http://apidocjs.com",
"version": "0.17.6"
}

61
controllers/api/_apidoc.js Fichier normal
Voir le fichier

@ -0,0 +1,61 @@
// ------------------------------------------------------------------------------------------
// General apiDoc documentation blocks and old history blocks.
// ------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------
// Current Success.
// ------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------
// Current Errors.
// ------------------------------------------------------------------------------------------
/**
* @apiDefine NotFoundError
* @apiVersion 1.0.0
* @apiError {String[]} errors List of errors messages with a 404 error message in it.
*
* @apiErrorExample Error-Response:
* HTTP/1.1 404 Not Found
* {
* "errors": [ "404_not_found", ... ]
* }
*/
// ------------------------------------------------------------------------------------------
// History.
// ------------------------------------------------------------------------------------------
/**
* @api {get} /search/ Search Torrents
* @apiVersion 1.0.0
* @apiName FindTorrents
* @apiGroup Torrents
*
* @apiParam {String[]} c In which categories to search.
* @apiParam {String} q Query to search (torrent name).
* @apiParam {String} limit Number of results per page.
* @apiParam {String} userID Uploader ID owning the torrents.
* @apiParam {String} fromID Show results with torrents ID superior to this.
* @apiParam {String} s Torrent status.
* @apiParam {String} maxage Torrents which have been uploaded the last x days.
* @apiParam {String} toDate Torrents which have been uploaded since x <code>dateType</code>.
* @apiParam {String} fromDate Torrents which have been uploaded the last x <code>dateType</code>.
* @apiParam {String} dateType Which type of date (<code>d</code> for days, <code>m</code> for months, <code>y</code> for years).
* @apiParam {String} minSize Filter by minimal size in <code>sizeType</code>.
* @apiParam {String} maxSize Filter by maximal size in <code>sizeType</code>.
* @apiParam {String} sizeType Which type of size (<code>b</code> for bytes, <code>k</code> for kilobytes, <code>m</code> for megabytes, <code>g</code> for gigabytes).
* @apiParam {String} sort Torrent sorting type (0 = id, 1 = name, 2 = date, 3 = downloads, 4 = size, 5 = seeders, 6 = leechers, 7 = completed).
* @apiParam {Boolean} order Order ascending or descending (true = ascending).
* @apiParam {String[]} lang Filter the languages.
* @apiParam {Number} page Search page.
*
* @apiSuccess {Object[]} torrents List of torrent object (see view for the properties).
*
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* [...]
* }
*
* @apiUse NotFoundError
*/

Voir le fichier

@ -27,7 +27,7 @@ import (
/**
* @apiDefine NotFoundError
*
* @apiVersion 1.1.0
* @apiError {String[]} errors List of errors messages with a 404 error message in it.
*
* @apiErrorExample Error-Response:
@ -38,7 +38,7 @@ import (
*/
/**
* @apiDefine RequestError
*
* @apiVersion 1.1.0
* @apiError {Boolean} ok The request couldn't be done due to some errors.
* @apiError {String[]} errors List of errors messages.
* @apiError {Object[]} all_errors List of errors object messages for each wrong field
@ -367,7 +367,7 @@ func APIUpdateHandler(c *gin.Context) {
}
/**
* @api {get} /search/ Request Torrents index
* @api {get} /search/ Search Torrents
* @apiVersion 1.1.0
* @apiName FindTorrents
* @apiGroup Torrents