POSTBUCKET - where random posts in unrelated topics go

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

Re: Exclude Blacklist & Series-Mappings

Post by rednoah »

11/22/63 will only work with r3550 or higher.
:idea: Please read the FAQ and How to Request Help.
maverickmu
Posts: 1
Joined: 20 Apr 2016, 14:44

Re: Exclude Blacklist & Series-Mappings

Post by maverickmu »

please add the following:
aced
awa
itg
mp
sof
tvp
tvs

Thanks a lot!
regards
zocidj
Posts: 9
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: 9
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: 19900
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: 9
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: 19900
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: 19900
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();
markmarz
Posts: 15
Joined: 31 May 2016, 14:08

Re: Exclude Blacklist & Series-Mappings

Post by markmarz »

Hi,

Plex supports a fixed set of subdirectory names for various kinds of supplemental material:
  • Behind The Scenes
    Deleted Scenes
    Featurettes
    Interviews
    Scenes
    Shorts
    Trailers
('Organized in Subdirectories' section of https://support.plex.tv/hc/en-us/articl ... ets-Movies)

Would it be possible to add these names to your blacklist?

I've found by experimentation (newbie here) that if I rename (say) a Featurettes directory to Extras (already on your blacklist), then the Filebot GUI excludes files in that directory, which is exactly what I need. So I think I'm on the right track asking for this. Alternatively, is there a way to build my own local blacklist the GUI will honor?

Thanks!
Mark M
User avatar
rednoah
The Source
Posts: 19900
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Exclude Blacklist & Series-Mappings

Post by rednoah »

Added.
:idea: Please read the FAQ and How to Request Help.
markmarz
Posts: 15
Joined: 31 May 2016, 14:08

Re: Exclude Blacklist & Series-Mappings

Post by markmarz »

Thanks! What do I need to do to see this reflected in the GUI? I'm guessing FileBot pulls the blacklist dynamically, but I'm not seeing any change in how it's handling Featurettes.
User avatar
rednoah
The Source
Posts: 19900
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Exclude Blacklist & Series-Mappings

Post by rednoah »

You need to wait 1-2 weeks.

In the meanwhile, posting examples for file paths that need special handling would be helpful.
:idea: Please read the FAQ and How to Request Help.
markmarz
Posts: 15
Joined: 31 May 2016, 14:08

Re: Exclude Blacklist & Series-Mappings

Post by markmarz »

Thanks! Here's some examples. Note that Windows 7 automatically replaced the network uri \\OMV\Movies\ with a drive letter when a command box was opened, in case that matters to you.

Code: Select all

Z:.
│   Brute Force (1947).mp4
│
├───Trailers
│       trailer.mp4
│       
└───Featurettes
         Paul Mason President Trump Love Letter.mp4

Z:\Brute Force (1947)>

Z:.
│   The 3 Penny Opera (1931).mp4
│
├───Scenes
│       Mack The Knife.mp4
│
├───Shorts
│       Jerry Orbach - Mack the Knife.mp4
│
└───Trailers
         trailer.mp4


Z:\The 3 Penny Opera (1931)>
markmarz
Posts: 15
Joined: 31 May 2016, 14:08

Re: Exclude Blacklist & Series-Mappings

Post by markmarz »

Maybe this from Debian, where the Plex server and data resides, is more clear:

https://onedrive.live.com/redir?resid=3 ... hoto%2cJPG
urukai
Posts: 1
Joined: 14 Jun 2016, 23:19

Re: Exclude Blacklist & Series-Mappings

Post by urukai »

is there a way to deal with the show extras? http://thetvdb.com/?tab=series&id=75660

ex: Extras - Series 1 (2005) [DVDRip (x264)] - BTN/Extras 1x05 - Samuel L Jackson.mkv

or is that a manual job?
User avatar
rednoah
The Source
Posts: 19900
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Exclude Blacklist & Series-Mappings

Post by rednoah »

Shows/Movies called Extras, Episodes, Movie, ... will and should be ignored by default.

You don't need to manually edit the filenames though, you just need to match the file with the episode/movie yourself:
https://www.youtube.com/watch?v=btNSv7AnMMw

Image
:idea: Please read the FAQ and How to Request Help.
svaraej
Posts: 27
Joined: 05 Apr 2016, 13:37

Re: Exclude Blacklist & Series-Mappings

Post by svaraej »

Hi,

Would be wonderful if "Sport" can be excluded/blacklisted.

I was wondering why all my sport videos suddenly begun being misidentified. Then I found that an obscure hebrew documentary, "Sport (2015), had been added to themoviedb :P
User avatar
rednoah
The Source
Posts: 19900
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Exclude Blacklist & Series-Mappings

Post by rednoah »

Added ^Sport$ to the query-blacklist so it'll recognize "Sport" folders as structure root folders.
:idea: Please read the FAQ and How to Request Help.
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: 19900
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.
marioporfirio
Posts: 2
Joined: 16 Oct 2016, 18:51

Re: Exclude Blacklist & Series-Mappings

Post by marioporfirio »

Please blacklist from search the word PUNCH in the start of filename.

Example: PUNCH_OcculticNine_-_02_FullHD
User avatar
rednoah
The Source
Posts: 19900
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Exclude Blacklist & Series-Mappings

Post by rednoah »

That would interfere with movies that start with "Punch" so I can't do that.

You'll have to pre-rename the files to remove the "Punch" part if that's an issue: viewtopic.php?f=3&t=2072
:idea: Please read the FAQ and How to Request Help.
Post Reply