Skip to content

Commit 18a4322

Browse files
committed
enhancement(webhook): document overrides and uses
1 parent 0c232a7 commit 18a4322

File tree

4 files changed

+85
-27
lines changed

4 files changed

+85
-27
lines changed

docs/basics/options.md

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -750,11 +750,12 @@ skipRecheck: false,
750750
| ----------------------- | -------------- | --------------------------- | --------- | ------- |
751751
| `includeSingleEpisodes` | `N/A` | `--include-single-episodes` | `boolean` | `false` |
752752

753-
:::warning NOTICE
753+
:::tip
754754

755-
Behavior of this option has changed in v6, please see the
756-
[migration guide](../v6-migration.md#updated-includesingleepisodes-behavior) for
757-
details on the implementation's changes'.
755+
It's recommended to use `includeSingleEpisodes: false` in your config and override it for webhook
756+
commands triggered on [download completion](../tutorials/triggering-searches.md#setting-up-your-torrent-client).
757+
Combined with matching single episodes from announce, this should match all episodes without
758+
the downside of searching for [trumped/dead torrents](../v6-migration.md#updated-includesingleepisodes-behavior).
758759

759760
:::
760761

@@ -766,13 +767,9 @@ ignored by default).
766767
This will **NOT** include episodes present inside season packs (data-based
767768
searches).
768769

769-
:::
770-
771-
:::tip
772-
773-
This option has explicit usage examples given in the
774-
[config templates](https://github.com/cross-seed/cross-seed/blob/master/src/config.template.cjs#L261-L275)
775-
which outlines the most common scenarios.
770+
Behavior of this option has changed in v6, please see the
771+
[migration guide](../v6-migration.md#updated-includesingleepisodes-behavior) for
772+
details on the implementation's changes'.
776773

777774
:::
778775

@@ -1177,16 +1174,16 @@ Content-Type: application/json
11771174
"trackers": ["string"],
11781175
"source": "announce | inject | rss | search | webhook",
11791176
"result": "SAVED | INJECTED | FAILURE",
1180-
"paused": false,
1181-
"decisions": ["string"],
1182-
"searchee": {
1183-
"category": "string",
1184-
"tags": ["string"],
1185-
"trackers": ["string"],
1186-
"length": 123,
1187-
"infoHash": "string",
1188-
"path": "string",
1189-
"source": "torrentClient | torrentFile | dataDir | virtual",
1177+
"paused": false,
1178+
"decisions": ["string"],
1179+
"searchee": {
1180+
"category": "string",
1181+
"tags": ["string"],
1182+
"trackers": ["string"],
1183+
"length": 123,
1184+
"infoHash": "string",
1185+
"path": "string",
1186+
"source": "torrentClient | torrentFile | dataDir | virtual"
11901187
}
11911188
}
11921189
}

docs/reference/api.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,21 @@ POST /api/webhook
5656
// infoHash or path is required but not both (infoHash is recommended)
5757
infoHash: "<infoHash of torrent>",
5858
path: "/path/to/torrent/file.mkv",
59+
// All of the following are optional with their defaults shown
60+
ignoreCrossSeeds: true,
61+
ignoreExcludeRecentSearch: false,
62+
ignoreExcludeOlder: false,
63+
ignoreBlockList: false,
64+
includeSingleEpisodes: false,
65+
includeNonVideos: false,
5966
}
6067
```
6168

6269
```shell script
6370
curl -XPOST http://localhost:2468/api/webhook \
6471
--data-urlencode 'infoHash=<torrent infoHash here>' \
65-
--data-urlencode 'path=/path/to/torrent/file.mkv'
72+
--data-urlencode 'path=/path/to/torrent/file.mkv' \
73+
--data-urlencode 'includeSingleEpisodes=true'
6674
```
6775

6876
Alternatively, you can use JSON:

docs/tutorials/triggering-searches.md

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,42 @@ We will refer to this as `<BASE_URL>` below.
6262

6363
### Setting Up Your Torrent Client
6464

65+
There are likely two versions of webhook command you want to use, depending
66+
if you want to include episodes or not. There are other options available to
67+
customize found [`here`](../reference/api.md#request-payload), but these offer
68+
no benefit to download completion.
69+
70+
:::warning
71+
72+
You may be tempted to set `ignoreCrossSeeds: false` for download completion triggers
73+
but this offers no benefits. Partial matches will trigger a completion event in your
74+
client once it completes. This creates a _useless_ webhook search since this media
75+
was just processed by cross-seed.
76+
77+
:::
78+
79+
:::tip
80+
81+
Use the webhook command with `-d "includeSingleEpisodes=true"` with `includeSingleEpisodes: false`
82+
in your config to minimize useless searches.
83+
84+
[**Read more**](../v6-migration.md#updated-includesingleepisodes-behavior)
85+
86+
:::
87+
6588
<details>
6689
<summary><strong>rTorrent</strong></summary>
6790

6891
1. Create a script named `rtorrent-cross-seed.sh`, replacing `<BASE_URL>` and
6992
`<API_KEY>` with the correct values from above:
7093
```shell
7194
#!/bin/sh
72-
curl -XPOST <BASE_URL>/api/webhook?apikey=<API_KEY> --data-urlencode "infoHash=$2"
95+
curl -XPOST <BASE_URL>/api/webhook?apikey=<API_KEY> -d "infoHash=$2" -d "includeSingleEpisodes=true"
96+
```
97+
OR
98+
```shell
99+
#!/bin/sh
100+
curl -XPOST <BASE_URL>/api/webhook?apikey=<API_KEY> -d "infoHash=$2"
73101
```
74102
2. Make it executable:
75103
```shell
@@ -91,7 +119,11 @@ We will refer to this as `<BASE_URL>` below.
91119
2. Enable **Run external program on torrent completion**, replacing `<BASE_URL>`
92120
and `<API_KEY>` with the correct values from above:
93121
```shell
94-
curl -XPOST <BASE_URL>/api/webhook?apikey=<API_KEY> --data-urlencode "infoHash=%I"
122+
curl -XPOST <BASE_URL>/api/webhook?apikey=<API_KEY> -d "infoHash=%I" -d "includeSingleEpisodes=true"
123+
```
124+
OR
125+
```shell
126+
curl -XPOST <BASE_URL>/api/webhook?apikey=<API_KEY> -d "infoHash=%I"
95127
```
96128

97129
</details>
@@ -103,7 +135,12 @@ We will refer to this as `<BASE_URL>` below.
103135
with the correct values from above:
104136
```shell
105137
#!/bin/sh
106-
curl -XPOST <BASE_URL>/api/webhook?apikey=<API_KEY> --data-urlencode "infoHash=$TR_TORRENT_HASH"
138+
curl -XPOST <BASE_URL>/api/webhook?apikey=<API_KEY> -d "infoHash=$TR_TORRENT_HASH" -d "includeSingleEpisodes=true"
139+
```
140+
OR
141+
```shell
142+
#!/bin/sh
143+
curl -XPOST <BASE_URL>/api/webhook?apikey=<API_KEY> -d "infoHash=$TR_TORRENT_HASH"
107144
```
108145
2. Make it executable:
109146
```shell
@@ -119,13 +156,20 @@ We will refer to this as `<BASE_URL>` below.
119156

120157
1. Create a file called `deluge-cross-seed.sh`, replacing `<BASE_URL>` and
121158
`<API_KEY>` with the correct values from above:
122-
123159
```shell
124160
#!/bin/bash
125161
infoHash=$1
126162
name=$2
127163
path=$3
128-
curl -XPOST <BASE_URL>/api/webhook?apikey=<API_KEY> --data-urlencode "infoHash=$infoHash"
164+
curl -XPOST <BASE_URL>/api/webhook?apikey=<API_KEY> -d "infoHash=$infoHash" -d "includeSingleEpisodes=true"
165+
```
166+
OR
167+
```shell
168+
#!/bin/bash
169+
infoHash=$1
170+
name=$2
171+
path=$3
172+
curl -XPOST <BASE_URL>/api/webhook?apikey=<API_KEY> -d "infoHash=$infoHash"
129173
```
130174

131175
2. Make the script executable:

docs/v6-migration.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,15 @@ usually have trumped in favor of season packs. If you're currently using
194194
`includeSingleEpisodes: true`, please consider switching to `false` if it now
195195
meets your needs as it will reduce unecessary load on trackers.
196196

197+
:::tip
198+
199+
You can override this option for webhook searches which gives the best of
200+
both worlds.
201+
202+
[**Read more**](./tutorials/triggering-searches.md#setting-up-your-torrent-client)
203+
204+
:::
205+
197206
## New Features and Improvements
198207

199208
### Linking for torrent-based Matches

0 commit comments

Comments
 (0)