Filebot Automation help with extract / renaming

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
onyxius
Posts: 25
Joined: 26 Sep 2015, 07:09

Filebot Automation help with extract / renaming

Post by onyxius »

Hello,
So I have been using filebot for quite some time on my windows machine just to manually drag, drop, rename movies and tv shows and its made me happy.

Over the past couple of days I have now setup a Linux (ubuntu) machine which i control via ssh from my windows machine. (i'm new to linux and have had a lot of help). I have everything installed and running except my script only extracts the files from the rar, and moves them into the designated folder. What it is not doing is renaming them according to TheTVDB or MovieDB depending on the type of file. No i'm sure the reason is because i am butchering up the script so I need some help please.

so i was looking at some older links on these boards where i would use this, but with a warning not to use it above (at least how i understood it). this makes me think that the code goes out and finds thetvdb info or the moviedb info.

Code: Select all

filebot -script fn:watcher -extract -rename /home/administrator/Torrents/ --output /home/administrator/Torrents/Extracted --format "TV Shows/{n}/Season {s}/{n} {sxe} {t}" --db TheTVDB

filebot -script fn:housekeeping -extract -rename /home/administrator/Torrents/ --output /home/administrator/Torrents/Extracted --format "Movies/{n} {y}/{n} ({y}){" CD$pi"}" --db TheMovieDB


So this is currently what i have right now. I guess i could remove the music stuff i don't do music i have pandora and spotify.

Code: Select all

#!/bin/bash
TORRENT_ID=$1
TORRENT_NAME=$2
TORRENT_PATH=$3

filebot -script fn:amc --output "/home/administrator/Torrents/" --log-file amc.log --action duplicate --conflict override -non-strict --def ut_label=movie --def ut_label=tv --def ut_label=other --def music=y  artwork=y "ut_dir=$TORRENT_PATH/$TORRENT_NAME" "ut_kind=multi" "ut_title=$TORRENT_NAME"
Thank You
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot Automation help with extract / renaming

Post by rednoah »

NO!

Code: Select all

--def ut_label=movie --def ut_label=tv --def ut_label=other


You're forcing movie mode, then you're forcing TV mode, then you're forcing file mode. You're using --def ut_label wrong. I suspect you don't actually want to force anything?
:idea: Please read the FAQ and How to Request Help.
onyxius
Posts: 25
Joined: 26 Sep 2015, 07:09

Re: Filebot Automation help with extract / renaming

Post by onyxius »

Hi, no i guess i don't want to force anything, that folder is a mix match of movies and shows. though.

So when i run it now this is the output.

Code: Select all

administrator@server:~/MyScripts$ ./filebotgo.sh
Locking /home/administrator/Torrents/Extracted/amc.log--action
Run script [fn:amc] at [Sat Sep 26 12:54:24 CDT 2015]
Parameter: music = y
Parameter: artwork = y
Parameter: ut_dir = /
Parameter: ut_kind = multi
Parameter: ut_title = 
Argument: /home/administrator/MyScripts/duplicate
Invalid arguments: pass in either file arguments or ut_dir/ut_file parameters but not both
Failure (°_°)

administrator@server:~/MyScripts$ 
Last edited by onyxius on 27 Sep 2015, 16:55, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot Automation help with extract / renaming

Post by rednoah »

Read the Troubleshooting section, especially the RED BOLD parts. ;)

@see viewtopic.php?f=4&t=215
:idea: Please read the FAQ and How to Request Help.
onyxius
Posts: 25
Joined: 26 Sep 2015, 07:09

Re: Filebot Automation help with extract / renaming

Post by onyxius »

Thank you, ill do that now. So the extraction wasn't happening with this script i thought it was, i guess the deluge plugin extractor was doing it after-all. So what i'm going to try to do is have filebot extract the rar if it is in one. Then move the file "either from the rar or without the rar" move the file type out of the original and move it to the extracted folder. but i guess not move but copy since if it was not in a rar i dont want to mess with the original file. Ill start reading and come back here with questions :) fun learning this though.
onyxius
Posts: 25
Joined: 26 Sep 2015, 07:09

Re: Filebot Automation help with extract / renaming

Post by onyxius »

Ok now we are getting somewhere :)

So i tested manually running this script, by pointing it directly to the folder of the file, and putting the output such as /Extracted/ and ran it. it made a copy of the file, moved it to the Extracted folder, made a movies folder and dropped it in side of it and renamed it. perfect. But looking at that page above the code it says to use is way different, it has more perameters.

Code: Select all

filebot -script fn:amc --output "/path/to/output" --log-file amc.log --action copy -non-strict "/path/to/input" --def excludeList=amc.txt
It's saying to use this, except i dont see anything about an input path which i guess we could add.

