Utorrent script help please

Any questions? Need some help?
Post Reply
part timer
Posts: 181
Joined: 09 May 2012, 23:35

Utorrent script help please

Post by part timer »

Ok so a few things on this utorrent script are holding me back. I'm finally trying to get it working for me.

1. I'd really like the same file used for folder.jpg, poster.jpg and movie.tbn but I really don't know of an easy way to download it once and save it as all 3 filenames, help would be appreciated.

2. I don't know what's going on with the email portion of this but it has never worked for me, so maybe you could point me in the right direction there, I thought I just had to throw in my gmail=username:password but maybe it doesn't like that I have 2.'s in my email address? I'm not sure

*****edit**** Well damn. I just tried copy and pasting the stock call from inside the utorrent script and only changing the things I had to and let it run and it did email me for the first time, so something I'm doing is messing it up. :(

****edit**** It seems that because I'm using a local file for my formatting needs instead of include lib, which then looks locally, I tried include fn lib which seemed like maybe it would work but still gave errors, although not as easy to figure out. I changed it to include http:...... then it worked once it was finding the the script online properly. I guess I could save it locally just in case a future change renders it useless to me, but finally it works. Now, if only I could figure out how to get rid of all my socket timeouts on artwork and how to save multiple posters like I mentioned above.

Code: Select all

SocketTimeoutException: Read timed out
ScriptException: org.codehaus.groovy.control.MultipleCompilationErrorsException:
 startup failed:
Script18.groovy: 1: unexpected token: < @ line 1, column 1.
   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
   ^

1 error

MissingMethodException: No signature of method: org.codehaus.groovy.jsr223.Groov
yScriptEngineImpl.sendGmail() is applicable for argument types: (java.util.Linke
dHashMap) values: [[subject:[FileBot] xxxxxxx, message:<html>
................
shows all the info from the cells it's trying to create in the table that I'd like to get emailed to me (that I never messed with btw), only thing I did at all with the email is tried calling the script from utorrent with my username and password provided like others have shown and I added the fn part to the include lib/ant because it was trying to look locally, I guess since I'm running a local file to try get the naming format I want.
................
        at Script3.run(Script3.groovy:206)
        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)

Thanks so much in advance.
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Utorrent script help please

Post by rednoah »

1. This a simple example for what you said:

Code: Select all

def url = new URL('http://filebot.sourceforge.net/screenshots/medium/panel.rename.png')
def data = url.fetch()
data.saveAs('E:/f1.png')
data.saveAs('E:/f2.png')
2. Not sure about the timeouts, never had that. In anycase even if there's a timeout it shouldn't case the script to break, it'll just print error output.
:idea: Please read the FAQ and How to Request Help.
part timer
Posts: 181
Joined: 09 May 2012, 23:35

Re: Utorrent script help please

Post by part timer »

I'm starting to experiment and tweak the utorrent script for me and I'm really liking it so far. I have it moving files in strict mode, so it ignores the ones it's not 100% of. Awesome, BUT then if I try to run the script standalone after with non-strict it's usually good, but sometimes makes mistakes. What I really would like is to be able to modify the command line script to have a window popup like it does with the artwork script when it's not sure and let you pick.

I've tried editing the script myself by cutting and pasting from the artwork script, and it runs with no errors, but still just autodetects and doesn't popup like I'm trying to accomplish. :(

I tried:

Code: Select all

def query = f(videos[0], false) as String
        def options = TheMovieDB.searchMovie(query, _args.locale)
        }
	options = options.sortBySimilarity(query, { it.name })
	def mov = options[0]
	if (options.size() != 1 && !_args.nonStrict && !java.awt.GraphicsEnvironment.headless) {
		mov = javax.swing.JOptionPane.showInputDialog(null, "Please select Movie:", dir.path, 3, null, options.toArray(), mov);
		if (mov == null) return null
	}
        
Instead of this

Code: Select all

def mov = detectMovie(f, false)
	
Sound easy to you?
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Utorrent script help please

Post by rednoah »

Basically you have to do two things:
1. Run a search for a given query
2. Pick one of the results

Now the popup dialog is invoked with javax.swing.JOptionPane, everything else is just extra logic, e.g. Skip popups in headless mode or non-strict mode. Since you want non-strict with popups you need to change the condition.

You can test these things line by line until you understand how it works. If you do everything at once it's very hard to debug, more efficient to do things step by step.
:idea: Please read the FAQ and How to Request Help.
Post Reply