cross-seed 6.13.6 → 7.0.0-2
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 +12 -13
- package/dist/Result.d.ts +27 -0
- package/dist/action.d.ts +34 -0
- package/dist/action.js +2 -1
- package/dist/action.js.map +1 -1
- package/dist/arr.d.ts +31 -0
- package/dist/arr.js +107 -39
- package/dist/arr.js.map +1 -1
- package/dist/auth.d.ts +3 -0
- package/dist/auth.js +9 -6
- package/dist/auth.js.map +1 -1
- package/dist/clients/Deluge.d.ts +153 -0
- package/dist/clients/Deluge.js +6 -6
- package/dist/clients/Deluge.js.map +1 -1
- package/dist/clients/QBittorrent.d.ts +218 -0
- package/dist/clients/RTorrent.d.ts +43 -0
- package/dist/clients/RTorrent.js +6 -3
- package/dist/clients/RTorrent.js.map +1 -1
- package/dist/clients/TorrentClient.d.ts +108 -0
- package/dist/clients/TorrentClient.js +136 -67
- package/dist/clients/TorrentClient.js.map +1 -1
- package/dist/clients/Transmission.d.ts +43 -0
- package/dist/clients/Transmission.js +2 -2
- package/dist/clients/Transmission.js.map +1 -1
- package/dist/cmd.d.ts +2 -0
- package/dist/cmd.js +42 -110
- package/dist/cmd.js.map +1 -1
- package/dist/configSchema.d.ts +1 -0
- package/dist/configSchema.js +1 -666
- package/dist/configSchema.js.map +1 -1
- package/dist/configuration.d.ts +63 -0
- package/dist/configuration.js +263 -24
- package/dist/configuration.js.map +1 -1
- package/dist/constants.d.ts +108 -0
- package/dist/constants.js +2 -32
- package/dist/constants.js.map +1 -1
- package/dist/dataFiles.d.ts +8 -0
- package/dist/dataFiles.js +21 -6
- package/dist/dataFiles.js.map +1 -1
- package/dist/db.d.ts +3 -0
- package/dist/dbConfig.d.ts +4 -0
- package/dist/dbConfig.js +67 -0
- package/dist/dbConfig.js.map +1 -0
- package/dist/decide.d.ts +25 -0
- package/dist/decide.js +4 -4
- package/dist/decide.js.map +1 -1
- package/dist/diff.d.ts +1 -0
- package/dist/errors.d.ts +3 -0
- package/dist/errors.js +0 -9
- package/dist/errors.js.map +1 -1
- package/dist/indexers.d.ts +105 -0
- package/dist/indexers.js +82 -14
- package/dist/indexers.js.map +1 -1
- package/dist/inject.d.ts +2 -0
- package/dist/jobs.d.ts +29 -0
- package/dist/jobs.js +14 -9
- package/dist/jobs.js.map +1 -1
- package/dist/logger.d.ts +29 -0
- package/dist/logger.js +18 -4
- package/dist/logger.js.map +1 -1
- package/dist/migrations/00-initialSchema.d.ts +9 -0
- package/dist/migrations/01-jobs.d.ts +9 -0
- package/dist/migrations/02-timestamps.d.ts +9 -0
- package/dist/migrations/03-rateLimits.d.ts +9 -0
- package/dist/migrations/04-auth.d.ts +9 -0
- package/dist/migrations/04-auth.js +1 -1
- package/dist/migrations/04-auth.js.map +1 -1
- package/dist/migrations/05-caps.d.ts +9 -0
- package/dist/migrations/06-uniqueDecisions.d.ts +9 -0
- package/dist/migrations/07-limits.d.ts +9 -0
- package/dist/migrations/08-rss.d.ts +9 -0
- package/dist/migrations/09-clientAndDataSearchees.d.ts +9 -0
- package/dist/migrations/10-indexerNameAudioBookCaps.d.ts +9 -0
- package/dist/migrations/11-trackers.d.ts +9 -0
- package/dist/migrations/12-user-auth.d.ts +9 -0
- package/dist/migrations/12-user-auth.js +22 -0
- package/dist/migrations/12-user-auth.js.map +1 -0
- package/dist/migrations/13-settings.d.ts +9 -0
- package/dist/migrations/13-settings.js +23 -0
- package/dist/migrations/13-settings.js.map +1 -0
- package/dist/migrations/14-indexer-enabled-flag.d.ts +9 -0
- package/dist/migrations/14-indexer-enabled-flag.js +12 -0
- package/dist/migrations/14-indexer-enabled-flag.js.map +1 -0
- package/dist/migrations/15-remove-url-unique-constraint.d.ts +9 -0
- package/dist/migrations/15-remove-url-unique-constraint.js +14 -0
- package/dist/migrations/15-remove-url-unique-constraint.js.map +1 -0
- package/dist/migrations/16-prune-inactive-indexers.d.ts +9 -0
- package/dist/migrations/16-prune-inactive-indexers.js +17 -0
- package/dist/migrations/16-prune-inactive-indexers.js.map +1 -0
- package/dist/migrations/migrations.d.ts +13 -0
- package/dist/migrations/migrations.js +10 -0
- package/dist/migrations/migrations.js.map +1 -1
- package/dist/parseTorrent.d.ts +53 -0
- package/dist/pipeline.d.ts +41 -0
- package/dist/pipeline.js +57 -10
- package/dist/pipeline.js.map +1 -1
- package/dist/preFilter.d.ts +25 -0
- package/dist/preFilter.js +15 -15
- package/dist/preFilter.js.map +1 -1
- package/dist/problems/linking.d.ts +2 -0
- package/dist/problems/linking.js +80 -0
- package/dist/problems/linking.js.map +1 -0
- package/dist/problems/path.d.ts +22 -0
- package/dist/problems/path.js +96 -0
- package/dist/problems/path.js.map +1 -0
- package/dist/problems.d.ts +13 -0
- package/dist/problems.js +48 -0
- package/dist/problems.js.map +1 -0
- package/dist/pushNotifier.d.ts +19 -0
- package/dist/routes/baseApi.d.ts +2 -0
- package/dist/routes/baseApi.js +354 -0
- package/dist/routes/baseApi.js.map +1 -0
- package/dist/routes/indexerApi.d.ts +6 -0
- package/dist/routes/indexerApi.js +165 -0
- package/dist/routes/indexerApi.js.map +1 -0
- package/dist/routes/staticFrontendPlugin.d.ts +4 -0
- package/dist/routes/staticFrontendPlugin.js +61 -0
- package/dist/routes/staticFrontendPlugin.js.map +1 -0
- package/dist/runtimeConfig.d.ts +6 -0
- package/dist/runtimeConfig.js +17 -1
- package/dist/runtimeConfig.js.map +1 -1
- package/dist/searchee.d.ts +108 -0
- package/dist/searchee.js +36 -5
- package/dist/searchee.js.map +1 -1
- package/dist/server.d.ts +4 -0
- package/dist/server.js +38 -429
- package/dist/server.js.map +1 -1
- package/dist/services/indexerService.d.ts +96 -0
- package/dist/services/indexerService.js +287 -0
- package/dist/services/indexerService.js.map +1 -0
- package/dist/sessionCookies.d.ts +5 -0
- package/dist/sessionCookies.js +27 -0
- package/dist/sessionCookies.js.map +1 -0
- package/dist/startup.d.ts +25 -0
- package/dist/startup.js +105 -151
- package/dist/startup.js.map +1 -1
- package/dist/torrent.d.ts +69 -0
- package/dist/torrent.js +17 -13
- package/dist/torrent.js.map +1 -1
- package/dist/torznab.d.ts +60 -0
- package/dist/torznab.js +14 -89
- package/dist/torznab.js.map +1 -1
- package/dist/trpc/fastifyAdapter.d.ts +2 -0
- package/dist/trpc/fastifyAdapter.js +9 -0
- package/dist/trpc/fastifyAdapter.js.map +1 -0
- package/dist/trpc/index.d.ts +49 -0
- package/dist/trpc/index.js +53 -0
- package/dist/trpc/index.js.map +1 -0
- package/dist/trpc/routers/auth.d.ts +43 -0
- package/dist/trpc/routers/auth.js +116 -0
- package/dist/trpc/routers/auth.js.map +1 -0
- package/dist/trpc/routers/clients.d.ts +21 -0
- package/dist/trpc/routers/clients.js +65 -0
- package/dist/trpc/routers/clients.js.map +1 -0
- package/dist/trpc/routers/health.d.ts +14 -0
- package/dist/trpc/routers/health.js +20 -0
- package/dist/trpc/routers/health.js.map +1 -0
- package/dist/trpc/routers/index.d.ts +391 -0
- package/dist/trpc/routers/index.js +23 -0
- package/dist/trpc/routers/index.js.map +1 -0
- package/dist/trpc/routers/indexers.d.ts +75 -0
- package/dist/trpc/routers/indexers.js +79 -0
- package/dist/trpc/routers/indexers.js.map +1 -0
- package/dist/trpc/routers/jobs.d.ts +33 -0
- package/dist/trpc/routers/jobs.js +84 -0
- package/dist/trpc/routers/jobs.js.map +1 -0
- package/dist/trpc/routers/logs.d.ts +27 -0
- package/dist/trpc/routers/logs.js +91 -0
- package/dist/trpc/routers/logs.js.map +1 -0
- package/dist/trpc/routers/searchees.d.ts +51 -0
- package/dist/trpc/routers/searchees.js +156 -0
- package/dist/trpc/routers/searchees.js.map +1 -0
- package/dist/trpc/routers/settings.d.ts +83 -0
- package/dist/trpc/routers/settings.js +92 -0
- package/dist/trpc/routers/settings.js.map +1 -0
- package/dist/trpc/routers/stats.d.ts +42 -0
- package/dist/trpc/routers/stats.js +102 -0
- package/dist/trpc/routers/stats.js.map +1 -0
- package/dist/userAuth.d.ts +21 -0
- package/dist/userAuth.js +86 -0
- package/dist/userAuth.js.map +1 -0
- package/dist/utils/authUtils.d.ts +10 -0
- package/dist/utils/authUtils.js +24 -0
- package/dist/utils/authUtils.js.map +1 -0
- package/dist/utils/logWatcher.d.ts +28 -0
- package/dist/utils/logWatcher.js +218 -0
- package/dist/utils/logWatcher.js.map +1 -0
- package/dist/utils/object.d.ts +1 -0
- package/dist/utils/object.js +4 -0
- package/dist/utils/object.js.map +1 -0
- package/dist/utils.d.ts +175 -0
- package/dist/utils.js +61 -38
- package/dist/utils.js.map +1 -1
- package/dist/webui/assets/FieldInfo-Bxj_j8SJ.js +1 -0
- package/dist/webui/assets/Page-C3rteCZt.js +1 -0
- package/dist/webui/assets/array-field-DVSC6nHP.js +1 -0
- package/dist/webui/assets/badge-DTZMtS0e.js +1 -0
- package/dist/webui/assets/check-Bu3ldi63.js +1 -0
- package/dist/webui/assets/chevron-down-CRy8M0kJ.js +1 -0
- package/dist/webui/assets/clients-CW8oEZoQ.js +1 -0
- package/dist/webui/assets/connect-YBNsnjWT.js +1 -0
- package/dist/webui/assets/debug-mz8-WYZj.js +1 -0
- package/dist/webui/assets/directories-BSK28RgR.js +1 -0
- package/dist/webui/assets/duration-field-C6xoSlJg.js +1 -0
- package/dist/webui/assets/general-lJJxZhH7.js +1 -0
- package/dist/webui/assets/health-CXbsVrie.js +1 -0
- package/dist/webui/assets/index-Bi48hI2z.js +54 -0
- package/dist/webui/assets/index-C-Ul7GNg.css +1 -0
- package/dist/webui/assets/index-C2cH1Gst.js +1 -0
- package/dist/webui/assets/index-Cc5bDmJr.js +1 -0
- package/dist/webui/assets/jobs-CxmNab9w.js +1 -0
- package/dist/webui/assets/library-vaj2W8sE.js +1 -0
- package/dist/webui/assets/loader-circle-M0gu1gZ-.js +1 -0
- package/dist/webui/assets/logs-Cu9RyKS0.js +1 -0
- package/dist/webui/assets/search-2R5sIdT8.js +1 -0
- package/dist/webui/assets/select-field-BCqNLDrJ.js +1 -0
- package/dist/webui/assets/select-zHgqMzLj.js +1 -0
- package/dist/webui/assets/settings-CMYjpTbZ.js +1 -0
- package/dist/webui/assets/submit-button-BtcnyggQ.js +1 -0
- package/dist/webui/assets/switch-G0W3uJVN.js +1 -0
- package/dist/webui/assets/switch-field-IBd9ORNq.js +1 -0
- package/dist/webui/assets/table-DvgJU7Gh.js +1 -0
- package/dist/webui/assets/test-tube-BIwmoM45.js +1 -0
- package/dist/webui/assets/text-field-DruSbGhy.js +1 -0
- package/dist/webui/assets/time-BSMZjmyW.js +1 -0
- package/dist/webui/assets/trackers-D-OpAe63.js +7 -0
- package/dist/webui/assets/use-form-validation-context-BkAfWAh0.js +1 -0
- package/dist/webui/assets/use-settings-form-submit-CDRh-E9U.js +2 -0
- package/dist/webui/assets/useQuery-A4Hv_4uX.js +1 -0
- package/dist/webui/index.html +13 -0
- package/node_modules/@cross-seed/shared/dist/configSchema.d.ts +261 -0
- package/node_modules/@cross-seed/shared/dist/configSchema.d.ts.map +1 -0
- package/node_modules/@cross-seed/shared/dist/configSchema.js +53 -0
- package/node_modules/@cross-seed/shared/dist/configSchema.js.map +1 -0
- package/node_modules/@cross-seed/shared/dist/constants.d.ts +122 -0
- package/node_modules/@cross-seed/shared/dist/constants.d.ts.map +1 -0
- package/node_modules/@cross-seed/shared/dist/constants.js +127 -0
- package/node_modules/@cross-seed/shared/dist/constants.js.map +1 -0
- package/node_modules/@cross-seed/shared/dist/tsconfig.tsbuildinfo +1 -0
- package/node_modules/@cross-seed/shared/dist/utils.d.ts +6 -0
- package/node_modules/@cross-seed/shared/dist/utils.d.ts.map +1 -0
- package/node_modules/@cross-seed/shared/dist/utils.js +9 -0
- package/node_modules/@cross-seed/shared/dist/utils.js.map +1 -0
- package/node_modules/@cross-seed/shared/package.json +22 -0
- package/package.json +35 -11
- package/dist/config.template.cjs +0 -353
- package/dist/config.template.cjs.map +0 -1
package/dist/cmd.js
CHANGED
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
import chalk from "chalk";
|
|
3
3
|
import { Option, program } from "commander";
|
|
4
4
|
import { getApiKey, resetApiKey } from "./auth.js";
|
|
5
|
-
import {
|
|
6
|
-
import { Action, LinkType, MatchMode, PROGRAM_NAME, PROGRAM_VERSION, } from "./constants.js";
|
|
5
|
+
import { PROGRAM_NAME, PROGRAM_VERSION } from "./constants.js";
|
|
7
6
|
import { db } from "./db.js";
|
|
8
7
|
import { updateTorrentCache } from "./decide.js";
|
|
9
8
|
import { diffCmd } from "./diff.js";
|
|
10
|
-
import { CrossSeedError } from "./errors.js";
|
|
11
9
|
import { clearIndexerFailures } from "./indexers.js";
|
|
12
10
|
import { injectSavedTorrents, restoreFromTorrentCache } from "./inject.js";
|
|
13
11
|
import { jobsLoop } from "./jobs.js";
|
|
@@ -16,99 +14,11 @@ import { sendTestNotification } from "./pushNotifier.js";
|
|
|
16
14
|
import { serve } from "./server.js";
|
|
17
15
|
import { withFullRuntime, withMinimalRuntime } from "./startup.js";
|
|
18
16
|
import { indexTorrentsAndDataDirs, parseTorrentFromPath } from "./torrent.js";
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
try {
|
|
22
|
-
fileConfig = await getFileConfig();
|
|
23
|
-
}
|
|
24
|
-
catch (e) {
|
|
25
|
-
if (e instanceof CrossSeedError) {
|
|
26
|
-
console.error(e.message);
|
|
27
|
-
process.exit(1);
|
|
28
|
-
}
|
|
29
|
-
throw e;
|
|
30
|
-
}
|
|
31
|
-
const apiKeyOption = new Option("--api-key <key>", "Provide your own API key to override the autogenerated one.").default(fileConfig.apiKey);
|
|
32
|
-
function createCommandWithSharedOptions(name, description) {
|
|
33
|
-
return program
|
|
34
|
-
.command(name)
|
|
35
|
-
.description(description)
|
|
36
|
-
.option("-T, --torznab <urls...>", "Torznab urls with apikey included (separated by spaces)",
|
|
37
|
-
// @ts-expect-error commander supports non-string defaults
|
|
38
|
-
fallback(fileConfig.torznab))
|
|
39
|
-
.option("--use-client-torrents", "Use torrents from your client for matching", fallback(fileConfig.useClientTorrents, false))
|
|
40
|
-
.option("--no-use-client-torrents", "Don't use torrents from your client for matching")
|
|
41
|
-
.option("--ignore-non-relevant-files-to-resume", "Ignore certain known irrelevant files when calculating resume size", fallback(fileConfig.ignoreNonRelevantFilesToResume, false))
|
|
42
|
-
.option("--no-ignore-non-relevant-files-to-resume", "Don't ignore certain known irrelevant files when calculating resume size")
|
|
43
|
-
.option("--data-dirs <dirs...>", "Directories to use if searching by data instead of torrents (separated by spaces)",
|
|
44
|
-
// @ts-expect-error commander supports non-string defaults
|
|
45
|
-
fallback(fileConfig.dataDirs))
|
|
46
|
-
.addOption(new Option("--match-mode <mode>", `"strict" will require all file names to match exactly. "flexible" allows for file renames. "partial" is like "flexible" but it ignores small files like .nfo/.srt if missing.`)
|
|
47
|
-
.default(fallback(fileConfig.matchMode, MatchMode.STRICT))
|
|
48
|
-
.choices(Object.values(MatchMode))
|
|
49
|
-
.makeOptionMandatory())
|
|
50
|
-
.option("--skip-recheck", "Skip rechecking torrents before resuming, unless necessary.", fallback(fileConfig.skipRecheck, true))
|
|
51
|
-
.option("--no-skip-recheck", "Recheck every torrent before resuming, even if unnecessary.")
|
|
52
|
-
.option("--auto-resume-max-download <number>", "The maximum size in bytes remaining for a torrent to be resumed", parseInt, fallback(fileConfig.autoResumeMaxDownload, 52428800))
|
|
53
|
-
.option("--link-category <cat>", "Torrent client category to set on linked torrents", fallback(fileConfig.linkCategory, "cross-seed-link"))
|
|
54
|
-
.option("--link-dir <dir>", "Directory to link the data for matches to", fileConfig.linkDir)
|
|
55
|
-
.option("--link-dirs <dirs...>", "Directories to link the data for matches to",
|
|
56
|
-
// @ts-expect-error commander supports non-string defaults
|
|
57
|
-
fallback(fileConfig.linkDirs))
|
|
58
|
-
.option("--flat-linking", "Use flat linking directory structure (without individual tracker folders)", fallback(fileConfig.flatLinking, false))
|
|
59
|
-
.addOption(new Option("--link-type <type>", "Use links of this type to inject data-based matches into your client")
|
|
60
|
-
.default(fallback(fileConfig.linkType, LinkType.SYMLINK))
|
|
61
|
-
.choices(Object.values(LinkType))
|
|
62
|
-
.makeOptionMandatory())
|
|
63
|
-
.option("--max-data-depth <depth>", "Max depth to look for searchees in dataDirs", (n) => parseInt(n), fallback(fileConfig.maxDataDepth, 2))
|
|
64
|
-
.option("-i, --torrent-dir <dir>", "Directory with torrent files", fileConfig.torrentDir)
|
|
65
|
-
.option("-s, --output-dir <dir>", "Directory to save results in", fileConfig.outputDir)
|
|
66
|
-
.option("--include-non-videos", "Include torrents which contain non-video files", fallback(fileConfig.includeNonVideos, false))
|
|
67
|
-
.option("--no-include-non-videos", "Don't include torrents which contain non-videos")
|
|
68
|
-
.option("--include-single-episodes", "Include single episode torrents in the search", fallback(fileConfig.includeSingleEpisodes, false))
|
|
69
|
-
.option("--no-include-single-episodes", "Don't include single episode torrents in the search")
|
|
70
|
-
.option("--season-from-episodes <decimal>", "Match season packs from episode torrents", parseFloat, fallback(fileConfig.seasonFromEpisodes, null))
|
|
71
|
-
.option("--no-season-from-episodes", "Don't match season packs from episode torrents")
|
|
72
|
-
.option("--fuzzy-size-threshold <decimal>", "The size difference allowed to be considered a match.", parseFloat, fallback(fileConfig.fuzzySizeThreshold, 0.02))
|
|
73
|
-
.option("-x, --exclude-older <cutoff>", "Exclude torrents first seen more than n minutes ago. Bypasses the -a flag.", fileConfig.excludeOlder)
|
|
74
|
-
.option("-r, --exclude-recent-search <cutoff>", "Exclude torrents which have been searched more recently than n minutes ago. Bypasses the -a flag.", fileConfig.excludeRecentSearch)
|
|
75
|
-
.option("-v, --verbose", "Log verbose output", false)
|
|
76
|
-
.addOption(new Option("-A, --action <action>", "If set to 'inject', cross-seed will attempt to add the found torrents to your torrent client.")
|
|
77
|
-
.default(fallback(fileConfig.action, Action.SAVE))
|
|
78
|
-
.choices(Object.values(Action)))
|
|
79
|
-
.option("--torrent-clients <clients...>", "The the client prefix, readonly status, and urls of your torrent clients.",
|
|
80
|
-
// @ts-expect-error commander supports non-string defaults
|
|
81
|
-
fallback(fileConfig.torrentClients, []))
|
|
82
|
-
.option("--rtorrent-rpc-url <url>", "The url of your rtorrent XMLRPC interface.", fileConfig.rtorrentRpcUrl)
|
|
83
|
-
.option("--qbittorrent-url <url>", "The url of your qBittorrent webui.", fileConfig.qbittorrentUrl)
|
|
84
|
-
.option("--transmission-rpc-url <url>", "The url of your Transmission RPC interface.", fileConfig.transmissionRpcUrl)
|
|
85
|
-
.option("--deluge-rpc-url <url>", "The url of your Deluge JSON-RPC interface.", fileConfig.delugeRpcUrl)
|
|
86
|
-
.option("--duplicate-categories", "Create and inject using categories with the same save paths as your normal categories", fallback(fileConfig.duplicateCategories, false))
|
|
87
|
-
.option("--notification-webhook-urls <urls...>", "cross-seed will send POST requests to these urls with a JSON payload of { title, body, extra }",
|
|
88
|
-
// @ts-expect-error commander supports non-string defaults
|
|
89
|
-
fileConfig.notificationWebhookUrls)
|
|
90
|
-
.option("--notification-webhook-url <url>", "cross-seed will send POST requests to this url with a JSON payload of { title, body, extra }", fileConfig.notificationWebhookUrl)
|
|
91
|
-
.option("-d, --delay <delay>", "Pause duration (seconds) between searches", parseFloat, fallback(fileConfig.delay, 30))
|
|
92
|
-
.option("--snatch-timeout <timeout>", "Timeout for unresponsive snatches", fallback(fileConfig.snatchTimeout, "30 seconds"))
|
|
93
|
-
.option("--search-timeout <timeout>", "Timeout for unresponsive searches", fallback(fileConfig.searchTimeout, "2 minutes"))
|
|
94
|
-
.option("--search-limit <number>", "The number of searches before stops", (n) => parseInt(n), fallback(fileConfig.searchLimit, 0))
|
|
95
|
-
.option("--block-list <strings...>", "The infohashes and/or strings in torrent name to block from cross-seed",
|
|
96
|
-
// @ts-expect-error commander supports non-string defaults
|
|
97
|
-
fallback(fileConfig.blockList, []))
|
|
98
|
-
.option("--sonarr <urls...>", "Sonarr API URL(s)",
|
|
99
|
-
// @ts-expect-error commander supports non-string defaults
|
|
100
|
-
fileConfig.sonarr)
|
|
101
|
-
.option("--radarr <urls...>", "Radarr API URL(s)",
|
|
102
|
-
// @ts-expect-error commander supports non-string defaults
|
|
103
|
-
fileConfig.radarr);
|
|
104
|
-
}
|
|
17
|
+
import { resetUsers } from "./userAuth.js";
|
|
18
|
+
const verboseOption = new Option("-v, --verbose", "Log verbose output").default(false);
|
|
105
19
|
program.name(PROGRAM_NAME);
|
|
106
20
|
program.description(chalk.yellow.bold(`${PROGRAM_NAME} v${PROGRAM_VERSION}`));
|
|
107
21
|
program.version(PROGRAM_VERSION, "-V, --version", "output the current version");
|
|
108
|
-
program
|
|
109
|
-
.command("gen-config")
|
|
110
|
-
.description("Generate a config file")
|
|
111
|
-
.action(withMinimalRuntime(generateConfig));
|
|
112
22
|
program
|
|
113
23
|
.command("update-torrent-cache-trackers")
|
|
114
24
|
.description("Update announce urls in the torrent cache")
|
|
@@ -157,40 +67,62 @@ program
|
|
|
157
67
|
program
|
|
158
68
|
.command("api-key")
|
|
159
69
|
.description("Show the api key")
|
|
160
|
-
.addOption(
|
|
70
|
+
.addOption(new Option("--api-key <key>", "Provide your own API key to override the autogenerated one."))
|
|
161
71
|
.action(withMinimalRuntime(getApiKey));
|
|
162
72
|
program
|
|
163
73
|
.command("reset-api-key")
|
|
164
74
|
.description("Reset the api key")
|
|
165
75
|
.action(withMinimalRuntime(resetApiKey));
|
|
166
|
-
|
|
167
|
-
.
|
|
168
|
-
.
|
|
76
|
+
program
|
|
77
|
+
.command("reset-user")
|
|
78
|
+
.description("Delete all users and sessions")
|
|
79
|
+
.action(withMinimalRuntime(resetUsers));
|
|
80
|
+
program
|
|
81
|
+
.command("daemon")
|
|
82
|
+
.description("Start the cross-seed daemon")
|
|
83
|
+
.option("-p, --port <port>", "Listen on a custom port", (n) => parseInt(n))
|
|
84
|
+
.option("--host <host>", "Bind to a specific IP address")
|
|
85
|
+
.option("--base-path <path>", "Serve cross-seed behind this base path", "")
|
|
169
86
|
.option("--no-port", "Do not listen on any port")
|
|
170
|
-
.
|
|
171
|
-
.option("--rss-cadence <cadence>", "Run an rss scan on a schedule. Format: https://github.com/vercel/ms", fileConfig.rssCadence)
|
|
172
|
-
.addOption(apiKeyOption)
|
|
87
|
+
.addOption(verboseOption)
|
|
173
88
|
.action(withFullRuntime(async (options) => {
|
|
89
|
+
const serverPromise = serve(options.port, options.host, options.basePath);
|
|
174
90
|
await indexTorrentsAndDataDirs({ startup: true });
|
|
175
91
|
// technically this will never resolve, but it's necessary to keep the process running
|
|
176
|
-
await Promise.all([
|
|
92
|
+
await Promise.all([serverPromise, jobsLoop()]);
|
|
177
93
|
}));
|
|
178
|
-
|
|
94
|
+
program
|
|
95
|
+
.command("rss")
|
|
96
|
+
.description("Run an rss scan")
|
|
97
|
+
.addOption(verboseOption)
|
|
98
|
+
.action(withFullRuntime(async () => {
|
|
179
99
|
await indexTorrentsAndDataDirs({ startup: true });
|
|
180
100
|
await scanRssFeeds();
|
|
181
101
|
}));
|
|
182
|
-
|
|
102
|
+
program
|
|
103
|
+
.command("search")
|
|
104
|
+
.description("Search for cross-seeds")
|
|
183
105
|
.addOption(new Option("--torrents <torrents...>", "torrent files separated by spaces").hideHelp())
|
|
184
|
-
.
|
|
185
|
-
.option("--no-exclude-recent-search", "Don't Exclude torrents based on when they were last searched.")
|
|
106
|
+
.addOption(verboseOption)
|
|
186
107
|
.action(withFullRuntime(() => bulkSearch()));
|
|
187
|
-
|
|
188
|
-
.
|
|
189
|
-
.
|
|
108
|
+
program
|
|
109
|
+
.command("inject")
|
|
110
|
+
.description("Inject saved cross-seeds into your client (without filtering, see docs)")
|
|
111
|
+
.option("--inject-dir <dir>", "Directory of torrent files to try to inject")
|
|
112
|
+
.option("--ignore-titles", "Searchee and candidate titles do not need to pass the fuzzy matching check (useful if `cross-seed inject` erroneously rejects by title)")
|
|
190
113
|
.option("--no-ignore-titles", "Searchee and candidate titles need to pass the fuzzy matching check (default)")
|
|
114
|
+
.addOption(verboseOption)
|
|
191
115
|
.action(withFullRuntime(injectSavedTorrents));
|
|
192
|
-
|
|
193
|
-
|
|
116
|
+
program
|
|
117
|
+
.command("restore")
|
|
118
|
+
.description("Use snatched torrents from torrent_cache to attempt to restore cross seeds. Will need to run `cross-seed inject` afterwards with dataDirs configured.")
|
|
119
|
+
.addOption(verboseOption)
|
|
120
|
+
.action(withFullRuntime(restoreFromTorrentCache));
|
|
121
|
+
program
|
|
122
|
+
.command("test-notification")
|
|
123
|
+
.description("Send a test notification")
|
|
124
|
+
.addOption(verboseOption)
|
|
125
|
+
.action(withFullRuntime(sendTestNotification));
|
|
194
126
|
program.showHelpAfterError("(add --help for additional information)");
|
|
195
127
|
await program.parseAsync();
|
|
196
128
|
//# sourceMappingURL=cmd.js.map
|
package/dist/cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmd.js","sourceRoot":"","sources":["../src/cmd.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,
|
|
1
|
+
{"version":3,"file":"cmd.js","sourceRoot":"","sources":["../src/cmd.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,EAAE,Q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