mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
Update nzb and nfo import
This commit is contained in:
@@ -225,15 +225,23 @@ newznab-tmux https://github.com/NNTmux/newznab-tmux
|
||||
Parameters:
|
||||
t=nzbadd
|
||||
apikey=xxxx
|
||||
file=<multipart nzb or nfo file>
|
||||
nzb=<multipart nzb file>
|
||||
|
||||
Optional:
|
||||
cat, includemeta, dupecheck, nfo, medianfo
|
||||
nfo=<multipart nfo file with any basename>
|
||||
cat, includemeta, dupecheck, medianfo
|
||||
|
||||
Legacy fallback:
|
||||
file=<single multipart nzb or nfo file>
|
||||
|
||||
The legacy file field cannot be mixed with nzb or nfo in the same request.
|
||||
|
||||
Behavior:
|
||||
Valid .nzb and .nfo uploads are written to the same NZB upload folder
|
||||
(NZB_UPLOAD_FOLDER). NFO files are not linked to releases at upload time;
|
||||
a separate import command is expected to process them later.
|
||||
The nzb/nfo fields use the same atomic manifested staging flow as API v2.
|
||||
Each pair is isolated below NZB_UPLOAD_FOLDER and the NFO basename does not
|
||||
need to match the NZB basename. Run nntmux:import-nzbs first and then
|
||||
nntmux:import-nfos for the same folder to link the NFO to the new release.
|
||||
Duplicate or failed NZB imports do not link their NFO files.
|
||||
|
||||
Error handling:
|
||||
Uses XML error codes from section 6.
|
||||
|
||||
+19
-10
@@ -198,13 +198,12 @@ Fields:
|
||||
```bash
|
||||
curl -X POST -F "api_token=<token>" -F "nzb=@Release.nzb" https://<host>/api/v2/nzbadd
|
||||
```
|
||||
```
|
||||
|
||||
Paired example:
|
||||
|
||||
|
||||
```bash
|
||||
curl -X POST -F "api_token=<token>" -F "cat=5040" -F "nzb=@Release.nzb" -F "nfo=@Release.nfo" https://<host>/api/v2/nzbadd
|
||||
```
|
||||
```bash
|
||||
curl -X POST -F "api_token=<token>" -F "cat=5040" -F "nzb=@Release.nzb" -F "nfo=@scene-info.nfo" https://<host>/api/v2/nzbadd
|
||||
```
|
||||
|
||||
Successful staging returns HTTP `201`:
|
||||
|
||||
@@ -215,7 +214,7 @@ curl -X POST -F "api_token=<token>" -F "nzb=@Release.nzb" https://<host>/api/v2/
|
||||
"name": "Release",
|
||||
"category": "5040",
|
||||
"files": {
|
||||
"nzb": { "filename": "Release.nzb", "type": "nzb" },
|
||||
"nzb": { "filename": "Release.nzb", "type": "nzb" },
|
||||
"nfo": { "filename": "scene-info.nfo", "type": "nfo" }
|
||||
}
|
||||
}
|
||||
@@ -228,14 +227,24 @@ Successful staging returns HTTP `201`:
|
||||
```bash
|
||||
php artisan nntmux:import-nzbs --folder=/path/to/NZB_UPLOAD_FOLDER
|
||||
php artisan nntmux:import-nfos --folder=/path/to/NZB_UPLOAD_FOLDER
|
||||
|
||||
```
|
||||
|
||||
The NFO importer replaces an existing NFO for the resolved release. Add
|
||||
`--delete` to remove successfully imported NFO payloads or `--delete-failed`
|
||||
to remove payloads that cannot be linked. NZB-only responses set `files.nfo`
|
||||
"apiMax": 1000,
|
||||
"grabCurrent": 1,
|
||||
"grabMax": 100,
|
||||
to `null`.
|
||||
|
||||
## Response Models
|
||||
|
||||
### Search Envelope (`/search`, `/tv`, `/movies`, `/audio`, `/books`, `/anime`)
|
||||
|
||||
```json
|
||||
{
|
||||
"Total": 123,
|
||||
"apiCurrent": 2,
|
||||
"apiMax": 1000,
|
||||
"grabCurrent": 1,
|
||||
"grabMax": 100,
|
||||
"apiOldestTime": "Wed, 20 Nov 2024 12:00:00 +0000",
|
||||
"grabOldestTime": "",
|
||||
"results": []
|
||||
|
||||
@@ -610,10 +610,10 @@
|
||||
{ "key": "api_token", "value": "{{apiToken}}", "type": "text" },
|
||||
{ "key": "cat", "value": "5040", "type": "text" },
|
||||
{ "key": "nzb", "type": "file", "src": "Release.nzb" },
|
||||
{ "key": "nfo", "type": "file", "src": "Release.nfo" }
|
||||
{ "key": "nfo", "type": "file", "src": "scene-info.nfo" }
|
||||
]
|
||||
},
|
||||
"description": "Atomically stages an NZB and an optional NFO with a matching basename. Category is echoed metadata only.",
|
||||
"description": "Atomically stages an NZB and an optional NFO with any safe basename. Run nntmux:import-nzbs before nntmux:import-nfos. Category is echoed metadata only.",
|
||||
"url": {
|
||||
"raw": "{{baseUrl}}/api/v2/nzbadd",
|
||||
"host": ["{{baseUrl}}"],
|
||||
@@ -637,7 +637,7 @@
|
||||
"_postman_previewlanguage": "json",
|
||||
"header": [{ "key": "Content-Type", "value": "application/json" }],
|
||||
"cookie": [],
|
||||
"body": "{\n \"success\": true,\n \"status\": \"staged\",\n \"name\": \"Release\",\n \"category\": \"5040\",\n \"files\": {\n \"nzb\": { \"filename\": \"Release.nzb\", \"type\": \"nzb\" },\n \"nfo\": { \"filename\": \"Release.nfo\", \"type\": \"nfo\" }\n }\n}"
|
||||
"body": "{\n \"success\": true,\n \"status\": \"staged\",\n \"name\": \"Release\",\n \"category\": \"5040\",\n \"files\": {\n \"nzb\": { \"filename\": \"Release.nzb\", \"type\": \"nzb\" },\n \"nfo\": { \"filename\": \"scene-info.nfo\", \"type\": \"nfo\" }\n }\n}"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user