POSTBUCKET - where random posts in unrelated topics go

Any questions? Need some help?
User avatar
rednoah
The Source
Posts: 19130
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Pre-10.8?

Post 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.
:idea: Please read the FAQ and How to Request Help.
cteahan
Posts: 1
Joined: 24 May 2015, 14:14

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

Post 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$
User avatar
rednoah
The Source
Posts: 19130
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post by rednoah »

FAQ says you need Java 8.
:idea: Please read the FAQ and How to Request Help.
Ravager
Posts: 6
Joined: 28 Aug 2014, 10:48

Re: [MANUAL] Set OpenSubtitles Account

Post 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
User avatar
rednoah
The Source
Posts: 19130
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [MANUAL] Set OpenSubtitles Account

Post by rednoah »

That's a generic Java issue. Try Google: http://stackoverflow.com/questions/4764 ... ameter-mus
:idea: Please read the FAQ and How to Request Help.
aztazt
Posts: 3
Joined: 24 Apr 2014, 21:28

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

Post 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
zocidj
Posts: 7
Joined: 08 Oct 2014, 13:00

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

Post by zocidj »

Hy, any chance to explain step by step how to make to work this script on windows. Thanks
zocidj
Posts: 7
Joined: 08 Oct 2014, 13:00

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

Post by zocidj »

Helo, anybody here ??? :)
User avatar
rednoah
The Source
Posts: 19130
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post 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?
:idea: Please read the FAQ and How to Request Help.
zocidj
Posts: 7
Joined: 08 Oct 2014, 13:00

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

Post 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
User avatar
rednoah
The Source
Posts: 19130
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post 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. ;)
:idea: Please read the FAQ and How to Request Help.
manbearpig2012
Posts: 10
Joined: 26 Apr 2016, 18:08

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

Post 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
User avatar
rednoah
The Source
Posts: 19130
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post 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
:idea: Please read the FAQ and How to Request Help.
Crack00r
Posts: 19
Joined: 26 Nov 2015, 11:00

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

Post 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();
cyberdoggy
Posts: 28
Joined: 03 Sep 2016, 21:27

Re: Conditional Structures (if-then-else)

Post by cyberdoggy »

Thanks rednoah very useful stuff there ;)
Maxxodd
Posts: 23
Joined: 27 May 2012, 21:01

Re: [OSX] Folder Action with Automator

Post 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 (°_°)
User avatar
rednoah
The Source
Posts: 19130
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [OSX] Folder Action with Automator

Post 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
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 19130
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Usage Examples

Post 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}"
:idea: Please read the FAQ and How to Request Help.
stephen147
Donor
Posts: 131
Joined: 01 Sep 2015, 22:40

Re: Presets

Post 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.
rony123
Posts: 1
Joined: 01 Apr 2017, 12:13

Re: Presets

Post by rony123 »

I think it is already included? is not it?
HemorrhageTreatment
Last edited by rony123 on 14 Apr 2017, 11:39, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 19130
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Presets

Post 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.
:idea: Please read the FAQ and How to Request Help.
stephen147
Donor
Posts: 131
Joined: 01 Sep 2015, 22:40

Re: Presets

Post 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}
User avatar
rednoah
The Source
Posts: 19130
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Presets

Post 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.
:idea: Please read the FAQ and How to Request Help.
stephen147
Donor
Posts: 131
Joined: 01 Sep 2015, 22:40

Re: Presets

Post 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}.
Laynezilla
Posts: 1
Joined: 25 Apr 2017, 04:27

Re: --filter and fine-tuning

Post by Laynezilla »

Is there a complete list of filters anywhere?
Post Reply