Closed jkurelek closed 11 years ago
There was a change to the Api calls in CouchPotato. As such, this script was failing to get the imdb id / movie id.
This has been updated recently in dev branch.
Please switch to dev branch and test.
Ok. Just noticed you are using the windows build. If you have python installed you can use the source version on this repo, otherwise I'll try and create another build soon.
Alright thanks for clearing that up. I'll try the dev branch and post back here. Cheers
OK, tried both the dev and master branches and can't get passed the input args error
08:40:02|INFO ====================
08:40:02|INFO TorrentToMedia V8.4
08:40:02|INFO MAIN: Loading config from C:\TorrentToMediaPy\autoProcessMedia.cfg
08:40:02|ERROR MAIN: There was a problem loading variables
Traceback (most recent call last):
File "C:\TorrentToMediaPy\TorrentToMedia.py", line 287, in <module>
inputDirectory, inputName, inputCategory, inputHash, inputID = parse_args(clientAgent)
File "C:\TorrentToMediaPy\autoProcess\nzbToMediaUtil.py", line 357, in parse_args
return parseFunc(sys.argv)
File "C:\TorrentToMediaPy\autoProcess\nzbToMediaUtil.py", line 307, in parse_utorrent
inputDirectory = os.path.normpath(args[1])
IndexError: list index out of range
Now I'm likely chalking this one up to python noobness as I'm pretty new to all this. I have Python 2.7.5 installed. In switching from the windows build, I downloaded and unpacked the dev branch zip, updated its autoProcessMedia.cfg and pointed my utorrent at the new script.
utorrent Run Program:
C:\TorrentToMediaPy\TorrentToMedia.py "%D" "%N" "%L" "%I"
What am I doing wrong?
some versions of uTorrent fail to send the first parameter. so try
C:\TorrentToMediaPy\TorrentToMedia.py "%D" "%D" "%N" "%L" "%I"
see if this works.
if not Ill try and create a debug script that will print the args to show what is happening.
No dice on adding the extra "%D"
try switching to the newly created debugg branch (with the extra g at the end of debug... it's midnight here :P)
when called this should log all of the variables passed from utorrent.
Just to check here. You are calling the script from uTorrent and not just trying to manually execute this right?
That's correct..executing from uTorrent (v3.3.1 for Windows).
Ran the debugging branch:
10:23:37|INFO TorrentToMedia V8.4
10:23:37|INFO MAIN: Loading config from C:\nzbToMedia-debugg\autoProcessMedia.cfg
10:23:37|DEBUG arg 0 is: C:\nzbToMedia-debugg\TorrentToMedia.py
10:23:37|ERROR MAIN: There was a problem loading variables
Traceback (most recent call last):
File "C:\nzbToMedia-debugg\TorrentToMedia.py", line 287, in <module>
inputDirectory, inputName, inputCategory, inputHash, inputID = parse_args(clientAgent)
File "C:\nzbToMedia-debugg\autoProcess\nzbToMediaUtil.py", line 361, in parse_args
return parseFunc(sys.argv)
File "C:\nzbToMedia-debugg\autoProcess\nzbToMediaUtil.py", line 307, in parse_utorrent
inputDirectory = os.path.normpath(args[1])
IndexError: list index out of range
Looks like it only spit out arg 0 (and is that even suppose to be arg 0?).
As a reminder here is what I have for Run Program in uTorrent:
C:\nzbToMedia-debugg\TorrentToMedia.py "%D" "%N" "%L" "%I"
Yes, arg 0 is the first arg, and this is the full path/name of the script being run. All off the passed args are args 1, 2, 3 etc....
The issue here is that uTorrent doesn't appear to be passing any of the additional arguments. This is what I would expect to see if you just executed the script manually (try this to verify).
So this is an issue with the way uTorrent is calling the script.
Apparently if you right click on the tabs in uTorrent UI, you should be able to select/enable a logger tab. The log for uTorrent should show exactly what command is being called....
Also, if you haven't already, try restarting the uTorrent service
From my uTorrent log:
[2013-10-04 10:17:41] Executing: C:\nzbToMedia-debugg\TorrentToMedia.py "C:\Users\All\Downloads\Seeding\tv" "Its.Always.Sunny.in.Philadelphia.S09E05.HDTV.x264-ASAP.mp4" "tv" "15014D7FB2851FFACE9F8CC234E0020D8845B904"
This is really bizarre...
Thanks... That gives me more to go on... Perhaps it is something I broke.... I'll try adding debug printing elsewhere.
Could it be that the issue is with the script picking up the arguments and not with uTorrent? Reason I say this is because (besides the log showing the args getting passed) my uTorrent never had any problem passing arguments to the windows build (exe).
certainly possible. there are some environment differences between the compiled build and the python scripts.... or it could be that I made a change that has killed this function.
If you update to this latest version, this should log the environment variables at the first possible chance to see if these are reaching the script, but then not being passed correctly.
this might also help ensure the args are passed between functions...
Updated to latest (both commits) and tested:
17:51:59|INFO ====================
17:51:59|INFO TorrentToMedia V8.4
17:51:59|INFO MAIN: Loading config from C:\nzbToMedia-debugg\autoProcessMedia.cfg
17:51:59|DEBUG arg 0 is: C:\nzbToMedia-debugg\TorrentToMedia.py
17:51:59|DEBUG arg 0 is: C:\nzbToMedia-debugg\TorrentToMedia.py
17:51:59|ERROR MAIN: There was a problem loading variables
Traceback (most recent call last):
File "C:\nzbToMedia-debugg\TorrentToMedia.py", line 292, in <module>
inputDirectory, inputName, inputCategory, inputHash, inputID = parse_args(clientAgent, sys.argv)
File "C:\nzbToMedia-debugg\autoProcess\nzbToMediaUtil.py", line 361, in parse_args
return parseFunc(sys_args)
File "C:\nzbToMedia-debugg\autoProcess\nzbToMediaUtil.py", line 307, in parse_utorrent
inputDirectory = os.path.normpath(args[1])
IndexError: list index out of range
So the issue is that the variables are not getting to the script. This might actually be a limitation with python on windows. I believe RuudBurger had found that args couldn't be passed through the windows build of CouchPotato... But if you call
python script.py args
Then the args are passed, but
script.py args
Doesn't work...
Can you do a quick test for this?
Looks like the next step might be for me to just compile the dev branch for you to test that ;)
I'm not at my computer anymore but I'll do the test when I'm back home later tonight.
And hey, I wouldn't argue with a new windows build :)
V8.5 windows build available from wiki...
I tested, I can't reproduce any issues with passing args from command line... I am wondering if there is something funny with your uTorrent setup.... anyway, try the new build. it might be an incompatibility with uTorrent passing to py...
Alright I have updates on many fronts...
script.py arg
vs.
python script.py arg
made no difference. After doing some Googling I was able to figure out the problem that's been plaguing us the whole time: http://stackoverflow.com/questions/2640971/windows-is-not-passing-command-line-arguments-to-python-programs-executed-from-t As it turns out, upon installing python in windows, a setting in missing in the registry to allow passing arguments...lol kind of dumb eh?
Anyways it's all sorted out now. I've since tested with the py version of TorrentToMedia and its working great. Thank you very much Clinton for all your help, I really appreciate it. Cheers!
Ah... That would be why my testing seemed to work.... I have pyinstaller on my windows system (this is the package used to compile python to .exe) and I'm sure this would fix that registry issue.
Glad it is now working.
Closing this for now. Let me know if anything else pops up.
First off want to thank everyone for creating an awesome script.
Using TorrentToMedia to post-process movies from CPS downloaded using uTorrent and having a problem with the script determining the imdb ID. It hasn't worked since day one and a movie is only successfully post-processed if it came with an nfo.
TorrentToMedia
CPS
Any thoughts?