Running FileBot from the console, Groovy scripting, shell scripts, etc
Chryses
Posts: 66 Joined: 26 Aug 2012, 19:11
Post
by Chryses » 02 Aug 2013, 19:48
Hi, one strange problem, I setup my userkey, the "master" one, but push notification still not works and I don't know way
So, my launch script is this, is partitular, I try to "filter" only the movie extension, maybe is not the best but works. I use watcher for a recursive incron
Code: Select all
#/bin/bash
filename=$1
check_dir="/media/TwoTera/Download/vari"
dest_dir="/media/TwoTera/Multimedia"
video_ext="mp4 flv avi divx mpg mpeg mkv"
priority="nice -19"
file_ext=$(echo $filename |awk -F . '{if (NF>1) {print $NF}}')
base=$(basename "$filename")
extension="${base##*.}"
nome="${base%.*}"
percorso="$( dirname "$filename" )"
for ext in $video_ext; do
if [ -w "$percorso/$nome.$ext" ]; then
$priority filebot -script fn:amc "$filename" --output "$dest_dir" --action move --conflict override -non-strict --def pushover=[...] --def music=n --log-file amc.log --def artwork=n --def "seriesFormat=Serie Tv/{n}/{n} - {s.pad(2)}x{es.collect{ it.pad(2) }.join('-')} - {t}" "movieFormat=Film/{n} ({y}){\" Cd\$pi\"}" --lang it
fi
done
and this's my result
Locking /home/xbmc/.filebot/logs/amc.log
Parameter: pushover = [...]
Parameter: music = n
Parameter: artwork = n
Parameter: seriesFormat = Serie Tv/{n}/{n} - {s.pad(2)}x{es.collect{ it.pad(2) }.join('-')} - {t}
Parameter: movieFormat = Film/{n} ({y}){" Cd$pi"}
Argument: /media/TwoTera/Download/vari/The.Host.2013.iTA-ENG.Bluray.720p.x264-TRLL.mkv
Input: /media/TwoTera/Download/vari/The.Host.2013.iTA-ENG.Bluray.720p.x264-TRLL.mkv
The.Host.2013.iTA-ENG.Bluray.720p.x264-TRLL.mkv [series: null, movie: The Host (2013)]
Group: [tvs:null, mov:The Host (2013), anime:null] => [The.Host.2013.iTA-ENG.Bluray.720p.x264-TRLL.mkv]
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/media/TwoTera/Download/vari/The.Host.2013.iTA-ENG.Bluray.720p.x264-TRLL.$
[MOVE] Rename [/media/TwoTera/Download/vari/The.Host.2013.iTA-ENG.Bluray.720p.x264-TRLL.mkv] to [/media/Tw...
Processed 1 files
Any clue?
J
rednoah
The Source
Posts: 24495 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 02 Aug 2013, 20:31
The log ends with something like this right?
Code: Select all
...
Processed 10 files
Sending Pushover notification
Done ヾ(@⌒ー⌒@)ノ
I've tested and the Pushover part works, I get the messages when I open the app. Though Timer push-notifications don't seem to work right now. That's an issue on their side.
Chryses
Posts: 66 Joined: 26 Aug 2012, 19:11
Post
by Chryses » 02 Aug 2013, 20:57
nope, my logs end in this way
Code: Select all
Auto-detect movie from context: [/media/TwoTera/Download/vari/The.Host.2013.iTA-ENG.Bluray.720p.x264-TRLL.mkv]
[MOVE] Rename [/media/TwoTera/Download/vari/The.Host.2013.iTA-ENG.Bluray.720p.x264-TRLL.mkv] to [/media/TwoTera/Multimedia/Film/The Host (2013).mkv]
Processed 1 files
I've used the key that I've on the homepage of pushover website, it's correct?
Chryses
Posts: 66 Joined: 26 Aug 2012, 19:11
Post
by Chryses » 03 Aug 2013, 15:10
rednoah wrote: The log ends with something like this right?
Code: Select all
...
Processed 10 files
Sending Pushover notification
Done ヾ(@⌒ー⌒@)ノ
I've tested and the Pushover part works, I get the messages when I open the app. Though Timer push-notifications don't seem to work right now. That's an issue on their side.
I've found the "problem" but I don't know how to solve it!
I've launched a very light string
Code: Select all
filebot -script fn:amc "/home/jorman/Scrivania/da/" --output "/home/jorman/Scrivania/a" --log-file amc.log --action move --conflict override -non-strict --def pushover=...
so the process start but at the end, before the pushover phase, java take all the cpu resource and seems to be blocked, so I've to kill java manually.
Code: Select all
18261 jorman 20 0 725m 146m 18m S 85,5 9,8 1:13.73 java
I've tried on 2 pc, one with ubuntu 12.10 and one with xubuntu 13, same results.
Maybe I miss one package or the java version that I use is not right?
J
rednoah
The Source
Posts: 24495 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 03 Aug 2013, 15:28
Make sure you're using the latest Java 7. Thought I can't think of anything that'd take CPU after renaming is done. You could try just leaving it for a while and see what happens. It's doing something I suppose.
Chryses
Posts: 66 Joined: 26 Aug 2012, 19:11
Post
by Chryses » 03 Aug 2013, 15:38
java version "1.7.0_25"
If I use the --def pushover function the rename process works but not the pushover phase, so java stuck at 100%
If I don't use the pushover function all works well.
I don't know how the pushover phase works, but maybe the problem is there?
Btw, what key I've to put on pushover configuration? because If I wanna to use external script I've to make my application and I need to use token and apikey.
Chryses
Posts: 66 Joined: 26 Aug 2012, 19:11
Post
by Chryses » 03 Aug 2013, 16:21
Ps,
I looked at the amc code, and I found this
Code: Select all
if (pushover) {
// include webservice utility
include('fn:lib/ws')
_log.info 'Sending Pushover notification'
Pushover(pushover).send("Finished processing ${tryQuietly { ut_title } ?: input*.dir.name.unique()} (${getRenameLog().size()} files).")
}
I run it under linux, I had to add some programs?
J
rednoah
The Source
Posts: 24495 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 04 Aug 2013, 08:41
No. That part is pure Java. FileBot has it's predefined application token so with --def pushover you only need to pass in your user key.
The include means it's loading code from here:
http://filebot.net/scripts/lib/ws.groovy
EDIT:
This line may take some time as it fetches some depedencies:
Code: Select all
@Grab(group='org.jsoup', module='jsoup', version='1.7.1')
Have you ever tried just letting it run for lets say 30min? And see if it finishes by itself?
Chryses
Posts: 66 Joined: 26 Aug 2012, 19:11
Post
by Chryses » 04 Aug 2013, 09:25
I'll try now, I leave it run...for at leas 30 min
But that code
Code: Select all
@Grab(group='org.jsoup', module='jsoup', version='1.7.1')
if only for MyEpisodes session, righ?
Chryses
Posts: 66 Joined: 26 Aug 2012, 19:11
Post
by Chryses » 04 Aug 2013, 11:13
Still running, nothing happens
Ther's any whay to make a debug to find the "problem"?
J
rednoah
The Source
Posts: 24495 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 04 Aug 2013, 14:00
I've split the code that needs to @Grab extra libs from the simple pushover calls. Try again after 24h or -clear-cache.
Chryses
Posts: 66 Joined: 26 Aug 2012, 19:11
Post
by Chryses » 04 Aug 2013, 14:59
Wow, now works!
I don't know how the filebot pushover nitification looks, maybe is normal, but in notification I see that:
Finished processing [da] (1 files)
da is the directory that contain the test file
rednoah
The Source
Posts: 24495 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 04 Aug 2013, 15:29
Yes. Because the max-message-size of push notifications is very small there'll be no paths. Just basic summary.