Page 15 of 28

Re: Pre-10.8?

Posted: 24 Mar 2015, 06:06
by rednoah
Java 8 only works on 10.8+ so new versions just can't work on older OSX versions.

Depending how old your system is (you didn't say) you might be able to install Java 7 and run FileBot 4.2 which is no longer supported but should still work quite well.

Re: [GUIDE] How to install FileBot on Debian Linux

Posted: 24 May 2015, 14:21
by cteahan
Hi,

Have installed the package but can't get filebot to run... Using Debian Jessie and OpenJDK 7, do I need to use a different JRE? Any pointers would be greatly appreciated...
[email protected]:~/Downloads$ filebot
Exception in thread "main" java.lang.UnsupportedClassVersionError: net/filebot/Main : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
[email protected]:~/Downloads$

Re: [GUIDE] How to install FileBot on Debian Linux

Posted: 24 May 2015, 15:19
by rednoah
FAQ says you need Java 8.

Re: [MANUAL] Set OpenSubtitles Account

Posted: 02 Dec 2015, 10:44
by Ravager
When i run filebot -script fn:osdb.login i get this error

Code: Select all

InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
        at net.filebot.web.WebRequest.fetch(WebRequest.java:123)
        at net.filebot.web.WebRequest.fetchIfModified(WebRequest.java:101)
        at net.filebot.web.CachedResource.fetchData(CachedResource.java:28)
        at net.filebot.web.CachedResource.fetchData(CachedResource.java:11)
        at net.filebot.web.AbstractCachedResource.fetch(AbstractCachedResource.java:137)
        at net.filebot.web.AbstractCachedResource.get(AbstractCachedResource.java:82)
        at net.filebot.cli.ArgumentProcessor$DefaultScriptProvider.fetchScript(ArgumentProcessor.java:210)
        at net.filebot.cli.ScriptShell.runScript(ScriptShell.java:82)
        at net.filebot.cli.ArgumentProcessor.process(ArgumentProcessor.java:116)
        at net.filebot.Main.main(Main.java:169)
Failure (°_°)
In Ubuntu 15.10

Re: [MANUAL] Set OpenSubtitles Account

Posted: 02 Dec 2015, 13:55
by rednoah
That's a generic Java issue. Try Google: http://stackoverflow.com/questions/4764 ... ameter-mus

Re: [GUIDE] How to install FileBot on Debian Linux

Posted: 04 Dec 2015, 13:14
by aztazt
I might be wrong, but I think neither Debian Wheezy nor Debian Jessie are offering OpenJDK 8 in their repositories.

I personnaly use Debian 7.9 and I was unable to install openjdk-8-jre on my server (dependancies are not met).

Any advice would be greatly appreciated, thank you

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Posted: 22 Apr 2016, 18:33
by zocidj
Hy, any chance to explain step by step how to make to work this script on windows. Thanks

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Posted: 25 Apr 2016, 18:46
by zocidj
Helo, anybody here ??? :)

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Posted: 26 Apr 2016, 06:20
by rednoah
What have you tried? What's not working? What do the logs say? Have you managed to call any external program with JDownloader?

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Posted: 26 Apr 2016, 15:32
by zocidj
I didn`t try anything. Can you explain me step by step how to enable jdownloader to rename downloaded movies or tv shows with filebot, automaticly. Please. Regard

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Posted: 26 Apr 2016, 15:38
by rednoah
I don't use Windows and everything I know is in the original post at the top of the page. I'd try that first, and if it's not working right away you'll have to figure how to fix it yourself. Feel free to share your solution if you do. ;)

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Posted: 26 Apr 2016, 21:29
by manbearpig2012
I can't for the life of me get this to work w/ jdownloader....

copied/pasted the PackageFinished script into the event viewer

Code: Select all

var script = JD_HOME + '/jdownloader-postprocess.sh'

var path = package.getDownloadFolder()
var name = package.getName()
var label = package.getComment() ? package.getComment() : 'N/A'
var links = package.getDownloadLinks() ? package.getDownloadLinks() : []

function isReallyFinished() {
    for (var i = 0; i < links.length; i++) {
        if (links[i].getArchive() != null && links[i].getExtractionStatus() != "SUCCESSFUL" || !package.isFinished()) {
            return false
        }
    }
    return true
}

if (isReallyFinished()) {
    var command = [script, path, name, label, 'PACKAGE_FINISHED']
    log(command)
    log(callSync(command))
}


made the jdownloader-postprocess.sh

Code: Select all

#!/bin/sh

# org.jdownloader.extensions.eventscripter.EventScripterExtension.scripts.json
# [{"eventTrigger":"ON_PACKAGE_FINISHED","enabled":true,"name":"Execute FileBot (PackageFinished)","script":"var script = JD_HOME + '/jdownloader-postprocess.sh'\n\nvar path = package.getDownloadFolder()\nvar name = package.getName()\nvar label = package.getComment() ? package.getComment() : 'N/A'\n\nvar command = [script, path, name, label, 'PACKAGE_FINISHED']\n\nlog(command)\nlog(callSync(command))\n","eventTriggerSettings":{}} ]

# Input Parameters
ARG_PATH="$1"
ARG_NAME="$2"
ARG_LABEL="$3"

# Configuration
CONFIG_OUTPUT="T:/_TV Shows"

filebot -script fn:amc "D:/_JDownloader Downloads" --output "T:/_TV Shows" --log-file amc.log --action copy --conflict skip -non-strict --def clean=y --def excludeList=amc.txt --def "seriesFormat=t:/_TV Shows/{n.replaceAll(/\.:/,'-').replacePart('')}/{'Season '+s}/{n.replaceAll(/\./,'-').replacePart('')} - {s00e00} - {t.replace('?', '').replaceAll(/\.:/,'-').replacePart(', Part $1')}{' ('+fn.match(/Uncensored/)+')'} [{airdate.format('MM-dd-yyy')}]({VF}{'.'+SOURCE}{'.'+VC}{'.'+AC}{'.'+AF}{'.'+fn.match(/DD5.1/)})" --def skipExtract=n --def deleteAfterExtract=y
yet still get this when I do a test run of the EventScripter.... help??? Don't need the archive one because i'm having filebot handle the extracting.

Cheers

Image

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Posted: 27 Apr 2016, 05:35
by rednoah
1.
That error message doesn't mean anything to me. Ask the JDownloader folks

2.
Is your jdownloader-postprocess.sh called?
viewtopic.php?f=4&t=3067

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Posted: 08 May 2016, 05:04
by Crack00r
This Script is for Windows, just add a Trigger after extract is finished

Code: Select all

var command = "filebot.exe"; // Change this if filebot isn't on your path
var logfile = "D:/jdownloader-eventscripter.log"; // File this script logs to. Use forward slashes as path separators!
var filebotLogfile = "D:/filebot.log"; // File that filebot will log to. Use forward slashes as path separators!
var downloadBase = "D:/\Downloads/\extracted"; // Base folder under which your download packages reside. Use escaped backslashes as path separators!
var archiveExtensions = /(\.(zip|rar|7z|par\d+|part\d+|r\d+|t\d+|\d{3}))$/; // Regex to test for nested archives in extracted files

// Parameters for the scripts to run
var params = {
    "rename": {
        "options": {
            "-script": "fn:amc",
            "--log-file": filebotLogfile,
            "--action": "move",
            "--conflict": "override",
            "--lang": "de"
        },
        "defs": {
            "plex": "crack00r",
            "unsorted": "y",
            "skipExtract": "y",
            "clean": "y",
            "minFileSize": "104857600",
            "excludeList": "D:/amc-input.txt",
            "seriesFormat": "D:/Filme/Filme/Serien/{n}/{'Staffel '+s}/{n} - {s00e00} - {t}",
            "movieFormat": "D:/Filme/Filme/Filme/{n} ({y})"
        },
        "switches": [
            "-non-strict"
        ]
    },
    "cleaner": {
        "options": {
            "-script": "fn:cleaner",
            "--log-file": filebotLogfile
        },
        "defs": {
            "root": "y"
        },
        "switches": []
    }
}

var logBuf = "";

function log(message) {
    logBuf += new Date().toISOString().slice(0, 19) + " - " + message + "\r\n";
}

function logArray(message, arr) {
    log("\t" + message);

    if (arr == null) {
        log("\t\tnone");
        return;
    }

    for (var i = 0; i < arr.length; i++) {
        log("\t\t" + arr[i]);
    }
}

function logSpacer() {
    log("++++++++++++++++++++++++++++++");
}

function flushLog() {
    // Comment out the next two lines to prevent log from being written to file
    writeFile(logfile, logBuf, true);
    logBuf = "";
}

function quoteIfNecessary(value) {
    return (value != null && value.indexOf("\"") < 0) ? '"' + value + '"' : value;
}

function quoteArrayElements(input) {
    var result = [];

    for (var i = 0; i < input.length; i++) {
        result[result.length] = quoteIfNecessary(input[i]);
    }

    return result;
}

function reduce(map, joinChar) {
    var keyValuePairs = [];

    for (var key in map) {
        keyValuePairs[keyValuePairs.length] = key + joinChar + map[key];
    }

    return keyValuePairs;
}

function mapToArray(map) {
    var array = [];

    for (var key in map) {
        array[array.length] = key;
        array[array.length] = map[key];
    }

    return array;
}

function createArgumentArray(parameters, inputs) {
    var options = mapToArray(parameters["options"]);
    var switches = parameters["switches"];
    var defs = reduce(parameters["defs"], "=");

    return [command].concat(options).concat(switches).concat(inputs).concat(["--def"]).concat(defs);
}

function isArchiveFile(filename) {
    return archiveExtensions.test(filename);
}

function containsNestedArchive(extractedFiles) {
    for (var i = 0; i < extractedFiles.length; i++) {
        if (isArchiveFile(extractedFiles[i])) {
            return true;
        }
    }

    return false;
}

function getPackageRoot(folder) {
    return folder.substring(0, folder.indexOf("\\", downloadBase.length + 1));
}

var archiveFolder = archive.getFolder();
var archiveName = archive.getName();
var archiveType = archive.getArchiveType();
var extractedFiles = archive.getExtractedFiles();
var archiveUID = archiveFolder + "\\" + archiveName;
var packageRoot = getPackageRoot(archiveFolder);

logSpacer();
log("FINISHED EXTRACTION - " + archiveUID);
log("\tType: " + archiveType);
log("\tPackage root: " + packageRoot);
logArray("Extracted files:", extractedFiles);

if (extractedFiles == null || extractedFiles.length == 0) {
    log("SKIPPING - No files extracted.");
} else if (containsNestedArchive(extractedFiles)) {
    log("SKIPPING - Nested archive detected.");
} else {
    var renameInputs = quoteArrayElements(extractedFiles);
    var renameArgs = createArgumentArray(params["rename"], renameInputs);
    log("RUNNING SCRIPT - " + archiveUID);

    callAsync(
        function(exitCode, stdOut, errOut) {
            if (exitCode == 0) {
                log("SUCCESS - " + archiveUID);

                var cleanerArgs = createArgumentArray(params["cleaner"], packageRoot);

                log("CLEANING - " + packageRoot);

                callAsync(
                    function(exitCode, stdOut, errOut) {
                        if (exitCode == 0) {
                            log("ALL CLEAN - " + packageRoot);
                        } else {
                            log("STILL DIRTY - " + packageRoot);
                        }

                        flushLog();
                    },
                    cleanerArgs
                );
            } else {
                log("ERROR - " + archiveUID + " - Code " + exitCode);
            }

            flushLog();
        },
        renameArgs
    );
}

logSpacer();
flushLog();

Re: Conditional Structures (if-then-else)

Posted: 04 Oct 2016, 00:39
by cyberdoggy
Thanks rednoah very useful stuff there ;)

Re: [OSX] Folder Action with Automator

Posted: 12 Oct 2016, 04:27
by Maxxodd
I get this error when I run the command in terminal:
Illegal usage: bad file arguments or ut_dir/ut_file parameters
Failure (°_°)

Re: [OSX] Folder Action with Automator

Posted: 12 Oct 2016, 05:42
by rednoah
Thanks for the post! Before a real human comes by, please make sure your report has all the following points checked:
  • Include screenshots, logs or filenames (i.e. demonstrate the issue)
  • Include basic information (i.e. sysinfo output)
:idea: Please read How to Request Help and Fix Problems, Report Bugs, Get Features

Usage Examples

Posted: 05 Apr 2017, 09:27
by rednoah
1. Rename files with FileBot:

Code: Select all

$ filebot -rename *.mp4 --db TheMovieDB -non-strict
Rename movies using [TheMovieDB]
Auto-detect movie from context: [avatar.mp4]
[MOVE] From [avatar.mp4] to [Avatar (2009).mp4]
Processed 1 files
2. Confirm that FileBot metadata has been stored as xattr in the filesystem:

Code: Select all

$ filebot -script fn:xattr *.mp4
/path/to/Avatar (2009).mp4
	net.filebot.filename: avatar.mp4
	net.filebot.metadata: {"@type":"Movie","year":2009,"imdbId":499549,"tmdbId":19995,"language":"en","id":19995,"name":"Avatar","aliasNames":[]}
3. Use xattr metadata in filter and format expressions:

Code: Select all

$ filebot -mediainfo -r . --filter "y >= 2000" --format "{n} by {director}"
Avatar by James Cameron
4. Process xattr tagged files based on existing xattr metadata:

Code: Select all

filebot -rename -r . --db xattr --action copy --output /Volumes/USB --filter "episode && age < 30" --format "{n} - {sxe} - {t}"

Re: Presets

Posted: 11 Apr 2017, 18:57
by stephen147
Could you add the ability to overwrite or keep file extension in the presets.

I overwrite my movies while keep extensions on TV programs.

Re: Presets

Posted: 12 Apr 2017, 00:24
by rony123
I think it is already included? is not it?
HemorrhageTreatment

Re: Presets

Posted: 12 Apr 2017, 02:20
by rednoah
Extension: Preserve / Override works independently of Presets and cannot be enabled/disabled via clicking a Preset.
stephen147 wrote:Could you add the ability to overwrite or keep file extension in the presets.
If I make it too easy, then the novice folks will accidentally delete all their extensions and then blame FileBot.
stephen147 wrote:I overwrite my movies while keep extensions on TV programs.
Why do your movie files have the wrong extension? I've never once come across a movie file with the wrong extension.

Re: Presets

Posted: 12 Apr 2017, 23:36
by stephen147
Could that option not be enabled by default so the user can't tamper with it or warning if checkbox is ticked?

It's the only way to rename subtitles and movies together in same rename by using this:

Code: Select all

{n.replace(':','-').replaceAll(/[\/:*?"<>|]/,' - ')}    ({y})                   {any{fn.match(/(?i)25th.+?anniv/)}{''}.replaceAll(/(?i).*25th.+?anniv.*/, "(25th Anniv. Edition)")}          {any{fn.match(/(?i)remastered/)}{''}.replaceAll(/(?i).*Remastered.*/, "(Remastered)")}           {any{fn.match(/(?i)extended.+?edit/)}{''}.replaceAll(/(?i).*Extended.+?Edit.*/, "(Extended Edition)")}     {any{fn.match(/IMAX.+?Edition/)}{''}.replaceAll(/(?i).*imax.+?edition.*/, "(IMAX Edition)")}             {any{fn.match(/(?i)direct.+?cut/)}{''}.replaceAll(/(?i).*direct.+?cut.*/, "(Director's Cut)")}     {any{fn.match(/(?i)unrated/)}{''}.replaceAll(/(?i).*unrated.*/, "(Unrated)")}     {any{fn.match(/(?i)\(limited.*?\)/)}{''}.replaceAll(/(?i).*limited.*/, "(Limited Edition)")}    {any{fn.match(/(?i)\(uncut.*?\)/)}{''}.replaceAll(/(?i).*uncut.*/, "(Uncut)")}    {any{fn.match(/(?i)collector.+?s.+?edition/)}{''}.replaceAll(/(?i).*collector.+?s.+?edition.*/, "(Collector's Edition)")}                  {any{fn.match(/\([^\()+?[^\d]+?\)\s*/)} {""}{''}}   {self.vf ? self.vf + "" : self.hpi}    {"${self.source ?: 'WEB-DL'}"}    {ac}    {audio[0].channels.replaceAll(/^(\d{1}).*/,'$1')replaceAll(/2/, "2ch").replaceAll(/6/, "5.1ch").replaceAll(/8/, "7.1ch")}    {vc}_{any{"$group"}{fn.match(/(?<=[_-])[^\s_-]+?$/)}{'NA'}.replaceAll(/[-_\[\]]\s*|\.\w{3}$/, "")}/{n.replace(':','-').replaceAll(/[\/:*?"<>|]/,' - ')}    ({y})                   {any{fn.match(/(?i)25th.+?anniv/)}{''}.replaceAll(/(?i).*25th.+?anniv.*/, "(25th Anniv. Edition)")}          {any{fn.match(/(?i)remastered/)}{''}.replaceAll(/(?i).*Remastered.*/, "(Remastered)")}           {any{fn.match(/(?i)extended.+?edit/)}{''}.replaceAll(/(?i).*Extended.+?Edit.*/, "(Extended Edition)")}     {any{fn.match(/IMAX.+?Edition/)}{''}.replaceAll(/(?i).*imax.+?edition.*/, "(IMAX Edition)")}             {any{fn.match(/(?i)direct.+?cut/)}{''}.replaceAll(/(?i).*direct.+?cut.*/, "(Director's Cut)")}     {any{fn.match(/(?i)unrated/)}{''}.replaceAll(/(?i).*unrated.*/, "(Unrated)")}     {any{fn.match(/(?i)\(limited.*?\)/)}{''}.replaceAll(/(?i).*limited.*/, "(Limited Edition)")}    {any{fn.match(/(?i)\(uncut.*?\)/)}{''}.replaceAll(/(?i).*uncut.*/, "(Uncut)")}    {any{fn.match(/(?i)collector.+?s.+?edition/)}{''}.replaceAll(/(?i).*collector.+?s.+?edition.*/, "(Collector's Edition)")}                  {any{fn.match(/\([^\()+?[^\d]+?\)\s*/)} {""}{''}}   {self.vf ? self.vf + "" : self.hpi}    {"${self.source ?: 'WEB-DL'}"}    {ac}    {audio[0].channels.replaceAll(/^(\d{1}).*/,'$1')replaceAll(/2/, "2ch").replaceAll(/6/, "5.1ch").replaceAll(/8/, "7.1ch")}    {vc}_{any{"$group"}{fn.match(/(?<=[_-])[^\s_-]+?$/)}{'NA'}.replaceAll(/[-_\[\]]\s*|\.\w{3}$/, "")}{any{'.'+lang}{lang}}{any{fn.match(/(?i)sdh.+?/)}{''}.replaceAll(/(?i).*sdh.*/, "_SDH")}{any{fn.match(/(?i)\(foreignpartsonly\)/)}{''}}{"."+ext}

Re: Presets

Posted: 13 Apr 2017, 00:40
by rednoah
stephen147 wrote:It's the only way to rename subtitles and movies together
How so? What's the problem?

Extension: Override only allows you to change ".sub" to ".srt". Why would you do that? In fact, you're not even trying to do that. Your format ends with {"."+ext} so you apparently want to keep the extension.

Re: Presets

Posted: 13 Apr 2017, 00:47
by stephen147
I'll need to revisit this again when I've time.

It was the only way for me to use them bindings successfully to rename movie and sub files was to have the override extension enabled and then rewrite it back again using {"."+ext}.

Re: --filter and fine-tuning

Posted: 25 Apr 2017, 04:29
by Laynezilla
Is there a complete list of filters anywhere?