Directory paths not working correctly

All your suggestions, requests and ideas for future development
Post Reply
techitch
Posts: 12
Joined: 03 Oct 2016, 04:52

Directory paths not working correctly

Post by techitch »

Hi There
I'm issuing the following command:

Code: Select all

/usr/bin/filebot -script fn:amc --output "/home/user/incoming/output" --action test -non-strict "/home/user/incoming/downloads" --def @/home/user/.args
And get the following errors:

Code: Select all

....
Parameter: excludeList = /home/user/.exclude
Argument: /home/user/incoming/downloads
Argument: /home/user
Illegal usage: input folder must not contain output folder: /home/user/user/output
Failure (°_°)
It seems unable to differentiate the directory path especially when it is 4 directories deep, if i move the output dir to something like /home/media/output it works however it treats the input directory as /home/user/incoming rather than going to the downloads folder.

Running the latest version, sysinfo output below

Code: Select all

FileBot 4.7.2 (r4178)
JNA Native: 4.0.1
MediaInfo: MediaInfoLib - v0.7.69
7-Zip-JBinding: 9.20
Chromaprint: fpcalc version 1.1.0 (/usr/share/filebot/fpcalc)
Extended Attributes: OK
GVFS: OK
Groovy Engine: 2.4.7
JRE: Java(TM) SE Runtime Environment 1.8.0_101 (headless)
JVM: 64-bit Java HotSpot(TM) 64-Bit Server VM
CPU/MEM: 2 Core / 875 MB Max Memory / 21 MB Used Memory
OS: Linux (amd64)
Package: DEB
Data: /home/user/.filebot
uname: Linux hostname 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u1 (2016-09-03) x86_64 GNU/Linux
Done ヾ(@⌒ー⌒@)ノ
Cant seem to figure out the issue, using this syntax works fine on another pc where the dir structure is not a deep.
User avatar
rednoah
The Source
Posts: 23932
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Directory paths not working correctly

Post by rednoah »

1.
You're passing in your entire $HOME folder as input folder for processing, including your output folder, which is not allowed:

Code: Select all

Argument: /home/user
WHY???


2.
If you use @files then you probably wanna post the contents of those as well. filebot @/my/magic/args.txt does not exactly give us a lot of information you see. ;)
:idea: Please read the FAQ and How to Request Help.
techitch
Posts: 12
Joined: 03 Oct 2016, 04:52

Re: Directory paths not working correctly

Post by techitch »

Hi Rednoah, thanks for your quick response, love your app!

If you look at my command syntax you'll see I am passing the full dir path however it seems that the script is truncating it hence the issue!

here is my magic args (they are not that magic, if you have ideas it would be great) :D

Code: Select all

movieFormat=/home/media/movies/{n.space('.')}.{y}.{vf}.{source}/{n.space('.')}.{y}.{vf}.{source}
seriesFormat=/home/media/tv/{n}/{n.space('.')}.{s00e00.lower()}
artwork=n
ignore=seeding
clean=y
excludeList=/home/user/.exclude
User avatar
rednoah
The Source
Posts: 23932
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Directory paths not working correctly

Post by rednoah »

The command you posted looks good. But it's not exactly the same command you're running. All I know is that you're not passing arguments correctly:
viewtopic.php?f=4&t=1899


e.g. use the sysenv script if you're not sure what arguments you're passing:

Code: Select all

filebot -script fn:sysenv "/home/user/incoming/downloads" | grep args

Code: Select all

args[0] = -script
args[1] = fn:sysenv
args[2] = /home/user/incoming/downloads
:idea: Please read the FAQ and How to Request Help.
techitch
Posts: 12
Joined: 03 Oct 2016, 04:52

Re: Directory paths not working correctly

Post by techitch »

Ok, i've run this - the args look OK to me? am i missing anything?

command:

Code: Select all

filebot -script fn:sysenv --output "/home/user/incoming/output" --action test -non-strict "/home/user/incoming/downloads" --def @/home/user/.args | grep args
output:

Code: Select all

args[0] = -script
args[1] = fn:sysenv
args[2] = --output
args[3] = /home/user/incoming/output
args[4] = --action
args[5] = test
args[6] = -non-strict
args[7] = /home/user/incoming/downloads
args[8] = --def
args[9] = @/home/user/.args
I'll add that there are no characters that need to be escaped or spaces in the path
User avatar
rednoah
The Source
Posts: 23932
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Directory paths not working correctly

Post by rednoah »

That narrows it down to an issue in the @file but I don't see any obvious issues neither.