Code: Select all

filebot -script fn:amc --output "X:/path/to/media" --log-file amc.log --action copy --conflict override -non-strict --def music=y subtitles=en artwork=y "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D"
Question, with the output folder, is it possible to move the file across a network onto a cloud drive attached to a router? instead of a local folder?
onyxius
Posts: 25
Joined: 26 Sep 2015, 07:09

Re: Filebot Automation help with extract / renaming

Post by onyxius »

odd i used the script but it doesn't unrar the files so essentially nothing is happening. So i shouldnt need to use "Extracted" plugin inside of deluge right, the script should essentially do the extraction, moving and then renaming correct?

In deluge "Execute" plug i call this script which is doing just that, running the script.

Code: Select all

/home/administrator/MyScripts/filebotgo.sh
onyxius
Posts: 25
Joined: 26 Sep 2015, 07:09

Re: Filebot Automation help with extract / renaming

Post by onyxius »

Ok. This is my current script. Files are downloading and being put into the administrator folder not the extracted folder. Files are not being renamed to the proper name. There is no amc.log file anywhere that i am finding. There is no amc.txt file anywhere, that i am finding.

Code: Select all

#!/bin/bash
TORRENT_ID=$1
TORRENT_NAME=$2
TORRENT_PATH=$3

filebot -script fn:amc --output "/home/administrator/Torrents/Extracted" --log-file amc.log --action duplicate --
conflict override -non-strict --def excludeList=amc.txt --def music=y subtitles=en artwork=y "ut_title=$TORRENT_N
AME" "ut_kind=multi" "ut_dir=$TORRENT_PATH/$TORRENT_NAME"
I tried --output "/home/administrator/Torrents/Extracted" and --output "$home/administrator/Torrents/Extracted"



OK!! so with this script i thee wed.. wait wrong. with this script, my files now get extracted, moved to the /Extracted folder, then renamed and put in their own sorting folder structure which is too awesome.

Code: Select all

#!/bin/bash
TORRENT_ID=$1
TORRENT_NAME=$2
TORRENT_PATH=$3

filebot -script fn:amc --output "/home/administrator/Torrents/Extracted" --log-file amc.log --action copy -non-st
rict "/home/administrator/Torrents/Extracted" --def excludeList=amc.txt

Now, the issue is, not extracting to the /Extracted folder but move it across the network to my cloud hdd where i already have a folder setup for movies and another folder for tv shows that plex is pointing to. I cant keep them on my linux server as i only have an 80 HDD. Also i tried streaming plex on that linux box back when it had windows on it and i ran into a lot of streaming issues, freezes, lags. So i moved plex to my wifes computer and its looking at the mywd cloud drive for the video files.

So i'm guessing change the second path after -non-strict from the extracted to the network location. Ill have to look because i dont know how it is with linux, windows its just \\servername or ipaddress\foldername.
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot Automation help with extract / renaming

Post by rednoah »

I'd start by making sure that your script is actually called.

@see viewtopic.php?f=4&t=3005
:idea: Please read the FAQ and How to Request Help.
onyxius
Posts: 25
Joined: 26 Sep 2015, 07:09

Re: Filebot Automation help with extract / renaming

Post by onyxius »

