Wow thanks man!! I'll try it now
EDIT:
Ok I get this error:
Code:
18:57:42 T:5052 NOTICE: -->Python Interpreter Initialized<--
18:57:42 T:5052 NOTICE: [Rating Update] - Starting Rating Update v1.2.9
18:57:42 T:3980 NOTICE: Thread XBPyThread start, auto delete: false
18:57:42 T:3980 NOTICE: -->Python Interpreter Initialized<--
18:57:42 T:3980 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.IndentationError'>
Error Contents: ('unexpected indent', ('C:\\Users\\ShadowTek\\AppData\\Roaming\\XBMC\\addons\\script.ratingupdate\\resources\\lib\\ratings_all.py', 306, 9, '\t\t\t RawXbmcDb.execute( \'UPDATE movie SET c04="%s", c05="%s" c12="%s" WHERE c09="%s"\' % (votes, rating, mpaa, self.movie[1] ) )\n'))
IndentationError: ('unexpected indent', ('C:\\Users\\ShadowTek\\AppData\\Roaming\\XBMC\\addons\\script.ratingupdate\\resources\\lib\\ratings_all.py', 306, 9, '\t\t\t RawXbmcDb.execute( \'UPDATE movie SET c04="%s", c05="%s" c12="%s" WHERE c09="%s"\' % (votes, rating, mpaa, self.movie[1] ) )\n'))
-->End of Python script error report<--
My PHP file looks like this:
Code:
<?php
/*-------------------------*/
/* Rating Update */
/* by Max (m4x1m) Headroom */
/*-------------------------*/
require("../imdb/imdb.class.php");
if (isset ($_GET["mid"])) {
if (eregi("tt", $_GET["mid"])) $mid = eregi_replace("tt", "", $_GET["mid"]); else $mid = $_GET["mid"];
$movie = new imdb($mid);
if ($movie) echo '{"Rating":"'.$movie->rating().'","Votes":"'.$movie->votes().'","MPAA":"'.$movie->mpaa()['USA'].'","Response":"True"}'; else echo '{"Response":"False"}';
}
?>
and that one section of my ratings_all.py looks like this:
Code:
if get_data != "":
try:
decode = json.loads( get_data )
response = decode[u'Response']
except: response = "False"
if response == "True":
votes = decode[u'Votes']
if votes != "0":
rating_for_log = decode[u'Rating']
rating = decode[u'Rating'] + "00000"
mpaa = decode[u'MPAA']
RawXbmcDb.execute( 'UPDATE movie SET c04="%s", c05="%s" c12="%s" WHERE c09="%s"' % (votes, rating, mpaa, self.movie[1] ) )
xbmc.log( "[%s] - %s: %s %s %s %s %s" % ( __addonname__, normalize( self.movie[0] ), normalize( __language__(30120) ), str( rating_for_log ), normalize( __language__(30121) ), str( votes ), normalize( __language__(30122) ) ) )
self.updated = self.updated + 1
else: xbmc.log( "[%s] - %s: %s" % ( __addonname__, normalize( self.movie[0] ), normalize( __language__(30117).lower() ) ) )
else: xbmc.log( "[%s] - %s: %s" % ( __addonname__, normalize( self.movie[0] ), normalize( __language__(30118).lower() ) ) )
else: xbmc.log( "[%s] - %s: %s" % ( __addonname__, normalize( self.movie[0] ), normalize( __language__(30118).lower() ) ) )
Thanks again for the help