Remove the @file and see what happens. Then remove line after line and see what happens.
:idea: Please read the FAQ and How to Request Help.
techitch
Posts: 12
Joined: 03 Oct 2016, 04:52

Re: Directory paths not working correctly

Post by techitch »

got it, was a bunch of whitespace at the end of the @file that was causing the problem, my bad!
thanks man
User avatar
rednoah
The Source
Posts: 23932
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Directory paths not working correctly

Post by rednoah »

So the white space had the same effect as passing . ??? In @files every line is an argument, so I'm not sure what happens if you have extra empty lines.

EDIT:

Ah! Nevermind. If you have empty lines and spaces it'll actually allow you to pass in empty string and spaces, as if doing this:

Code: Select all

filebot -script fn:sysenv ""
:idea: Please read the FAQ and How to Request Help.
vstancea
Posts: 15
Joined: 26 Oct 2016, 21:38

Re: Directory paths not working correctly

Post by vstancea »

Hi, I have a similar issue. Before i start, I have to mention that i'm using FileBot on a QNAP TS-212P.

Code: Select all

[~] # filebot
FileBot 4.7.2 (r4178) / Java(TM) SE Embedded Runtime Environment 1.8.0_65 (headless)
After inputting the following command

Code: Select all

filebot -script fn:amc --output "/share/HDA_DATA/Multimedia" --action move --conflict auto -non-strict "/share/HDA_DATA/Download/transmission/completed/" --log-file amc.log --def subtitles=en,ro extras=y kodi=192.168.0.103:8080 clean=y unsorted=y music=y artwork=y excludeList=".excludes" ut_dir="$ARG_PATH" ut_kind="multi" ut_title="$ARG_NAME" ut_label="$ARG_LABEL"
I get the following output

Code: Select all

Locking /share/HDA_DATA/.qpkg/Entware-ng/share/filebot/data/admin/logs/amc.log
Run script [fn:amc] at [Wed Oct 26 21:34:34 GMT 2016]
Parameter: subtitles = en,ro
Parameter: extras = y
Parameter: kodi = *****
Parameter: clean = y
Parameter: unsorted = y
Parameter: music = y
Parameter: artwork = y
Parameter: excludeList = .excludes
Parameter: ut_dir =
Parameter: ut_kind = multi
Parameter: ut_title =
Parameter: ut_label =
Argument: /share/HDA_DATA/Download/transmission/completed
Illegal usage: input folder must not contain output folder: /share/HDA_DATA/Multimedia
Failure (°_°)
What I don't understand is that it worked just fine for a couple of hours and that all of the sudden it just stopped working. As you can see, the input and output folders are totally different.
User avatar
rednoah
The Source
Posts: 23932
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Directory paths not working correctly

Post by rednoah »

1.
rednoah wrote:Include the output of filebot -script fn:sysinfo
@see http://www.filebot.net/forums/viewtopic.php?f=3&t=1868


2.
Please update to the latest beta release and try again: viewtopic.php?f=7&t=1609


3.
What does ut_dir="$ARG_PATH" do? You can't pass in input via file arguments and ut_dir/ut_file options at the same time.
:idea: Please read the FAQ and How to Request Help.
vstancea
Posts: 15
Joined: 26 Oct 2016, 21:38

Re: Directory paths not working correctly

Post by vstancea »

Thanks for the fast reply :D

1. The output of -script fn:sysinfo

Code: Select all

