From 9c1ada6a9a957f860265808ea0d10d781efe7a13 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Wed, 29 Oct 2014 04:21:33 +0000 Subject: [PATCH] * don't allow heavy abuse with simple commands --- source/net/filebot/cli/ArgumentProcessor.java | 5 +++++ source/net/filebot/cli/CmdlineOperations.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/source/net/filebot/cli/ArgumentProcessor.java b/source/net/filebot/cli/ArgumentProcessor.java index 40ef0ca2..a3210e04 100644 --- a/source/net/filebot/cli/ArgumentProcessor.java +++ b/source/net/filebot/cli/ArgumentProcessor.java @@ -55,6 +55,11 @@ public class ArgumentProcessor { // execute CLI operations if (args.script == null) { + // sanity checks + if (args.recursive && (args.getSubtitles || args.getMissingSubtitles)) { + throw new CmdlineException("-get-subtitles -r has been disabled due to abuse"); + } + // file operations Collection files = new LinkedHashSet(args.getFiles(true)); diff --git a/source/net/filebot/cli/CmdlineOperations.java b/source/net/filebot/cli/CmdlineOperations.java index 23540744..595aa3ab 100644 --- a/source/net/filebot/cli/CmdlineOperations.java +++ b/source/net/filebot/cli/CmdlineOperations.java @@ -771,7 +771,7 @@ public class CmdlineOperations implements CmdlineInterface { if (service instanceof OpenSubtitlesClient) { OpenSubtitlesClient osdb = (OpenSubtitlesClient) service; if (osdb.isAnonymous()) { - throw new CmdlineException(String.format("%s: Please enter your login details by calling `filebot -script fn:osdb.login`", osdb.getName())); + throw new CmdlineException(String.format("%s: Please enter your login details by calling `filebot -script fn:configure`", osdb.getName())); } } return true; // no login => logged in by default