AMC Vuze integration issues.

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
junkmail
Posts: 6
Joined: 09 Apr 2013, 04:48

AMC Vuze integration issues.

Post by junkmail »

Hi there, I'm attempting to get filebot to play nicely with vuze. I'm using 'command runner' unfortunately command runner executes the code as soon as the download is complete (executes in the partials folder) before it is moved to the completed, passing along the wrong folder info to filebot.

I know almost nothing of coding, is there an easy fix or should I have my partials and completed in the same folder? (so messy it makes me uncomfortable)

Here's my 'code' and the crap that vuze puts out.

Code: Select all

filebot -script "C:/Program Files/FileBot/amc.groovy" --output "E:/TV Incoming"  --action copy --conflict override -non-strict --def music=n artwork=n "ut_dir=%D" "ut_file=%F" "ut_kind=%K" "ut_title=%N" "ut_label=%L" "ut_state=%S"

Code: Select all

Executing: filebot -script "C:/Program Files/FileBot/amc.groovy" --output "E:/TV Incoming"  --action copy --conflict override -non-strict --def music=n artwork=n "ut_dir=E:\Torrents Incomplete Vuze\Emmerdale.20130408.WS.PDTV.Xvid-Tiggzz" "ut_file=" "ut_kind=multi" "ut_title=Emmerdale.20130408.WS.PDTV.Xvid-Tiggzz" "ut_label=Uncategorised" "ut_state=%S"
also, I'd like to have it always copy the file (when run from command prompt it only copies if it guesses a name, if doesn't get the name it skips it.)

Code: Select all

filebot -script "C:/Program Files/FileBot/amc.groovy" "e:\test" --output "E:/TVtest"  --action copy --conflict override -non-strict
I'm on RDP into w7, vuze 4.6.04 and filebot 3.5
junkmail
Posts: 6
Joined: 09 Apr 2013, 04:48

Re: AMC Vuze integration issues.

Post by junkmail »

Changing the incomplete folder to match the completed folder has resolved the situation.
I am still unsure if it skips files it doesn't recognize.

I currently unpack loose (no sub folders) my shows into \incoming where it is then sorted into a formal storage structure after it's been in there for a week. This allows me to use my tablet to smb into the 'shared folder \incoming' and just get what's recent (sort by date), before it's archived. It's a good system, of course this is now done through dos scripts.

I'll use the dos scripts to move my temp folder, then have that housekeeper.groovy script archive them.
junkmail
Posts: 6
Joined: 09 Apr 2013, 04:48

Re: AMC Vuze integration issues.

Post by junkmail »

Just an update in case anyone needs it, here's the code I am using to sort from temp into an 'folder structure'. Uses robocopy, a windows utility for windows
robocopy "E:\TV Incoming" e:\temp /MOV /MINAGE:7

filebot -rename "e:/temp" --output "E:/TV Episodes" --format "{n}/Season {s}/{n}-{s00e00}-{t}" --action move --conflict override -non-strict
This 7 day recent episodes folder is allowing me to correct any naming mistakes that FB is making.

As to my outstanding issue, when episodes/shows are not recognized. They are skipped. I would prefer a copy first then rename IF a match is made else leave the copy in new folder. Also when unraring and a match is not made, the original is not removed. I will have to look at the cleanup script, it might be possible to solve both problems if I can get some spare time to learn groovy.
junkmail
Posts: 6
Joined: 09 Apr 2013, 04:48

Re: AMC Vuze integration issues.

Post by junkmail »

So a little insight into what my problem is (besides lack of sleep). One of the failed shows
vuze called this

Code: Select all

filebot -script "C:/Program Files/FileBot/amc.groovy" --output "E:/TV Incoming"  --action copy --conflict override -non-strict --def music=n artwork=n "ut_dir=E:\Torrents Completed Vuze\EPL.2013.04.14.Stoke.City.Vs.Manchester.United.720p.HDTV.x264-FAIRPLAY" "ut_file=" "ut_kind=multi" "ut_title=EPL.2013.04.14.Stoke.City.Vs.Manchester.United.720p.HDTV.x264-FAIRPLAY" "ut_label=TD" "ut_state=%S"  --def clean=y
this is what it resulted in.

