Page 1 of 2

utorrent script win7 64bits

Posted: 16 Dec 2012, 10:10
by nissse
Hello

I have a problem that I cant find any answer to. I have searched the forum for hours without finding a solution.
As a last resort I will post here for help.

The Problem:
When I try to run the scrip in utorrent it don't work. I can see the cmd promt for about half a second then nothing.
The log is empty
If I copy the output from utorrent and run it in cmd it works great.

System:
windows 7 64 bits
filebot 3.2 64 bits
java 7 64 bits

C:\>filebot -script fn:sysinfo
FileBot 3.2 (r1372)
JNA Native: 3.5.0
MediaInfo: MediaInfoLib - v0.7.61
7-Zip-JBinding: OK
Extended Attributes: OK
Java(TM) SE Runtime Environment 1.7.0_09
64-bit Java HotSpot(TM) 64-Bit Server VM
Windows 7 (amd64)
Done ?(?????)?

line in utorrent: filebot -script fn:utorrent-postprocess --output "E:/Torrents/Unpacked" --action copy --conflict override -non-strict --log all --def subtitles=y artwork=y "ut_dir=%D" "ut_file=%F" "ut_kind=%K" "ut_title=%N" "ut_label=%L" "ut_state=%S" >>"E:/log.txt"

I have tried installing 32 bits java and then utorrent runs the script but 7zip doesn't work.
Java and filebot variables are working.

Re: utorrent script win7 64bits

Posted: 16 Dec 2012, 10:41
by rednoah
Make sure you only have one Java runtime installed. Since utorrent is 32-bit it'll use the 32-bit PATH and my prefer using 32-bit programs.

Whatever happens, there is cmdline output, except you're not redirecting all output, stdout and stderr. Just use the cmds I prepared for you and you'll see whats going in.

Redirect stderr into stdout, redirect stdout to file:

Code: Select all

... >> "%D\filebot.log" 2>&1

Re: utorrent script win7 64bits

Posted: 16 Dec 2012, 11:27
by nissse
Thank you for the quick reply.

I have uninstalled all java and re installed java 64 bits. I did try this yesterday also. (i have tried only 32bits java and 32 bits filebot to)
But now it runs only 64 bits java and 64 bits filebot.

filebot -script fn:utorrent-postprocess --output "E:/Torrents/Unpacked" --action copy --conflict override -non-strict --log all --def subtitles=y artwork=y "ut_dir=%D" "ut_file=%F" "ut_kind=%K" "ut_title=%N" "ut_label=%L" "ut_state=%S" >> "%D\filebot.log" 2>&1

this gives me: 'java' is not recognized as an internal or external command,
operable program or batch file.

if i try java -? in cmd it working:
C:\>java -?
Usage: java [-options] class [args...]

Thank you Rednoah for taking the time to help.

Ps It's not easy registering on the forum when the question asks for the newest version of filebot and i try 3.2 ;)

Re: utorrent script win7 64bits

Posted: 16 Dec 2012, 12:08
by nissse
After adding "C:\Program Files\Java\jre7\bin\java.exe" to filebot.cmd it looks like it's working. I will do some more testing.

Re: utorrent script win7 64bits

Posted: 16 Dec 2012, 12:32
by rednoah
Did you restart utorrent after installing/uninstalling Java? The whole environment might get copied at that point, it's the same with each cmd instance anyway.

PS: Ups, forgot to update that... updated security question answer as well now :P

Re: utorrent script win7 64bits

Posted: 16 Dec 2012, 18:31
by nissse
I did restart utorrent some times to try running is as administrator but not sure if if was right after installing java.

Editing the filebot.cmd works fine for me.

For some new questions: If 2 downloads finishes at the same time only 1 will be extracted and the other one ignored. Is this normal ?
Is there a way to tell 7-zip to extract to output folder instead of extracting to original folder and then copy ?

BR
nissse

Re: utorrent script win7 64bits

Posted: 17 Dec 2012, 02:33
by rednoah
What's the cmdline std/err output for the one that didn't extract? I'm having two filebot instances extracting two archives right now, so it works.

First archives will be extracted, and only later things will go through processing, so no. Also the script doesn't keep track what files were originally in an archive so it can't switch between copy/move later. The latter mod should be pretty easy to do.

