Skip to content

Commit

Permalink
Add 4.5 documentation and deprecate 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Safihre committed Dec 2, 2024
1 parent cfe12b2 commit 2ea3133
Show file tree
Hide file tree
Showing 16 changed files with 185 additions and 183 deletions.
30 changes: 16 additions & 14 deletions wiki/configuration/4.2/api.html → wiki/configuration/4.5/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h1>Introduction</h1>
<pre><code>http://host:port/sabnzbd/api</code></pre>

<h2>Request types</h2>
<p>Supported output types are <code>json</code>, <code>xml</code> and <code>text</code> and can be specified in the request:
<p>Supported output types are <code>json</code> (default) and <code>xml</code>, which can be specified in the request:
<pre><code>http://host:port/sabnzbd/api?output=json</code></pre>

<h2>API Key and NZB key</h2>
Expand Down Expand Up @@ -324,7 +324,6 @@ <h2 id="speedlimit">Set speedlimit <span class="label label-primary">True/False<
<pre><code>api?mode=config&amp;name=speedlimit&amp;value=30</code></pre>
<p> It can also be followed by <code>K,M</code> to define speedlimit in <code>KB/s,MB/s</code>, respectively.
<pre><code>api?mode=config&amp;name=speedlimit&amp;value=400K</code></pre>
<p><span class="label label-warning">NOTE</span> In SABnzbd 0.7.20 and below the <code>value</code> is always interpreted as <code>KB/s</code>, no percentages.</p>

<h2 id="change_complete_action">Action on queue complete <span class="label label-primary">True/False</span></h2>
<p>Set an end-of-queue action</p>
Expand Down Expand Up @@ -551,12 +550,10 @@ <h2 id="get_files">Get files in job</h2>
<h2 id="move_nzf_bulk">Move file(s) inside a job <span class="label label-primary">True/False</span></h2>
<p>Move files specified by <code>nzf_ids</code> inside job <code>nzo_id</code> to <code>top</code> or <code>bottom</code>.
To move a file a <code>size</code> number of spots, use <code>up</code> or <code>down</code>.</p>
<p><span class="label label-warning">NOTE</span> New in 3.4.0+</p>
<pre><code>api?mode=move_nzf_bulk&amp;name=LOCATION&amp;value=NZO_ID&amp;nzf_ids=NZF_ID,NZF_ID2&amp;size=X</code></pre>

<h2 id="delete_nzf">Remove file(s) from a job</h2>
<p>Remove file(s) using <code>nzo_id</code> of the job and <code>nzf_id</code> of the file(s). Returns the <code>nzf_ids</code> of removed file.</p>
<p><span class="label label-warning">NOTE</span> Before 3.4.0 only single <code>nzf_id</code> could be used.</p>

<pre><code>api?mode=queue&amp;name=delete_nzf&amp;value=NZO_ID&amp;value2=NZF_ID,NZF_ID2</code></pre>