[~] # filebot -script fn:sysinfo
FileBot 4.7.2 (r4178)
JNA Native: java.lang.UnsatisfiedLinkError: /share/HDA_DATA/.qpkg/Entware-ng/share/filebot/data/admin/temp/jna-92668751/jna8517237565057985544.tmp: /lib/libc.so.6: version `GLIBC_2.7' not found (required by /share/HDA_DATA/.qpkg/Entware-ng/share/filebot/data/admin/temp/jna-92668751/jna8517237565057985544.tmp)
MediaInfo: net.filebot.mediainfo.MediaInfoException: Unable to load arm (32-bit) native library libmediainfo.so: Could not initialize class com.sun.jna.Native
Apache Commons VFS: [zip, rar]
Chromaprint: java.io.IOException: Cannot run program "fpcalc": error=2, No such file or directory
Extended Attributes: OK
Script Bundle: 2016-10-15 (r411)
Groovy: 2.4.7
JRE: Java(TM) SE Embedded Runtime Environment 1.8.0_65 (headless)
JVM: 32-bit Java HotSpot(TM) Embedded Client VM
CPU/MEM: 1 Core / 121 MB Max Memory / 10 MB Used Memory
OS: Linux (arm)
Package: IPKG
Data: /share/HDA_DATA/.qpkg/Entware-ng/share/filebot/data/admin
uname: Linux vstancea 3.4.6 #1 Fri Oct 21 10:46:40 CST 2016 armv5tel unknown
Done ã¾(ï¼ âã¼âï¼ )ã
2. I haven't tried the beta version yet, i would like to see if i can make this version work, with your help of course :P

3. I haven't mentioned in my previous post that I use FileBot on my QNAP NAS together with Transmission, as a script (taken from your website) upon torrent completion, with a few of my own modifications. The scrip is

Code: Select all

#!/bin/sh
# Input Parameters

ARG_PATH="$TR_TORRENT_DIR/$TR_TORRENT_NAME"
ARG_NAME="$TR_TORRENT_NAME"
ARG_LABEL="N/A"

# Configuration
CONFIG_OUTPUT="/share/HDA_DATA/Multimedia"
CONFIG_INPUT="/share/HDA_DATA/Download/transmission/completed/"

filebot -script fn:amc --output "$CONFIG_OUTPUT" --action move --conflict auto -non-strict "$CONFIG_INPUT" --log-file amc.log --def movieFormat="M:/Movies/{n} ({y})/{fn}" subtitles=en,ro extras=y kodi=192.168.0.103:8080 clean=y unsorted=y music=y artwork=y excludeList=".excludes" ut_dir="$ARG_PATH" ut_kind="multi" ut_title="$ARG_NAME" ut_label="$ARG_LABEL"
When I first run this script, it worked perfect, but after a few runs when some some torrents completed to download, it just stopped working, so i took the line itself and run it in Putty, but changing the Input and Output. To be honest, i have no idea what ut_dir="$ARG_PATH" do, it was in the script that i downloaded from viewtopic.php?f=4&t=215 and as I said earlier, i made a few modifications of my own.

After I saw your reply about ut_dir="$ARG_PATH" and ut_dir/ut_file, I deleted those parameters and run the filebot line again in Putty and now it worked like a charm, except the movieFormat param which it still didn't kept the file format the same and kodi param
User avatar
rednoah
The Source
Posts: 23932
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Directory paths not working correctly

Post by rednoah »

1.
$ARG_PATH is being passed in by Transmission and then used as --def ut_dir parameter:

Code: Select all

ARG_PATH="$TR_TORRENT_DIR/$TR_TORRENT_NAME"
If you're using Transmission, then you won't need to set your own input path, unless you're testing outside of Transmission in which case you'll need to set the same environment variables that Transmission would be setting.


2.
There rest looks good. If you have any issues, check the logs and point out where the logs show different behaviour from what you expect. If you don't know what {fn} means, play with the Format Editor first before passing in your own custom formats.
:idea: Please read the FAQ and How to Request Help.
vstancea
Posts: 15
Joined: 26 Oct 2016, 21:38

Re: Directory paths not working correctly

Post by vstancea »

For a couple of days everything worked out flawlessly until today when i had the same issue as last time. I had some TV Shows in Transmission overnight and in the morning when i checked my NAS to see if they were sorted by FileBot i've seen that they were still in Transmission folder and not in the Multimedia folder. Then I tried to ran the script in Putty to see what's wrong and i get the same error as last time

Code: Select all

[~] # sh /share/HDA_DATA/.qpkg/transmission-postprocess.sh
Locking /share/HDA_DATA/.qpkg/Entware-ng/share/filebot/data/admin/logs/amc.log
Run script [fn:amc] at [Sun Oct 30 07:37:00 GMT 2016]
Illegal usage: bad file arguments or ut_dir/ut_file parameters
Failure (°_°)
Even though i deleted the ur_dir paramenter I still get this error. This is the contend of my transmission-postprocess.sh

Code: Select all

#!/bin/sh
# Input Parameters

# ARG_PATH="$TR_TORRENT_DIR/$TR_TORRENT_NAME"
# ARG_NAME="$TR_TORRENT_NAME"
# ARG_LABEL="N/A"

# Configuration
CONFIG_OUTPUT="/share/HDA_DATA/Multimedia"
CONFIG_INPUT="/share/HDA_DATA/Download/transmission/completed/"

filebot -script fn:amc --output "$CONFIG_OUTPUT" --action move --conflict auto -non-strict --log-file amc.log --def movieFormat="/share/HDA_DATA/Multimedia/Movies/{n} ({y})/{fn}" subtitles=en,ro kodi=192.168.0.103:8080 clean=y unsorted=y music=y
Am I doing something wrong?
Post Reply