Re: utorrent script win7 64bits

Posted: 17 Dec 2012, 13:35
by nissse
After I got filebot working I changed the logging to >>"E:/log.txt" and when 2 downloads finished at the same time only 1 shows up in the log.

To be able to see the log I changed back to >> "%D\filebot.log" 2>&1 and now it's working with 2 downloads at the same time =) ?!?!

Is there a way to use the clean script to only remove empty folders ?

Re: utorrent script win7 64bits

Posted: 17 Dec 2012, 16:16
by rednoah
Sure. Just run it. You can do it manually, or schedule it everyday or just && two commands in uTorrent.

Re: utorrent script win7 64bits

Posted: 19 Dec 2012, 18:24
by nissse
Thanks.

I changed the cleaner script to only delete empty folders and log files.

I have many local tv shows that filebot cant find match for. And when this happens the files are not being moved to the XBMC library folder.
My question is: is it posible to run a .bat to copy this files only if filebot can't find any match ?

Re: utorrent script win7 64bits

Posted: 20 Dec 2012, 02:10
by rednoah
Well, you'd have to add something at the end of the script to do that.

In utorrent-postprocess I first collect all input files. So in the end you could just check what's still there.

e.g.
input.findAll{ it.exists() }*.copyTo('X:/...')

Re: utorrent script win7 64bits

Posted: 20 Dec 2012, 08:24
by nissse
Thanks

It works with copy but what i really like is move and I can't get it to work

input.findAll{ it.exists() }*.moveTo('E:/Torrents/Unpacked/Unsorted')

error:

C:\Users\User1\Desktop\Ember_1.3.0.7>filebot -script "C:\Program Files\FileBot\u
torrent-postprocess.groovy" "E:/Torrents/Complited/_RSS/Swetv/Dox.Mitt.Morka.Hja
rta.SWEDiSH.HDTV.x264-XENON/" --output "E:/Torrents/Unpacked/Unsorted" --action
move --conflict skip -non-strict
Argument: E:\Torrents\Complited\_RSS\Swetv\Dox.Mitt.Morka.Hjarta.SWEDiSH.HDTV.x2
64-XENON
Read archive [dox.mitt.morka.hjarta.swedish.hdtv.x264-xenon.rar] to [E:\Torrents
\Complited\_RSS\Swetv\Dox.Mitt.Morka.Hjarta.SWEDiSH.HDTV.x264-XENON\dox.mitt.mor
ka.hjarta.swedish.hdtv.x264-xenon]
Extracting files [E:\Torrents\Complited\_RSS\Swetv\Dox.Mitt.Morka.Hjarta.SWEDiSH
.HDTV.x264-XENON\dox.mitt.morka.hjarta.swedish.hdtv.x264-xenon\dox.mitt.morka.hj
arta.swedish.hdtv.x264-xenon.mp4]
Input: E:\Torrents\Complited\_RSS\Swetv\Dox.Mitt.Morka.Hjarta.SWEDiSH.HDTV.x264-
XENON\dox.mitt.morka.hjarta.swedish.hdtv.x264-xenon\dox.mitt.morka.hjarta.swedis
h.hdtv.x264-xenon.mp4
dox.mitt.morka.hjarta.swedish.hdtv.x264-xenon.mp4 [series: null, movie: null]
Group: [tvs:null, mov:null, anime:null] => [dox.mitt.morka.hjarta.swedish.hdtv.x
264-xenon.mp4]
FileAlreadyExistsException: E:\Torrents\Unpacked\Unsorted
java.nio.file.FileAlreadyExistsException: E:\Torrents\Unpacked\Unsorted
at net.sourceforge.tuned.FileUtilities.moveRename(Unknown Source)
at Script2$_run_closure28.doCall(Script2.groovy:45)
at Script3.run(Script3.groovy:244)
at net.sourceforge.filebot.cli.ScriptShell.evaluate(Unknown Source)
at net.sourceforge.filebot.cli.ScriptShell.runScript(Unknown Source)
at net.sourceforge.filebot.cli.ArgumentProcessor.process(Unknown Source)

at net.sourceforge.filebot.Main.main(Unknown Source)
Failure (░_░)

Re: utorrent script win7 64bits

