mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2024-12-22 19:40:00 +00:00
added clarity to api_uploader
This commit is contained in:
parent
6b465f5324
commit
2449fb96ee
|
@ -5,13 +5,14 @@ import json
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
'''
|
'''
|
||||||
The POST payload to the api endpoint (/api/upload) should look like this
|
The POST payload to the api endpoint (/api/upload) should be multipart/form-data containing three fields
|
||||||
{
|
|
||||||
'auth_info': {
|
'auth_info': file containing "{
|
||||||
'username': str,
|
'username': str,
|
||||||
'password': str
|
'password': str
|
||||||
},
|
}",
|
||||||
'torrent_info': {
|
|
||||||
|
'torrent_info': {
|
||||||
'category': str, # see below
|
'category': str, # see below
|
||||||
'display_name': str, # optional
|
'display_name': str, # optional
|
||||||
'information': str,
|
'information': str,
|
||||||
|
@ -20,9 +21,10 @@ The POST payload to the api endpoint (/api/upload) should look like this
|
||||||
'is_hidden': boolean,
|
'is_hidden': boolean,
|
||||||
'is_remake': boolean,
|
'is_remake': boolean,
|
||||||
'is_complete': boolean
|
'is_complete': boolean
|
||||||
},
|
},
|
||||||
'torrent_file': bytes # see below example
|
|
||||||
}
|
'torrent_file': multi part file format
|
||||||
|
|
||||||
|
|
||||||
A successful request should return {'Success': int(torrent_id)}
|
A successful request should return {'Success': int(torrent_id)}
|
||||||
A failed request should return {'Failure': ["Failure 1", "Failure 2"...]]}
|
A failed request should return {'Failure': ["Failure 1", "Failure 2"...]]}
|
||||||
|
|
Loading…
Reference in a new issue