Code: Select all

C:\Users\Remote>filebot -script "C:/Program Files/FileBot/amc.groovy" --output "
E:/TV Incoming"  --action copy --conflict override -non-strict --def music=n art
work=n "ut_dir=E:\Torrents Completed Vuze\EPL.2013.04.14.Stoke.City.Vs.Mancheste
r.United.720p.HDTV.x264-FAIRPLAY" "ut_file=" "ut_kind=multi" "ut_title=EPL.2013.
04.14.Stoke.City.Vs.Manchester.United.720p.HDTV.x264-FAIRPLAY" "ut_label=TD" "ut
_state=%S"  --def clean=y
Parameter: music = n
Parameter: artwork = n
Parameter: ut_dir = E:\Torrents Completed Vuze\EPL.2013.04.14.Stoke.City.Vs.Manc
hester.United.720p.HDTV.x264-FAIRPLAY
Parameter: ut_file =
Parameter: ut_kind = multi
Parameter: ut_title = EPL.2013.04.14.Stoke.City.Vs.Manchester.United.720p.HDTV.x
264-FAIRPLAY
Parameter: ut_label = TD
Parameter: ut_state = %S
Parameter: clean = y
Read archive [fairplay-epl.2013.04.14.stoke.vs.man.utd.720p.rar] to [E:\Torrents
 Completed Vuze\EPL.2013.04.14.Stoke.City.Vs.Manchester.United.720p.HDTV.x264-FA
IRPLAY\fairplay-epl.2013.04.14.stoke.vs.man.utd.720p]
Extracting files [E:\Torrents Completed Vuze\EPL.2013.04.14.Stoke.City.Vs.Manche
ster.United.720p.HDTV.x264-FAIRPLAY\fairplay-epl.2013.04.14.stoke.vs.man.utd.720
p\fairplay-epl.2013.04.14.stoke.vs.man.utd.720p.mkv]
Input: E:\Torrents Completed Vuze\EPL.2013.04.14.Stoke.City.Vs.Manchester.United
.720p.HDTV.x264-FAIRPLAY\fairplay-epl.2013.04.14.stoke.vs.man.utd.720p\fairplay-
epl.2013.04.14.stoke.vs.man.utd.720p.mkv
Group: [tvs:fairplay epl] => [fairplay-epl.2013.04.14.stoke.vs.man.utd.720p.mkv]

Rename episodes using [TVRage]
Auto-detected query: [fairplay epl]
Failed to fetch episode data: [fairplay epl]
Exception: Unable to match files to episode data
Done ?(?????)?
So 2 things, first the --clean doesn't remove the mkv it extracted. It's left 'E:\Torrents Completed Vuze\EPL.2013.04.14.Stoke.City.Vs.Manchester.United.720p.HDTV.x264-FAIRPLAY\fairplay-epl.2013.04.14.stoke.vs.man.utd.720p\fairplay-epl.2013.04.14.stoke.vs.man.utd.720p.mkv'
Second, I was thinking that perhaps the EPL could easily be changed to English Premiere league. However from http://www.filebot.net/forums/viewtopic.php?f=8&t=624 I tried to get a simple epl -> english premiere league inserted into my copy of AMC however if I was to do that, wouldn't I be changing the original name? Is there a way to have a list of custom acronyms from csv just for the search?
I know

Code: Select all

Y:/Videos/TV/{def a; new File('Y:/incoming/scripts/names.csv').splitEachLine(';'){ if (n == it[0]) a = it[1]}; a ?: n.upperInitial().replaceTrailingBrackets()}/{"Season"} {s.pad(2)}/{n} - [{s.pad(2)}x{e.pad(2)}] - {t}
but where to put it?

As to catching the missed files, the errors that It's throwing aren't in amc.groovy. 'Auto-detected query:' I'm guessing this code is in FB, so still no clue.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC Vuze integration issues.

Post by rednoah »

1. It errors out and nothing is renamed => Don't delete files. Made it so on purpose.