:( ok the last post where the script worked only worked because i manaully ran the script by typing in ./filebotgo.sh

If i download something and have deluge run the script by pointing to the script file it extracts the file into the administrator folder. So seems to me the scripts not actually running. Ill go to the page and start adding some logs, but the logs won't work if the scripts not running.

wish we had an irc channel, can't believe as awesome as filebot is there are not more people involved :) I really appreciate your time and patience.
onyxius
Posts: 25
Joined: 26 Sep 2015, 07:09

Re: Filebot Automation help with extract / renaming

Post by onyxius »

Here are some logs. right now when the script runs it is extracting the files into this path /home/administrator/Torrents

amc.log

Code: Select all

Run script [fn:amc] at [Sat Sep 26 17:34:33 CDT 2015]
Parameter: excludeList = amc.txt
Argument: /home/administrator/Torrents/Extracted
Using excludes: /home/administrator/Torrents/Extracted/amc.txt (12)
No files selected for processing
Failure (°_°)
user.log

Code: Select all

administrator
outlog (version)

Code: Select all

FileBot 4.6 (r3052) / OpenJDK Runtime Environment 1.8.0_45-internal
error.log the log is blank this is the code i'm using to call it as in the other forum post

Code: Select all

filebot -version > /home/administrator/.filebot/logs/out.log 2>/home/administrator/.filebot/logs/err.log
systeminfo.log

Code: Select all

FileBot 4.6 (r3052)
JNA Native: 4.0.0
MediaInfo: MediaInfoLib - v0.7.69
7-Zip-JBinding: OK
chromaprint-tools: fpcalc version 1.1.0 (/usr/share/filebot/fpcalc)
Extended Attributes: OK
Groovy Engine: 2.4.3
JRE: OpenJDK Runtime Environment 1.8.0_45-internal
JVM: 32-bit OpenJDK Server VM
CPU/MEM: 1 Core / 487 MB Max Memory / 13 MB Used Memory
OS: Linux (i386)
uname: Linux server 3.19.0-15-generic #15-Ubuntu SMP Thu Apr 16 23:32:01 UTC 2015 i686 i686 i686 GNU/Linux
Done ヾ(@⌒ー⌒@)ノ
env.log

Code: Select all

# Environment Variables #
_: /usr/bin/filebot
MAIL: /var/mail/administrator
LOGNAME: administrator
DISPLAY: localhost:10.0
SHLVL: 2
LD_LIBRARY_PATH: /usr/share/filebot
XDG_RUNTIME_DIR: /run/user/1000
HOME: /home/administrator
SSH_CONNECTION: 192.168.1.146 61811 192.168.1.108 22
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
SSH_TTY: /dev/pts/0
SSH_CLIENT: 192.168.1.146 61811 22
XDG_SESSION_ID: 33
SHELL: /bin/bash
LESSOPEN: | /usr/bin/lesspipe %s
LESSCLOSE: /usr/bin/lesspipe %s %s
TERM: xterm
LANG: en_US.UTF-8
PWD: /home/administrator/MyScripts
USER: administrator
LS_COLORS: rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:


# Java System Properties #
path.separator: :
java.vm.name: OpenJDK Server VM
java.io.tmpdir: /home/administrator/.filebot/temp
user.country: US
user.home: /home/administrator
useExtendedFileAttributes: true
java.vm.vendor: Oracle Corporation
user.language: en
java.vendor: Oracle Corporation
java.vendor.url.bug: http://bugreport.sun.com/bugreport/
swing.crossplatformlaf: javax.swing.plaf.nimbus.NimbusLookAndFeel
sun.net.client.defaultReadTimeout: 60000
java.specification.name: Java Platform API Specification
jna.nosys: true
os.name: Linux
java.runtime.name: OpenJDK Runtime Environment
application.deployment: deb
file.separator: /
sun.net.client.defaultConnectTimeout: 10000
java.vm.specification.version: 1.8
sun.boot.class.path: /usr/lib/jvm/java-8-openjdk-i386/jre/lib/resources.jar:/usr/lib/jvm/java-8-openjdk-i386/jre/lib/rt.jar:/usr/lib/jvm/java-8-openjdk-i386/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-8-openjdk-i386/jre/lib/jsse.jar:/usr/lib/jvm/java-8-openjdk-i386/jre/lib/jce.jar:/usr/lib/jvm/java-8-openjdk-i386/jre/lib/charsets.jar:/usr/lib/jvm/java-8-openjdk-i386/jre/lib/jfr.jar:/usr/lib/jvm/java-8-openjdk-i386/jre/classes
java.version: 1.8.0_45-internal
http.agent: FileBot 4.6
java.library.path: /usr/share/filebot:/usr/java/packages/lib/i386:/usr/lib/i386-linux-gnu/jni:/lib/i386-linux-gnu:/usr/lib/i386-linux-gnu:/usr/lib/jni:/lib:/usr/lib
unixfs: false
useGVFS: false
awt.toolkit: sun.awt.X11.XToolkit
java.vm.specification.name: Java Virtual Machine Specification
os.version: 3.19.0-15-generic
useCreationDate: false
file.encoding: UTF-8
java.awt.printerjob: sun.print.PSPrinterJob
grape.root: /home/administrator/.filebot/grape
java.class.version: 52.0
java.ext.dirs: /usr/lib/jvm/java-8-openjdk-i386/jre/lib/ext:/usr/java/packages/lib/ext
java.specification.version: 1.8
net.filebot.AcoustID.fpcalc: /usr/share/filebot/fpcalc
java.vendor.url: http://java.oracle.com/
ehcache.disk.store.dir: /home/administrator/.filebot/cache/0
sun.os.patch.level: unknown
sun.java.launcher: SUN_STANDARD
os.arch: i386
user.dir: /home/administrator/MyScripts
line.separator: 

user.timezone: America/Chicago
sun.cpu.endian: little
java.vm.specification.vendor: Oracle Corporation
java.home: /usr/lib/jvm/java-8-openjdk-i386/jre
java.net.useSystemProxies: false
sun.management.compiler: HotSpot Tiered Compilers
sun.arch.data.model: 32
java.endorsed.dirs: /usr/lib/jvm/java-8-openjdk-i386/jre/lib/endorsed
file.encoding.pkg: sun.io
java.specification.vendor: Oracle Corporation
sun.boot.library.path: /usr/lib/jvm/java-8-openjdk-i386/jre/lib/i386
sun.jnu.encoding: UTF-8
java.runtime.version: 1.8.0_45-internal-b14
java.vm.info: mixed mode
java.vm.version: 25.45-b02
sun.io.unicode.encoding: UnicodeLittle
java.awt.graphicsenv: sun.awt.X11GraphicsEnvironment
application.dir: /home/administrator/.filebot
java.class.path: /usr/share/filebot/FileBot.jar
sun.java.command: /usr/share/filebot/FileBot.jar -script fn:sysenv
sun.cpu.isalist: 
user.name: administrator


# Arguments #
args[0] = -script
args[1] = fn:sysenv


Done ヾ(@⌒ー⌒@)ノ

Now that i have those logs, i removed the ones with general info and this is my current script.

Code: Select all

#!/bin/bash
TORRENT_ID=$1
TORRENT_NAME=$2
TORRENT_PATH=$3

filebot -version > /home/administrator/.filebot/logs/out.log 2>/home/administrator/.filebot/logs/err.log
filebot -script fn:sysenv > /home/administrator/.filebot/logs/env.log 2>&1


filebot -script fn:amc --output "/home/administrator/Torrents/Extracted" --log-file amc.log --action copy -non-strict "/hom
e/administrator/Torrents/Extracted" --def excludeList=amc.txt
onyxius
Posts: 25
Joined: 26 Sep 2015, 07:09

Re: Filebot Automation help with extract / renaming

Post by onyxius »

so now, the script is running but nothing is extracting even when i manually run the script. what is going on.
onyxius
Posts: 25
Joined: 26 Sep 2015, 07:09

Re: Filebot Automation help with extract / renaming

Post by onyxius »

UPDATE!

Ok so with this script the files are now extracted, moved, renamed properly. So this works.

Code: Select all

#!/bin/bash
TORRENT_ID=$1
TORRENT_NAME=$2
TORRENT_PATH=$3

filebot -script fn:amc --output "/home/administrator/Torrents/Extracted" --log-file amc.log --action copy -non-strict "/hom
e/administrator/Torrents/New" --def excludeList=amc.txt
How can i change the output path from /hom
e/administrator/Torrents/New" to a network drive location?

I have a WD My Drive that has all of my stuff on it. This would work perfect if i can just move the files to that drive instead of on the server.

I know i can use something like rsync (i'm not familiar with it) but i would worry a 3rd party program trying to move files in the middle of filebot doing it's thing. Doesnt filebot have something to transfer to another network location?
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot Automation help with extract / renaming

Post by rednoah »

Mount the network share somewhere, and then set --output to that somewhere. It's Linux basics. Google will help with the details. ;)
:idea: Please read the FAQ and How to Request Help.
onyxius
Posts: 25
Joined: 26 Sep 2015, 07:09

Re: Filebot Automation help with extract / renaming

Post by onyxius »

yup found a great guide last night that helped me :)

For future users or anyone who is curious, this is the guide i used to mount the network location.

http://ubuntuforums.org/showthread.php?t=2247242


You can close this thread, i'm going to open a new one for another task i'm trying to do, to keep things separate.

Thank you
onyxius
Posts: 25
Joined: 26 Sep 2015, 07:09

Re: Filebot Automation help with extract / renaming

Post by onyxius »

Hmm so I added the option to notify the plex server on the linux box (same machine) and the output was this.

Code: Select all

Notify Plex: localhost
GET: https://localhost:32400/library/sections/all/refresh
SSLHandshakeException: java.security.cert.CertificateException: No subject alternative DNS name mat
ching localhost found.
Done ヾ(@⌒ー⌒@)ノ

In my code i have this.

Code: Select all

--def plex=localhost
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot Automation help with extract / renaming

Post by rednoah »

HTTPS doesn't work for "localhost" requests.

Turn on HTTP (Plex security settings) and use 127.0.0.1 instead.
:idea: Please read the FAQ and How to Request Help.
onyxius
Posts: 25
Joined: 26 Sep 2015, 07:09

Re: Filebot Automation help with extract / renaming

Post by onyxius »

you mean this? By adding this 127.0.0.1/255.255.255.255
Change Server Network Authorization Settings

https://support.plex.tv/hc/en-us/articl ... ork-access
Post Reply