Posted: 20 Dec 2012, 09:01
by rednoah
It's what it says somewhere in there, it neither move nor copy will work if the destination already exists. Delete the files you copied before. ;)

Since this will flatten the file hierarchy better only move/copy video files since the names will most likely be unique.

e.g.
input.findAll{ it.isVideo() }

Re: utorrent script win7 64bits

Posted: 20 Dec 2012, 09:31
by nissse
I tryed with input.findAll{ it.isVideo() } but same result: works with copy but don't with move

Unsorted folder is empty
when i run the copy scrip I get a nice file in unsorted like this: dox.mitt.morka.hjarta.swedish.hdtv.x264-xenon.mp4

Unsorted folder is empty
input.findAll{ it.isVideo() }*.moveTo('E:/Torrents/Unpacked/Unsorted/test')
when I run this script I get a file named "test" in the unsorted folder

It looks like when I use move it's not getting the right filename. Any ides ?

Re: utorrent script win7 64bits

Posted: 20 Dec 2012, 12:21
by rednoah
Maybe I didn't make that function smart enough to handle move to file as well as move to folder.

Now you can either just do a foreach file and use moveTo with full destination filepath or copyTo+delete.

Re: utorrent script win7 64bits

Posted: 20 Dec 2012, 12:40
by nissse
I have no java programming experience at all. Maybe a example how to use foreach or delete cmd.

I know it's asking a lot and you have been so helpful already so I will ask here and at the same time Google it to try to find a answer.

THX

Re: utorrent script win7 64bits

Posted: 20 Dec 2012, 12:57
by nissse
That was easy =)

input.findAll{ it.isVideo() }*.copyTo('E:/Torrents/Unpacked/Unsorted/test/')
input.findAll{ it.isVideo() }*.delete()

*edit* It looked like it was working but when I run it from utorrent it did not delete, is it wrong command ?


If there is a way to make it move instead it will be perfect (less activity on the hdd)

BR

Re: utorrent script win7 64bits

Posted: 20 Dec 2012, 14:02
by rednoah
I'm writing this from the top of my head but should e something like this

input.each{
it.moveTo(new File("X:/output", it.name))
}

Re: utorrent script win7 64bits

Posted: 20 Dec 2012, 14:52
by nissse
Thank you Rednoah

It looks like it's working. I will let utorrent download and monitor the result.

Re: utorrent script win7 64bits

Posted: 21 Dec 2012, 20:55
by nissse
Hello again

Is there some way to put the logfile in the renamed folder ?

BR

Re: utorrent script win7 64bits

Posted: 15 Jan 2013, 09:55
by nissse
Is it not possible to put the logfile in the folder created by filebot ex:

E:\Torrents\Unpacked\TV Shows\Hawaii Five-0

Re: utorrent script win7 64bits

Posted: 15 Jan 2013, 13:49
by rednoah
Not really. You'd have to know where the files go before u start processing, not to mention that files can be sorted into different locations depending on the format used.

What u can do however is passing in your own rename action code:
http://filebot.sourceforge.net/forums/v ... =280#p1750

But this, like the history, will not get u a log, just old/new name pairs in a text files or something like that.

Re: utorrent script win7 64bits

Posted: 15 Jan 2013, 13:57
by nissse
Thank you for your reply

Ok is there any way of creating any file in the folder created by filebot ex:

E:\Torrents\Unpacked\TV Shows\Hawaii Five-0

What I want is for the folder "Hawaii Five-0" to update it's timestamp.
What it does now is only update's the Season folder inside and when browsing in explorer "list by date" I don't get the newest listed at the top.

Re: utorrent script win7 64bits

Posted: 15 Jan 2013, 14:25
by rednoah
Do folders have Last-Modified timestamps? No idea, maybe Windows picks the latest Last-Modified from the files in the folder. It's possible by coding this up in your own custom rename action.

It's probably smarter to just use the Windows Video library feature. Arrange by Name, Sort by Date. That'll give u a list of all your files with new newest downloads up top.

Re: utorrent script win7 64bits

Posted: 15 Jan 2013, 14:38
by nissse
how do I get the "passing in your own rename action code: viewtopic.php?f=4&t=280#p1750" to output a file in the folder I whant instead of showing in the cmd window ?