* don't allow heavy abuse with simple commands

This commit is contained in:
Reinhard Pointner 2014-10-29 04:21:33 +00:00
parent 549e2e47a3
commit 9c1ada6a9a
2 changed files with 6 additions and 1 deletions

View File

@ -55,6 +55,11 @@ public class ArgumentProcessor {
// execute CLI operations // execute CLI operations
if (args.script == null) { 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 // file operations
Collection<File> files = new LinkedHashSet<File>(args.getFiles(true)); Collection<File> files = new LinkedHashSet<File>(args.getFiles(true));

View File

@ -771,7 +771,7 @@ public class CmdlineOperations implements CmdlineInterface {
if (service instanceof OpenSubtitlesClient) { if (service instanceof OpenSubtitlesClient) {
OpenSubtitlesClient osdb = (OpenSubtitlesClient) service; OpenSubtitlesClient osdb = (OpenSubtitlesClient) service;
if (osdb.isAnonymous()) { 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 return true; // no login => logged in by default