cross-seed 3.4.1 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -5
- package/dist/cache.js +13 -0
- package/dist/cache.js.map +1 -0
- package/dist/cmd.js +32 -22
- package/dist/cmd.js.map +1 -1
- package/dist/config.template.cjs +35 -20
- package/dist/config.template.cjs.map +1 -1
- package/dist/config.template.docker.cjs +39 -23
- package/dist/config.template.docker.cjs.map +1 -1
- package/dist/configuration.js.map +1 -1
- package/dist/db.js +11 -28
- package/dist/db.js.map +1 -1
- package/dist/decide.js +37 -21
- package/dist/decide.js.map +1 -1
- package/dist/errors.js +8 -0
- package/dist/errors.js.map +1 -1
- package/dist/jobs.js +73 -0
- package/dist/jobs.js.map +1 -0
- package/dist/logger.js +6 -2
- package/dist/logger.js.map +1 -1
- package/dist/migrations/00-initialSchema.js +75 -0
- package/dist/migrations/00-initialSchema.js.map +1 -0
- package/dist/migrations/01-jobs.js +17 -0
- package/dist/migrations/01-jobs.js.map +1 -0
- package/dist/migrations/migrations.js +9 -0
- package/dist/migrations/migrations.js.map +1 -0
- package/dist/pipeline.js +85 -59
- package/dist/pipeline.js.map +1 -1
- package/dist/preFilter.js +20 -18
- package/dist/preFilter.js.map +1 -1
- package/dist/runtimeConfig.js +0 -1
- package/dist/runtimeConfig.js.map +1 -1
- package/dist/server.js +5 -4
- package/dist/server.js.map +1 -1
- package/dist/signalHandlers.js +7 -2
- package/dist/signalHandlers.js.map +1 -1
- package/dist/startup.js +0 -2
- package/dist/startup.js.map +1 -1
- package/dist/torrent.js +41 -18
- package/dist/torrent.js.map +1 -1
- package/dist/torznab.js +2 -2
- package/dist/torznab.js.map +1 -1
- package/dist/utils.js +16 -4
- package/dist/utils.js.map +1 -1
- package/package.json +5 -3
- package/dist/jackett.js +0 -64
- package/dist/jackett.js.map +0 -1
package/README.md
CHANGED
@@ -17,6 +17,11 @@ files to a folder you specify. After that, I recommend using
|
|
17
17
|
[AutoTorrent](https://github.com/JohnDoee/autotorrent) to do the last-mile
|
18
18
|
delivery into your client.
|
19
19
|
|
20
|
+
## 🚨🚨🚨 Breaking changes in cross-seed v4 🚨🚨🚨
|
21
|
+
|
22
|
+
Head on over to https://github.com/mmgoodnow/cross-seed/wiki/v4-Migration-Guide
|
23
|
+
to see the steps required for migration.
|
24
|
+
|
20
25
|
## Requirements
|
21
26
|
|
22
27
|
- [Node 14+](https://nodejs.org/en/download)
|
@@ -53,20 +58,16 @@ Search for cross-seeds
|
|
53
58
|
|
54
59
|
|
55
60
|
Options:
|
56
|
-
-u, --jackett-server-url <url> DEPRECATED: Your Jackett server url
|
57
|
-
-k, --jackett-api-key <key> DEPRECATED: Your Jackett API key
|
58
|
-
-t, --trackers <tracker1>,<tracker2> DEPRECATED: Comma-separated list of Jackett tracker ids to search (Tracker ids can be found in their Torznab feed paths)
|
59
61
|
-T, --torznab <urls...> Torznab urls with apikey included (separated by spaces)
|
60
62
|
-i, --torrent-dir <dir> Directory with torrent files
|
61
63
|
-s, --output-dir <dir> Directory to save results in
|
62
|
-
|
64
|
+
--include-non-videos Include torrents which contain non-video files (default: false)
|
63
65
|
-e, --include-episodes Include single-episode torrents in the search (default: false)
|
64
66
|
--fuzzy-size-threshold <decimal> The size difference allowed to be considered a match. (default: 0.02)
|
65
67
|
-v, --verbose Log verbose output (default: false)
|
66
68
|
-A, --action <action> If set to 'inject', cross-seed will attempt to add the found torrents to your torrent client. (choices: "save", "inject", default: "save")
|
67
69
|
--rtorrent-rpc-url <url> The url of your rtorrent XMLRPC interface. Requires '-A inject'. See the docs for more information.
|
68
70
|
--qbittorrent-url <url> The url of your qBittorrent webui. Requires '-A inject'. See the docs for more information.
|
69
|
-
-o, --offset <offset> Offset to start from
|
70
71
|
-d, --delay <delay> Pause duration (seconds) between searches (default: 10)
|
71
72
|
-x, --exclude-older <cutoff> Exclude torrents first seen more than x minutes ago. Overrides the -a flag.
|
72
73
|
-r, --exclude-recent-search <cutoff> Exclude torrents which have been searched more recently than x minutes ago. Overrides the -a flag.
|
package/dist/cache.js
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
import { readFile, rename } from "fs/promises";
|
2
|
+
import path from "path";
|
3
|
+
import { appDir, createAppDir } from "./configuration.js";
|
4
|
+
createAppDir();
|
5
|
+
export async function getCacheFileData() {
|
6
|
+
return readFile(path.join(appDir(), "cache.json"))
|
7
|
+
.then((data) => JSON.parse(data.toString()))
|
8
|
+
.catch(() => undefined);
|
9
|
+
}
|
10
|
+
export async function renameCacheFile() {
|
11
|
+
return rename(path.join(appDir(), "cache.json"), path.join(appDir(), "old-cache.bak.json"));
|
12
|
+
}
|
13
|
+
//# sourceMappingURL=cache.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAG1D,YAAY,EAAE,CAAC;AA4Bf,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACrC,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,YAAY,CAAC,CAAC;SAChD,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;SAC3C,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe;IACpC,OAAO,MAAM,CACZ,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,YAAY,CAAC,EACjC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,oBAAoB,CAAC,CACzC,CAAC;AACH,CAAC"}
|
package/dist/cmd.js
CHANGED
@@ -2,12 +2,13 @@
|
|
2
2
|
import chalk from "chalk";
|
3
3
|
import { Option, program } from "commander";
|
4
4
|
import { createRequire } from "module";
|
5
|
+
import ms from "ms";
|
5
6
|
import { inspect } from "util";
|
6
7
|
import { generateConfig, getFileConfig } from "./configuration.js";
|
7
8
|
import { Action } from "./constants.js";
|
8
|
-
import {
|
9
|
+
import { jobsLoop } from "./jobs.js";
|
9
10
|
import { diffCmd } from "./diff.js";
|
10
|
-
import { CrossSeedError } from "./errors.js";
|
11
|
+
import { CrossSeedError, exitOnCrossSeedErrors } from "./errors.js";
|
11
12
|
import { initializeLogger, Label, logger } from "./logger.js";
|
12
13
|
import { main } from "./pipeline.js";
|
13
14
|
import { initializePushNotifier, sendTestNotification, } from "./pushNotifier.js";
|
@@ -15,6 +16,7 @@ import { setRuntimeConfig } from "./runtimeConfig.js";
|
|
15
16
|
import { createSearcheeFromMetafile } from "./searchee.js";
|
16
17
|
import { serve } from "./server.js";
|
17
18
|
import "./signalHandlers.js";
|
19
|
+
import { db } from "./db.js";
|
18
20
|
import { doStartupValidation } from "./startup.js";
|
19
21
|
import { parseTorrentFromFilename } from "./torrent.js";
|
20
22
|
const require = createRequire(import.meta.url);
|
@@ -27,27 +29,33 @@ function fallback(...args) {
|
|
27
29
|
return undefined;
|
28
30
|
}
|
29
31
|
function processOptions(options) {
|
30
|
-
|
31
|
-
|
32
|
+
if (options.rssCadence) {
|
33
|
+
options.rssCadence = Math.max(ms(options.rssCadence), ms("10 minutes"));
|
34
|
+
}
|
35
|
+
if (options.searchCadence) {
|
36
|
+
options.searchCadence = Math.max(ms(options.searchCadence), ms("1 day"));
|
37
|
+
}
|
38
|
+
if (options.excludeOlder) {
|
39
|
+
options.excludeOlder = ms(options.excludeOlder);
|
40
|
+
}
|
41
|
+
if (options.excludeRecentSearch) {
|
42
|
+
options.excludeRecentSearch = ms(options.excludeRecentSearch);
|
43
|
+
}
|
32
44
|
return options;
|
33
45
|
}
|
34
46
|
const fileConfig = await getFileConfig();
|
35
47
|
function createCommandWithSharedOptions(name, description) {
|
36
|
-
var _a;
|
37
48
|
return program
|
38
49
|
.command(name)
|
39
50
|
.description(description)
|
40
|
-
.option("-u, --jackett-server-url <url>", "DEPRECATED: Your Jackett server url", fileConfig.jackettServerUrl)
|
41
|
-
.option("-k, --jackett-api-key <key>", "DEPRECATED: Your Jackett API key", fileConfig.jackettApiKey)
|
42
|
-
.option("-t, --trackers <tracker1>,<tracker2>", "DEPRECATED: Comma-separated list of Jackett tracker ids to search (Tracker ids can be found in their Torznab feed paths)", fallback((_a = fileConfig.trackers) === null || _a === void 0 ? void 0 : _a.join(","), ""))
|
43
51
|
.option("-T, --torznab <urls...>", "Torznab urls with apikey included (separated by spaces)", fallback(fileConfig.torznab))
|
44
52
|
.requiredOption("-i, --torrent-dir <dir>", "Directory with torrent files", fileConfig.torrentDir)
|
45
53
|
.requiredOption("-s, --output-dir <dir>", "Directory to save results in", fileConfig.outputDir)
|
46
|
-
.requiredOption("
|
54
|
+
.requiredOption("--include-non-videos", "Include torrents which contain non-video files", fallback(fileConfig.includeNonVideos, false))
|
47
55
|
.option("-e, --include-episodes", "Include single-episode torrents in the search", fallback(fileConfig.includeEpisodes, false))
|
48
56
|
.requiredOption("--fuzzy-size-threshold <decimal>", "The size difference allowed to be considered a match.", fallback(fileConfig.fuzzySizeThreshold, 0.02))
|
49
|
-
.option("-x, --exclude-older <cutoff>", "Exclude torrents first seen more than n minutes ago. Bypasses the -a flag.",
|
50
|
-
.option("-r, --exclude-recent-search <cutoff>", "Exclude torrents which have been searched more recently than n minutes ago. Bypasses the -a flag.",
|
57
|
+
.option("-x, --exclude-older <cutoff>", "Exclude torrents first seen more than n minutes ago. Bypasses the -a flag.", fileConfig.excludeOlder)
|
58
|
+
.option("-r, --exclude-recent-search <cutoff>", "Exclude torrents which have been searched more recently than n minutes ago. Bypasses the -a flag.", fileConfig.excludeRecentSearch)
|
51
59
|
.requiredOption("-v, --verbose", "Log verbose output", false)
|
52
60
|
.addOption(new Option("-A, --action <action>", "If set to 'inject', cross-seed will attempt to add the found torrents to your torrent client.")
|
53
61
|
.default(fallback(fileConfig.action, Action.SAVE))
|
@@ -55,7 +63,8 @@ function createCommandWithSharedOptions(name, description) {
|
|
55
63
|
.makeOptionMandatory())
|
56
64
|
.option("--rtorrent-rpc-url <url>", "The url of your rtorrent XMLRPC interface. Requires '-A inject'. See the docs for more information.", fileConfig.rtorrentRpcUrl)
|
57
65
|
.option("--qbittorrent-url <url>", "The url of your qBittorrent webui. Requires '-A inject'. See the docs for more information.", fileConfig.qbittorrentUrl)
|
58
|
-
.option("--notification-webhook-url <url>", "cross-seed will send POST requests to this url with a JSON payload of { title, body }", fileConfig.notificationWebhookUrl)
|
66
|
+
.option("--notification-webhook-url <url>", "cross-seed will send POST requests to this url with a JSON payload of { title, body }", fileConfig.notificationWebhookUrl)
|
67
|
+
.requiredOption("-d, --delay <delay>", "Pause duration (seconds) between searches", parseFloat, fallback(fileConfig.delay, 10));
|
59
68
|
}
|
60
69
|
program.name(packageDotJson.name);
|
61
70
|
program.description(chalk.yellow.bold("cross-seed"));
|
@@ -70,7 +79,9 @@ program
|
|
70
79
|
program
|
71
80
|
.command("clear-cache")
|
72
81
|
.description("Clear the cache of downloaded-and-rejected torrents")
|
73
|
-
.action(
|
82
|
+
.action(async () => {
|
83
|
+
await db("decision").del();
|
84
|
+
});
|
74
85
|
program
|
75
86
|
.command("test-notification")
|
76
87
|
.description("Send a test notification")
|
@@ -96,6 +107,8 @@ program
|
|
96
107
|
});
|
97
108
|
createCommandWithSharedOptions("daemon", "Start the cross-seed daemon")
|
98
109
|
.option("-p, --port <port>", "Listen on a custom port", (n) => parseInt(n), fallback(fileConfig.port, 2468))
|
110
|
+
.option("--search-cadence <cadence>", "Run searches on a schedule. Format: https://github.com/vercel/ms", fileConfig.searchCadence)
|
111
|
+
.option("--rss-cadence <cadence>", "Run an rss scan on a schedule. Format: https://github.com/vercel/ms", fileConfig.rssCadence)
|
99
112
|
.action(async (options) => {
|
100
113
|
try {
|
101
114
|
const runtimeConfig = processOptions(options);
|
@@ -109,8 +122,10 @@ createCommandWithSharedOptions("daemon", "Start the cross-seed daemon")
|
|
109
122
|
if (process.env.DOCKER_ENV === "true") {
|
110
123
|
generateConfig({ docker: true });
|
111
124
|
}
|
125
|
+
await db.migrate.latest();
|
112
126
|
await doStartupValidation();
|
113
|
-
|
127
|
+
serve(options.port);
|
128
|
+
jobsLoop();
|
114
129
|
}
|
115
130
|
catch (e) {
|
116
131
|
if (e instanceof CrossSeedError) {
|
@@ -122,8 +137,6 @@ createCommandWithSharedOptions("daemon", "Start the cross-seed daemon")
|
|
122
137
|
}
|
123
138
|
});
|
124
139
|
createCommandWithSharedOptions("search", "Search for cross-seeds")
|
125
|
-
.requiredOption("-o, --offset <offset>", "Offset to start from", (n) => parseInt(n), 0)
|
126
|
-
.requiredOption("-d, --delay <delay>", "Pause duration (seconds) between searches", parseFloat, fallback(fileConfig.delay, 10))
|
127
140
|
.addOption(new Option("--torrents <torrents...>", "torrent files separated by spaces. This is a debug option and may be removed without warning.").hideHelp())
|
128
141
|
.action(async (options) => {
|
129
142
|
try {
|
@@ -138,16 +151,13 @@ createCommandWithSharedOptions("search", "Search for cross-seeds")
|
|
138
151
|
if (process.env.DOCKER_ENV === "true") {
|
139
152
|
generateConfig({ docker: true });
|
140
153
|
}
|
154
|
+
await db.migrate.latest();
|
141
155
|
await doStartupValidation();
|
142
156
|
await main();
|
157
|
+
await db.destroy();
|
143
158
|
}
|
144
159
|
catch (e) {
|
145
|
-
|
146
|
-
e.print();
|
147
|
-
process.exitCode = 1;
|
148
|
-
return;
|
149
|
-
}
|
150
|
-
throw e;
|
160
|
+
exitOnCrossSeedErrors(e);
|
151
161
|
}
|
152
162
|
});
|
153
163
|
await program.parseAsync();
|
package/dist/cmd.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cmd.js","sourceRoot":"","sources":["../src/cmd.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dist/config.template.cjs
CHANGED
@@ -1,26 +1,11 @@
|
|
1
1
|
// If you find yourself always using the same command-line flag, you can set
|
2
2
|
// it here as a default.
|
3
3
|
module.exports = {
|
4
|
-
/**
|
5
|
-
* @deprecated use torznab instead
|
6
|
-
*/
|
7
|
-
jackettServerUrl: "http://localhost:9117/jackett",
|
8
|
-
/**
|
9
|
-
* @deprecated use torznab instead
|
10
|
-
*/
|
11
|
-
jackettApiKey: "YOUR_JACKETT_API_KEY_HERE",
|
12
4
|
/**
|
13
5
|
* Pause at least this much in between each Jackett search. Higher is safer.
|
14
6
|
* It is not recommended to set this to less than 2 seconds.
|
15
7
|
*/
|
16
8
|
delay: 10,
|
17
|
-
/**
|
18
|
-
* @deprecated use torznab instead
|
19
|
-
* Trackers to search
|
20
|
-
* Set to [] if you want to search all trackers.
|
21
|
-
* Tracker ids can be found in their Torznab feed paths
|
22
|
-
*/
|
23
|
-
trackers: ["oink", "tehconnection"],
|
24
9
|
/**
|
25
10
|
* List of Torznab urls.
|
26
11
|
* The path should end in /api
|
@@ -44,22 +29,33 @@ module.exports = {
|
|
44
29
|
*/
|
45
30
|
includeEpisodes: false,
|
46
31
|
/**
|
47
|
-
*
|
48
|
-
*
|
32
|
+
* Include torrents which contain non-video files
|
33
|
+
* This option does not override includeEpisodes.
|
34
|
+
* To search for everything except episodes, use (includeEpisodes: false, includeNonVideos: true)
|
35
|
+
* To search for everything including episodes, use (includeEpisodes: true, includeNonVideos: true)
|
49
36
|
*/
|
50
|
-
|
37
|
+
includeNonVideos: false,
|
51
38
|
/**
|
52
39
|
* fuzzy size match threshold
|
53
40
|
* decimal value (0.02 = 2%)
|
54
41
|
*/
|
55
42
|
fuzzySizeThreshold: 0.02,
|
56
43
|
/**
|
57
|
-
* Exclude torrents first seen more than
|
44
|
+
* Exclude torrents first seen more than this long ago.
|
45
|
+
* Format: https://github.com/vercel/ms
|
46
|
+
* Examples:
|
47
|
+
* "10min"
|
48
|
+
* "2w"
|
49
|
+
* "3 days"
|
58
50
|
*/
|
59
51
|
excludeOlder: undefined,
|
60
52
|
/**
|
61
53
|
* Exclude torrents which have been searched
|
62
|
-
* more recently than
|
54
|
+
* more recently than this long ago.
|
55
|
+
* Examples:
|
56
|
+
* "10min"
|
57
|
+
* "2w"
|
58
|
+
* "3 days"
|
63
59
|
*/
|
64
60
|
excludeRecentSearch: undefined,
|
65
61
|
/**
|
@@ -90,5 +86,24 @@ module.exports = {
|
|
90
86
|
* Listen on a custom port.
|
91
87
|
*/
|
92
88
|
port: 2468,
|
89
|
+
/**
|
90
|
+
* Run rss scans on a schedule. Format: https://github.com/vercel/ms
|
91
|
+
* Set to undefined or null to disable. Minimum of 10 minutes.
|
92
|
+
* Examples:
|
93
|
+
* "10min"
|
94
|
+
* "2w"
|
95
|
+
* "3 days"
|
96
|
+
*/
|
97
|
+
rssCadence: undefined,
|
98
|
+
/**
|
99
|
+
* Run searches on a schedule. Format: https://github.com/vercel/ms
|
100
|
+
* Set to undefined or null to disable. Minimum of 1 day.
|
101
|
+
* If you have RSS enabled, you won't need this to run often (2+ weeks recommended)
|
102
|
+
* Examples:
|
103
|
+
* "10min"
|
104
|
+
* "2w"
|
105
|
+
* "3 days"
|
106
|
+
*/
|
107
|
+
searchCadence: undefined,
|
93
108
|
};
|
94
109
|
//# sourceMappingURL=config.template.cjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"config.template.cjs","sourceRoot":"","sources":["../src/config.template.cjs"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,wBAAwB;AAExB,MAAM,CAAC,OAAO,GAAG;IAChB
|
1
|
+
{"version":3,"file":"config.template.cjs","sourceRoot":"","sources":["../src/config.template.cjs"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,wBAAwB;AAExB,MAAM,CAAC,OAAO,GAAG;IAChB;;;OAGG;IACH,KAAK,EAAE,EAAE;IACT;;;;;OAKG;IACH,OAAO,EAAE,EAAE;IAEX;;;;;OAKG;IACH,UAAU,EAAE,2BAA2B;IAEvC;;OAEG;IACH,SAAS,EAAE,GAAG;IAEd;;OAEG;IACH,eAAe,EAAE,KAAK;IAEtB;;;;;OAKG;IACH,gBAAgB,EAAE,KAAK;IAEvB;;;OAGG;IACH,kBAAkB,EAAE,IAAI;IAExB;;;;;;;OAOG;IACH,YAAY,EAAE,SAAS;IAEvB;;;;;;;OAOG;IACH,mBAAmB,EAAE,SAAS;IAE9B;;;OAGG;IACH,MAAM,EAAE,MAAM;IAEd;;;;OAIG;IACH,cAAc,EAAE,SAAS;IAEzB;;;;;OAKG;IACH,cAAc,EAAE,SAAS;IAEzB;;;;OAIG;IACH,sBAAsB,EAAE,SAAS;IAEjC;;OAEG;IACH,IAAI,EAAE,IAAI;IAEV;;;;;;;OAOG;IACH,UAAU,EAAE,SAAS;IAErB;;;;;;;;OAQG;IACH,aAAa,EAAE,SAAS;CACxB,CAAC"}
|
@@ -1,30 +1,16 @@
|
|
1
1
|
// If you find yourself always using the same command-line flag, you can set
|
2
2
|
// it here as a default.
|
3
3
|
module.exports = {
|
4
|
-
|
5
|
-
*
|
6
|
-
*/
|
7
|
-
jackettServerUrl: "http://localhost:9117/jackett",
|
8
|
-
/**
|
9
|
-
* @deprecated use torznab instead
|
10
|
-
*/
|
11
|
-
jackettApiKey: "YOUR_JACKETT_API_KEY_HERE",
|
12
|
-
/**
|
13
|
-
* Pause at least this much in between each Jackett search. Higher is safer.
|
4
|
+
/*
|
5
|
+
* Pause at least this much in between each search. Higher is safer.
|
14
6
|
* It is not recommended to set this to less than 2 seconds.
|
15
7
|
*/
|
16
8
|
delay: 10,
|
17
9
|
/**
|
18
|
-
*
|
19
|
-
* Trackers to search
|
20
|
-
* Set to [] if you want to search all trackers.
|
21
|
-
* Tracker ids can be found in their Torznab feed paths
|
22
|
-
*/
|
23
|
-
trackers: ["oink", "tehconnection"],
|
24
|
-
/**
|
25
|
-
* List of Torznab urls.
|
10
|
+
* List of Torznab URLs.
|
26
11
|
* For Jackett, click "Copy RSS feed"
|
27
12
|
* For Prowlarr, click (i) and copy the Torznab Url, then append "?apikey=YOUR_PROWLARR_API_KEY"
|
13
|
+
* Wrap each URL in quotation marks, and separate them with commas.
|
28
14
|
*/
|
29
15
|
torznab: [],
|
30
16
|
/**
|
@@ -47,22 +33,33 @@ module.exports = {
|
|
47
33
|
*/
|
48
34
|
includeEpisodes: false,
|
49
35
|
/**
|
50
|
-
*
|
51
|
-
*
|
36
|
+
* Include torrents which contain non-video files
|
37
|
+
* This option does not override includeEpisodes.
|
38
|
+
* To search for everything except episodes, use (includeEpisodes: false, includeNonVideos: true)
|
39
|
+
* To search for everything including episodes, use (includeEpisodes: true, includeNonVideos: true)
|
52
40
|
*/
|
53
|
-
|
41
|
+
includeNonVideos: false,
|
54
42
|
/**
|
55
43
|
* fuzzy size match threshold
|
56
44
|
* decimal value (0.02 = 2%)
|
57
45
|
*/
|
58
46
|
fuzzySizeThreshold: 0.02,
|
59
47
|
/**
|
60
|
-
* Exclude torrents first seen more than
|
48
|
+
* Exclude torrents first seen more than this long ago.
|
49
|
+
* Format: https://github.com/vercel/ms
|
50
|
+
* Examples:
|
51
|
+
* "10min"
|
52
|
+
* "2w"
|
53
|
+
* "3 days"
|
61
54
|
*/
|
62
55
|
excludeOlder: undefined,
|
63
56
|
/**
|
64
57
|
* Exclude torrents which have been searched
|
65
|
-
* more recently than
|
58
|
+
* more recently than this long ago.
|
59
|
+
* Examples:
|
60
|
+
* "10min"
|
61
|
+
* "2w"
|
62
|
+
* "3 days"
|
66
63
|
*/
|
67
64
|
excludeRecentSearch: undefined,
|
68
65
|
/**
|
@@ -93,5 +90,24 @@ module.exports = {
|
|
93
90
|
* Listen on a custom port.
|
94
91
|
*/
|
95
92
|
port: 2468,
|
93
|
+
/**
|
94
|
+
* Run rss scans on a schedule. Format: https://github.com/vercel/ms
|
95
|
+
* Set to undefined or null to disable. Minimum of 10 minutes.
|
96
|
+
* Examples:
|
97
|
+
* "10min"
|
98
|
+
* "2w"
|
99
|
+
* "3 days"
|
100
|
+
*/
|
101
|
+
rssCadence: undefined,
|
102
|
+
/**
|
103
|
+
* Run searches on a schedule. Format: https://github.com/vercel/ms
|
104
|
+
* Set to undefined or null to disable. Minimum of 1 day.
|
105
|
+
* If you have RSS enabled, you won't need this to run often (2+ weeks recommended)
|
106
|
+
* Examples:
|
107
|
+
* "10min"
|
108
|
+
* "2w"
|
109
|
+
* "3 days"
|
110
|
+
*/
|
111
|
+
searchCadence: undefined,
|
96
112
|
};
|
97
113
|
//# sourceMappingURL=config.template.docker.cjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"config.template.docker.cjs","sourceRoot":"","sources":["../src/config.template.docker.cjs"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,wBAAwB;AAExB,MAAM,CAAC,OAAO,GAAG;IAChB
|
1
|
+
{"version":3,"file":"config.template.docker.cjs","sourceRoot":"","sources":["../src/config.template.docker.cjs"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,wBAAwB;AAExB,MAAM,CAAC,OAAO,GAAG;IAChB;;;OAGG;IACH,KAAK,EAAE,EAAE;IAET;;;;;OAKG;IACH,OAAO,EAAE,EAAE;IAEX;;;;;;;OAOG;IACH,UAAU,EAAE,WAAW;IAEvB;;;;OAIG;IACH,SAAS,EAAE,cAAc;IAEzB;;OAEG;IACH,eAAe,EAAE,KAAK;IAEtB;;;;;OAKG;IACH,gBAAgB,EAAE,KAAK;IAEvB;;;OAGG;IACH,kBAAkB,EAAE,IAAI;IAExB;;;;;;;OAOG;IACH,YAAY,EAAE,SAAS;IAEvB;;;;;;;OAOG;IACH,mBAAmB,EAAE,SAAS;IAE9B;;;OAGG;IACH,MAAM,EAAE,MAAM;IAEd;;;;OAIG;IACH,cAAc,EAAE,SAAS;IAEzB;;;;;OAKG;IACH,cAAc,EAAE,SAAS;IAEzB;;;;OAIG;IACH,sBAAsB,EAAE,SAAS;IAEjC;;OAEG;IACH,IAAI,EAAE,IAAI;IAEV;;;;;;;OAOG;IACH,UAAU,EAAE,SAAS;IAErB;;;;;;;;OAQG;IACH,aAAa,EAAE,SAAS;CAExB,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../src/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAGpC,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,cAAc,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;
|
1
|
+
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../src/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAGpC,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,cAAc,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AA2BlD,MAAM,UAAU,MAAM;IACrB,OAAO,CACN,OAAO,CAAC,GAAG,CAAC,UAAU;QACtB,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO;YAC5B,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,cAAc,CAAC,IAAI,CAAC;YAC7D,CAAC,C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MAAM,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;KACpE;IAAC,OAAO,CAAC,EAAE;QACX,IAAI,CAAC,CAAC,IAAI,KAAK,sBAAsB;YAAE,MAAM,CAAC,CAAC;QAC/C,OAAO,EAAE,CAAC;KACV;AACF,CAAC"}
|
package/dist/db.js
CHANGED
@@ -1,29 +1,12 @@
|
|
1
|
-
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
dbVersion: 3,
|
13
|
-
};
|
14
|
-
const db = new LowSync(new JSONFileSync(path.join(appDir(), "cache.json")));
|
15
|
-
db.read();
|
16
|
-
(_a = db.data) !== null && _a !== void 0 ? _a : (db.data = emptyDatabase);
|
17
|
-
const dbVersion = db.data.dbVersion;
|
18
|
-
if (!dbVersion || dbVersion < emptyDatabase.dbVersion) {
|
19
|
-
db.data = emptyDatabase;
|
20
|
-
}
|
21
|
-
db.write();
|
22
|
-
export function dropDatabase() {
|
23
|
-
db.data = emptyDatabase;
|
24
|
-
db.write();
|
25
|
-
unlinkSync(path.join(appDir(), "cache.json"));
|
26
|
-
rimraf.sync(path.join(appDir(), "torrent_cache"));
|
27
|
-
}
|
28
|
-
export default db;
|
1
|
+
import Knex from "knex";
|
2
|
+
import { join } from "path";
|
3
|
+
import { appDir } from "./configuration.js";
|
4
|
+
import { migrations } from "./migrations/migrations.js";
|
5
|
+
export const db = Knex.knex({
|
6
|
+
client: "better-sqlite3",
|
7
|
+
connection: { filename: join(appDir(), "cross-seed.db") },
|
8
|
+
migrations: { migrationSource: migrations, disableTransactions: true },
|
9
|
+
useNullAsDefault: true,
|
10
|
+
acquireConnectionTimeout: 5000,
|
11
|
+
});
|
29
12
|
//# sourceMappingURL=db.js.map
|
package/dist/db.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"db.js","sourceRoot":"","sources":["../src/db.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"db.js","sourceRoot":"","sources":["../src/db.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,MAAM,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC;IAC3B,MAAM,EAAE,gBAAgB;IACxB,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,eAAe,CAAC,EAAE;IACzD,UAAU,EAAE,EAAE,eAAe,EAAE,UAAU,EAAE,mBAAmB,EAAE,IAAI,EAAE;IACtE,gBAAgB,EAAE,IAAI;IACtB,wBAAwB,EAAE,IAAI;CAC9B,CAAC,CAAC"}
|
package/dist/decide.js
CHANGED
@@ -3,9 +3,9 @@ import parseTorrent from "parse-torrent";
|
|
3
3
|
import path from "path";
|
4
4
|
import { appDir } from "./configuration.js";
|
5
5
|
import { Decision, TORRENT_CACHE_FOLDER } from "./constants.js";
|
6
|
-
import db from "./db.js";
|
7
6
|
import { Label, logger } from "./logger.js";
|
8
7
|
import { getRuntimeConfig } from "./runtimeConfig.js";
|
8
|
+
import { db } from "./db.js";
|
9
9
|
import { parseTorrentFromFilename, parseTorrentFromURL } from "./torrent.js";
|
10
10
|
const createReasonLogger = (Title, tracker, name) => (decision, cached) => {
|
11
11
|
function logReason(reason) {
|
@@ -72,7 +72,7 @@ async function assessCandidateHelper({ link, size }, searchee, hashesToExclude)
|
|
72
72
|
if (!compareFileTrees(info, searchee)) {
|
73
73
|
return { decision: Decision.FILE_TREE_MISMATCH };
|
74
74
|
}
|
75
|
-
return { decision: Decision.MATCH, info };
|
75
|
+
return { decision: Decision.MATCH, metafile: info };
|
76
76
|
}
|
77
77
|
function existsInTorrentCache(infoHash) {
|
78
78
|
return existsSync(path.join(appDir(), TORRENT_CACHE_FOLDER, `${infoHash}.cached.torrent`));
|
@@ -83,27 +83,38 @@ async function getCachedTorrentFile(infoHash) {
|
|
83
83
|
function cacheTorrentFile(meta) {
|
84
84
|
writeFileSync(path.join(appDir(), TORRENT_CACHE_FOLDER, `${meta.infoHash}.cached.torrent`), parseTorrent.toTorrentFile(meta));
|
85
85
|
}
|
86
|
-
async function assessAndSaveResults(result, searchee,
|
86
|
+
async function assessAndSaveResults(result, searchee, guid, infoHashesToExclude) {
|
87
87
|
const assessment = await assessCandidateHelper(result, searchee, infoHashesToExclude);
|
88
|
-
db.data.decisions[searchee.name][Guid] = {
|
89
|
-
decision: assessment.decision,
|
90
|
-
lastSeen: Date.now(),
|
91
|
-
firstSeen: Date.now(),
|
92
|
-
};
|
93
88
|
if (assessment.decision === Decision.MATCH) {
|
94
|
-
|
95
|
-
assessment.info.infoHash;
|
96
|
-
cacheTorrentFile(assessment.info);
|
89
|
+
cacheTorrentFile(assessment.metafile);
|
97
90
|
}
|
91
|
+
await db.transaction(async (trx) => {
|
92
|
+
const now = Date.now();
|
93
|
+
const { id } = await trx("searchee")
|
94
|
+
.select("id")
|
95
|
+
.where({ name: searchee.name })
|
96
|
+
.first();
|
97
|
+
await trx("decision").insert({
|
98
|
+
searchee_id: id,
|
99
|
+
guid: guid,
|
100
|
+
decision: assessment.decision,
|
101
|
+
info_hash: assessment.decision === Decision.MATCH
|
102
|
+
? assessment.metafile.infoHash
|
103
|
+
: null,
|
104
|
+
last_seen: now,
|
105
|
+
first_seen: now,
|
106
|
+
});
|
107
|
+
});
|
98
108
|
return assessment;
|
99
109
|
}
|
100
110
|
async function assessCandidateCaching(candidate, searchee, infoHashesToExclude) {
|
101
|
-
var _a;
|
102
|
-
var _b, _c;
|
103
111
|
const { guid, name, tracker } = candidate;
|
104
112
|
const logReason = createReasonLogger(name, tracker, searchee.name);
|
105
|
-
|
106
|
-
|
113
|
+
const cacheEntry = await db("decision")
|
114
|
+
.select("decision.*")
|
115
|
+
.join("searchee", "decision.searchee_id", "searchee.id")
|
116
|
+
.where({ name: searchee.name, guid })
|
117
|
+
.first();
|
107
118
|
let assessment;
|
108
119
|
if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.decision) ||
|
109
120
|
cacheEntry.decision === Decision.DOWNLOAD_FAILED) {
|
@@ -114,15 +125,16 @@ async function assessCandidateCaching(candidate, searchee, infoHashesToExclude)
|
|
114
125
|
infoHashesToExclude.includes(cacheEntry.infoHash)) {
|
115
126
|
// has been added since the last run
|
116
127
|
assessment = { decision: Decision.INFO_HASH_ALREADY_EXISTS };
|
117
|
-
db
|
118
|
-
|
128
|
+
await db("decision")
|
129
|
+
.where({ id: cacheEntry.id })
|
130
|
+
.update({ decision: Decision.INFO_HASH_ALREADY_EXISTS });
|
119
131
|
}
|
120
132
|
else if (cacheEntry.decision === Decision.MATCH &&
|
121
|
-
existsInTorrentCache(cacheEntry.
|
133
|
+
existsInTorrentCache(cacheEntry.info_hash)) {
|
122
134
|
// cached match
|
123
135
|
assessment = {
|
124
136
|
decision: cacheEntry.decision,
|
125
|
-
|
137
|
+
metafile: await getCachedTorrentFile(cacheEntry.info_hash),
|
126
138
|
};
|
127
139
|
}
|
128
140
|
else if (cacheEntry.decision === Decision.MATCH) {
|
@@ -134,8 +146,12 @@ async function assessCandidateCaching(candidate, searchee, infoHashesToExclude)
|
|
134
146
|
assessment = { decision: cacheEntry.decision };
|
135
147
|
logReason(cacheEntry.decision, true);
|
136
148
|
}
|
137
|
-
|
138
|
-
|
149
|
+
// if previously known
|
150
|
+
if (cacheEntry) {
|
151
|
+
await db("decision")
|
152
|
+
.where({ id: cacheEntry.id })
|
153
|
+
.update({ last_seen: Date.now() });
|
154
|
+
}
|
139
155
|
return assessment;
|
140
156
|
}
|
141
157
|
export { assessCandidateCaching as assessCandidate };
|
package/dist/decide.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"decide.js","sourceRoot":"","sources":["../src/decide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAC/C,OAAO,YAA0B,MAAM,eAAe,CAAC;AACvD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,
|
1
|
+
{"version":3,"file":"decide.js","sourceRoot":"","sources":["../src/decide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAC/C,OAAO,YAA0B,MAAM,eAAe,CAAC;AACvD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAO7E,MAAM,kBAAkB,GACvB,CAAC,KAAa,EAAE,OAAe,EAAE,IAAY,EAAE,EAAE,CACjD,CAAC,QAAkB,EAAE,MAAM,EAAQ,EAAE;IACpC,SAAS,SAAS,CAAC,MAAM;QACxB,MAAM,CAAC,OAAO,CAAC;YACd,KAAK,EAAE,KAAK,CAAC,MAAM;YACnB,OAAO,EAAE,GAAG,IAAI,mBAAmB,OAAO,YAAY,KAAK,MAAM,MAAM,EAAE;SACzE,CAAC,CAAC;IACJ,CAAC;IACD,IAAI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