@see amc.groovy

Code: Select all

// skip notifications if nothing was renamed anyway
if (getRenameLog().isEmpty()) {
	return
}
2. You can't but I can.
http://www.filebot.net/forums/viewtopic ... 2478#p2478

Added mapping:

Code: Select all

epl	English Premier League
Now that that works it's even worse. Mismatch. Haha :D

Code: Select all

Fetching episode data for [English Premier League]
[COPY] Rename [D:\testdata\AMC-TEST\EPL.2013.04.14.Stoke.City.Vs.Manchester.United.720p.HDTV.x264-FAIRPLAY\fairplay-epl.2013.04.14.stoke.vs.man.utd.720p\fairplay-epl.2013.04.14.stoke.vs.man.utd.720p.mkv] to [D:\output\TV Shows\English Premier League\Season 20\English Premier League - S20E04 - Man City v. Swansea.mkv]
But that's because info on TheTVDB is incomplete. Once you add it, with date, it'll work.
:idea: Please read the FAQ and How to Request Help.
junkmail
Posts: 6
Joined: 09 Apr 2013, 04:48

Re: AMC Vuze integration issues.

Post by junkmail »

Awesome! thanks for adding it to the mapping. If I find others I will add them.
As to 1. is it possible to add a procedure instead of return? (I'm sorry for my cut and paste approach to coding, it's a little more complicated than just copy)

Code: Select all

// skip notifications if nothing was renamed anyway
if (getRenameLog().isEmpty()) {
copy = { File src,File dest->
 
def input = src.newDataInputStream()
def output = dest.newDataOutputStream()
 
output << input
 
input.close()
output.close()
}
 
File srcFile = $f

File destFile = new File('h:/test/'$f.name )
copy(srcFile,destFile)
   
}
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC Vuze integration issues.

Post by rednoah »

I don't know what you're trying to do. But you're copy/paste code doesn't make any sense at all. :P

You want to copy files? That'd be File.copyTo(folder).

e.g.

Code: Select all

f.copyTo(new File("D:/path/to/remainder"))
The rest doesn't make any sense. I can only guess you may want to copy files that have not been processed for whatever reason to be copied to another folder? Read this thread: http://www.filebot.net/forums/viewtopic ... =659#p4436
:idea: Please read the FAQ and How to Request Help.
junkmail
Posts: 6
Joined: 09 Apr 2013, 04:48

Re: AMC Vuze integration issues.

Post by junkmail »

You guess correct! That's exactly it, I've copied the following code into my copy of AMC and it's working under simple tests. (Works much better than my last copy/paste code)
//copy un-named media to dump folder
input.each{ f ->
if ( !getRenameLog().containsKey(f) ) {
println "[REMAINING FILE] $f"
_guarded{ f.copyTo(new File("D:/TV New")) }
}
}

// skip notifications if nothing was renamed anyway
The reason I like this always copy is mostly for sporting events/ poorly named files/ similar names (UK vs USA shows), in mediaportal, I use 'mytvseries' to watch series shows and moving pictures to watch movies. Both of which gather fan art and episode data. But when the filenames are incorrect they 'nag to rename' constantly pops, or worse are completely wrong and have to be 1st found then renamed.
So to solve this I have in the past and can now do so in the future (yay thanks!) is dump them into the 'videos' plugin in MP which doesn't grab ep data or fan art etc.

so folder something like this
\incoming (azureus completed folder)
\recent TV (7days old, older are moved to temp folder)
\TVseries (see prev post, older files are sorted with second FB nto folder archivish structure)
\movies (could do a 7 day folder too)
\MYvideos (using strict naming, anything that isn't named is copied here)
New call for command runner

Code: Select all

filebot -script "C:/Program Files/FileBot/amc.groovy" --output "E:/TV Incoming"  --action copy --def music=n artwork=n "ut_dir=%D" "ut_file=%F" "ut_kind=%K" "ut_title=%N" "ut_label=%L" "ut_state=%S" --def clean=y
I'm looking forward to testing this out over the next week or so, and thanks for pointing me in the right direction.
Post Reply