Expand Down Expand Up @@ -587,7 +584,7 @@ <h1 id="history_main">History functions</h1>
</tr>
<tr>
<td><a href="#delete_history">delete</a></td>
<td>Delete history item</td>
<td>Delete/Archive history item</td>
</tr>
</tbody>
</table>
Expand All @@ -612,6 +609,10 @@ <h2 id="history">History output</h2>
<td><code>limit</code> <small>optional</small></td>
<td>Number of jobs to display</td>
</tr>
<tr>
<td><code>archive</code> <small>optional</small></td>
<td>Display history (default) or archived items</td>
</tr>
<tr>
<td><code>search</code> <small>optional</small></td>
<td>Filter job names by <code>search</code> term</td>
Expand Down Expand Up @@ -661,7 +662,7 @@ <h2 id="history">History output</h2>
</thead>
<tbody>
<tr>
<td><code>series</code></td>
<td><code>duplicate_key</code></td>
<td>How SABnzbd identified the show and season/episode info</td>
</tr>
<tr>
Expand Down Expand Up @@ -702,7 +703,7 @@ <h2 id="history">History output</h2>
"slots": [
{
"action_line": "",
"series": "TV.Show/4/2",
"duplicate_key": "TV.Show/4/2",
"meta": null,
"fail_message": "",
"loaded": false,
Expand All @@ -727,6 +728,7 @@ <h2 id="history">History output</h2>
"name": "TV.Show.S04E02.720p.BluRay.x264-xHD",
"url": "TV.Show.S04E02.720p.BluRay.x264-xHD.nzb",
"md5sum": "d2c16aeecbc1b1921d04422850e93013",
"archive": false,
"bytes": 2436906376,
"url_info": "",
"stage_log": [
Expand Down Expand Up @@ -764,7 +766,7 @@ <h2 id="history">History output</h2>
},
{
"action_line": "",
"series": "TV.Show/4/13",
"duplicate_key": "TV.Show/4/13",
"meta": null,
"fail_message": "",
"loaded": false,
Expand All @@ -789,6 +791,7 @@ <h2 id="history">History output</h2>
"name": "TV.Show.S04E13.720p.BluRay.x264-xHD",
"url": "TV.Show.S04E13.720p.BluRay.x264-xHD.nzb",
"md5sum": "85baf55ec0de0dc732c2af6537c5c01b",
"archive": true,
"bytes": 2491255137,
"url_info": "",
"stage_log": [
Expand Down Expand Up @@ -838,13 +841,13 @@ <h2 id="retry_all">Retry all history items <span class="label label-primary">Tru
<p>Will retry all failed jobs in the history. However, you are not able to supply passwords or extra NZB's.
<pre><code>api?mode=retry_all</code></pre>


<h2 id="delete_history">Delete history items <span class="label label-primary">True/False</span></h2>
<p>Delete history item(s) based on <code>nzo_id</code>.</p>
<h2 id="delete_history">Delete/Archive history items <span class="label label-primary">True/False</span></h2>
<p>Delete or archive history item(s) based on <code>nzo_id</code>.</p>
<p><span class="label label-warning">NOTE</span> By default files of failed jobs are not removed, add <code>del_files=1</code> to also have them removed.</p>
<p><span class="label label-warning">NOTE</span> By default items are moved to the Archive, add <code>archive=0</code> to completely remove them.</p>
<pre><code>api?mode=history&amp;name=delete&amp;value=NZO_ID</code></pre>
<p>Deleting multiple items:</p>
<pre><code>api?mode=history&amp;name=delete&amp;value=NZO_ID_1,NZO_ID_2,NZO_ID_3</code></pre>
<p>Deleting multiple items (skipping Archive):</p>
<pre><code>api?mode=history&amp;name=delete&amp;archive=0&amp;value=NZO_ID_1,NZO_ID_2,NZO_ID_3</code></pre>
<p>Deleting all items:</p>
<pre><code>api?mode=history&amp;name=delete&amp;value=all</code></pre>
<p>Deleting all <strong>failed</strong> items:</p>
Expand Down Expand Up @@ -893,7 +896,6 @@ <h1 id="status_main">Status functions</h1>
<h2 id="fullstatus">Status information</h2>
<p>Get all status information available from SABnzbd. Below are only the values that are different from calls to <code>queue</code>.</p>

<p><span class="label label-warning">NOTE</span> Added <code>status</code> in 3.4.0, older versions only have <code>fullstatus</code>.</p>
<p><span class="label label-warning">NOTE</span> Getting the public IPv4 address might take some time, so it can be skipped by setting <code>skip_dashboard=1</code>. To calculate performance measures, add <code>calculate_performance=1</code>.</p>


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,13 @@ <h3 id="toc6">NotifyOSD</h3>
When SABnzbd detects support for this protocol, it will allow you to enable the service.
</p>

<h3 id="apprise">Apprise</h3>
<p>SABnzbd has built-in support for Apprise, which allows you to connect to basically any notification service out there.<br>
The full list of supported services and how to configure them can be found on the <a href="https://github.com/caronc/apprise/wiki" target="_blank">Apprise wiki</a>.
</p>
<p>Use a comma and/or space to identify more than one URL.
You can override the default URLs for specific notification types, if desired.
</p>

<h3 id="nscript">Notification script</h3>
<p>Allows implementation of custom notification services. See <a href="/wiki/configuration/{{ site.wiki_version }}/scripts/notification-scripts">Notification Scripts</a>.</p>
<p><a href="https://github.com/caronc/nzb-notify" target="_blank">NZB-Notify</a>'s notification script provides a very wide range of notification services, listed <a href="https://github.com/caronc/apprise#popular-notification-services" target="_blank">here</a>.</p>
<h4>NZB-Notify setup:</h4>
<ul>
<li>In <a href="/wiki/configuration/{{ site.wiki_version }}/folders">Config-&gt;Folders</a>, select a <code>Scripts Folder</code>.</li>
<li>On Windows and macOS, download and install Python from <a href="https://www.python.org/">python.org</a>. Restart the system after the installation.</li>
<li>Download <a href="https://github.com/caronc/nzb-notify/archive/refs/heads/master.zip">NZB-Notify</a> and unpack the contents of the <code>nzb-notify-master</code> folder to the <code>Scripts Folder</code>.</li>
<li>Open a terminal (macOS/Linux) or command line window (Windows) and navigate to the <code>Scripts Folder</code>.</li>
<li>Run <code>pip install -r requirements.txt</code> (on some systems you might have to replace <code>pip</code> by <code>pip3</code>).</li>
<li>You can now select <code>sabnzbd-notify.py</code> in <a href="/wiki/configuration/{{ site.wiki_version }}/notifications">Config-&gt;Notifications</a>.</li>
<li>Specify the URL for <a href="https://github.com/caronc/apprise#popular-notification-services" target="_blank">your service</a> such as <code>kodi://192.168.0.2</code> in the <code>Parameters</code> section.
You can specify more than one URL here by simply using a comma (<code>,</code>) as a delimiter.</li>
</ul>
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
Scripts can be Python scripts, bash scripts and BAT scripts. All scripts must be located in the scripts-directory, that can be specified in <a href="/wiki/configuration/{{ site.wiki_version }}/folders">Config-&gt;Folders</a>. Furthermore, the script must be executable. On Linux this means the x-bit must be on. On Windows, the requirement is that the script's extension is listed in your system's <code>PATHEXT</code> environment variable.
</p>

<p><a href="https://github.com/caronc/nzb-notify" target="_blank">NZB-Notify</a>'s notification script provides a wide range of notification services, extending on the built-in providers of SABnzbd. </p>

<hr>
<h2>Parameters</h2>
<p> The script will receive the parameters described below.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,155 +97,166 @@ <h2 id="env_vars">Environment variables</h2>
</thead>
<tbody>
<tr>
<td>SAB_SCRIPT</td>
<td><code>SAB_SCRIPT</code></td>
<td>The name of the current script</td>
</tr>
<tr>
<td>SAB_NZO_ID</td>
<td><code>SAB_NZO_ID</code></td>
<td>The unique ID assigned to the job</td>
</tr>
<tr>
<td>SAB_FINAL_NAME</td>
<td><code>SAB_FINAL_NAME</code></td>
<td>The name of the job in the queue and of the final folder</td>
</tr>
<tr>
<td>SAB_FILENAME</td>
<td><code>SAB_FILENAME</code></td>
<td>The NZB filename (after grabbing from the URL)</td>
</tr>
<tr>
<td>SAB_COMPLETE_DIR</td>
<td><code>SAB_COMPLETE_DIR</code></td>
<td>The whole path to the output directory of the job</td>
</tr>
<tr>
<td>SAB_PP_STATUS</td>
<td><code>SAB_PP_STATUS</code></td>
<td>Was post-processing successfully completed (repair and/or unpack, if enabled by user)</td>
</tr>
<tr>
<td>SAB_CAT</td>
<td><code>SAB_CAT</code></td>
<td>What category was assigned</td>
</tr>
<tr>
<td>SAB_BYTES</td>
<td><code>SAB_BYTES</code></td>
<td>Total number of bytes</td>
</tr>
<tr>
<td>SAB_BYTES_TRIED</td>
<td><code>SAB_BYTES_TRIED</code></td>
<td>How many bytes of the total bytes were tried</td>
</tr>
<tr>
<td>SAB_BYTES_DOWNLOADED</td>
<td><code>SAB_BYTES_DOWNLOADED</code></td>
<td>How many bytes were received (can be more than tried, due to overhead)</td>
</tr>
<tr>
<td>SAB_DUPLICATE</td>
<td><code>SAB_DUPLICATE</code></td>
<td>Was this a duplicate and what type</td>
</tr>
<tr>
<td>SAB_DUPLICATE_KEY</td>
<td><code>SAB_DUPLICATE_KEY</code></td>
<td>The key used for Smart Duplicate Detection</td>
</tr>
<tr>
<td>SAB_UNWANTED_EXT</td>
<td><code>SAB_UNWANTED_EXT</code></td>
<td>Were there unwanted extensions</td>
</tr>
<tr>
<td>SAB_OVERSIZED</td>
<td><code>SAB_OVERSIZED</code></td>
<td>Was the job over the user's size limit</td>
</tr>
<tr>
<td>SAB_PASSWORD</td>
<td><code>SAB_PASSWORD</code></td>
<td>What was the password supplied by the NZB or the user</td>
</tr>
<tr>
<td>SAB_CORRECT_PASSWORD</td>
<td><code>SAB_CORRECT_PASSWORD</code></td>
<td>The password that was detected as being the correct password for this job (added in 3.4.0)</td>
</tr>
<tr>
<td>SAB_ENCRYPTED</td>
<td><code>SAB_ENCRYPTED</code></td>
<td>Was the job detected as encrypted</td>
</tr>
<tr>
<td>SAB_STATUS</td>
<td><code>SAB_STATUS</code></td>
<td>Current status (completed/failed/running)</td>
</tr>
<tr>
<td>SAB_FAIL_MSG</td>
<td><code>SAB_FAIL_MSG</code></td>
<td>If job failed, why did it fail</td>
</tr>
<tr>
<td>SAB_AGE</td>
<td><code>SAB_AGE</code></td>
<td>Average age of the articles in the post</td>
</tr>
<tr>
<td>SAB_URL</td>
<td><code>SAB_URL</code></td>
<td>URL from which the NZB was retrieved</td>
</tr>
<tr>
<td>SAB_AVG_BPS</td>
<td><code>SAB_AVG_BPS</code></td>
<td>Average bytes/second speed during active downloading</td>
</tr>
<tr>
<td>SAB_DOWNLOAD_TIME</td>
<td><code>SAB_DOWNLOAD_TIME</code></td>
<td>How many seconds did we download</td>
</tr>
<tr>
<td>SAB_PP</td>
<td><code>SAB_PP</code></td>
<td>What post-processing was activated (download/repair/unpack/delete)</td>
</tr>
<tr>
<td>SAB_REPAIR</td>
<td><code>SAB_REPAIR</code></td>
<td>Was repair selected by user</td>
</tr>
<tr>
<td>SAB_UNPACK</td>
<td><code>SAB_UNPACK</code></td>
<td>Was unpack selected by user</td>
</tr>
<tr>
<td>SAB_FAILURE_URL</td>
<td><code>SAB_FAILURE_URL</code></td>
<td>Provided by some indexers as alternative NZB if download fails</td>
</tr>
<tr>
<td>SAB_PRIORITY</td>
<td><code>SAB_PRIORITY</code></td>
<td>Priority set by user</td>
</tr>
<tr>
<td>SAB_GROUP</td>
<td><code>SAB_GROUP</code></td>
<td>Newsgroup where (most of) the job's articles came from</td>
</tr>
<tr>
<td>SAB_ORIG_NZB_GZ</td>
<td><code>SAB_ORIG_NZB_GZ</code></td>
<td>Path to the original NZB-file of the job. The NZB-file is compressed with gzip (<code>.gz</code>)</td>
</tr>
<tr>
<td>SAB_VERSION</td>
<td><code>SAB_VERSION</code></td>
<td>The version of SABnzbd used</td>
</tr>
<tr>
<td>SAB_PROGRAM_DIR</td>
<td><code>SAB_PROGRAM_DIR</code></td>
<td>The directory where the current SABnzbd instance is located</td>
</tr>
<tr>
<td>SAB_PAR2_COMMAND</td>
<td><code>SAB_API_KEY</code></td>
<td>The API-key that you can use to communicate with the SABnzbd <a href="/wiki/configuration/{{ site.wiki_version }}/api">API</a>.</td>
</tr>
<tr>
<td><code>SAB_API_URL</code></td>
<td>
The URL to the SABnzbd <a href="/wiki/configuration/{{ site.wiki_version }}/api">API</a>, for example <code>http://127.0.0.1:8080/sabnzbd/api</code>.<br>
It does not include the required <code>apikey</code> parameter, use <code>SAB_API_KEY</code>.
</td>
</tr>
<tr>
<td><code>SAB_PAR2_COMMAND</code></td>
<td>The path to the <code>par2</code> command on the system that SABnzbd uses</td>
</tr>
<tr>
<td>SAB_MULTIPAR_COMMAND</td>
<td><code>SAB_MULTIPAR_COMMAND</code></td>
<td>Windows-only (empty on other systems). The path to the MultiPar command on the system that SABnzbd uses</td>
</tr>
<tr>
<td>SAB_RAR_COMMAND</td>
<td><code>SAB_RAR_COMMAND</code></td>
<td>The path to the <code>unrar</code> command on the system that SABnzbd uses</td>
</tr>
<tr>
<td>SAB_ZIP_COMMAND</td>
<td><code>SAB_ZIP_COMMAND</code></td>
<td>The path to the <code>unzip</code> command on the system that SABnzbd uses</td>
</tr>
<tr>
<td>SAB_7ZIP_COMMAND</td>
<td><code>SAB_7ZIP_COMMAND</code></td>
<td>The path to the <code>7z</code> command on the system that SABnzbd uses. Not all systems have 7zip installed (it's optional for SABnzbd), so this can also be empty</td>
</tr>
<tr>
<td>PYTHONUNBUFFERED</td>
<td><code>PYTHONUNBUFFERED</code></td>
<td>This variable is set to 1 when running a Python script (<code>.py</code>), in order to force Python to write output to SABnzbd directly instead of buffering it</td>
</tr>
</tbody>
Expand Down
Loading

0 comments on commit 2ea3133

Please sign in to comment.