2017-05-29, 14:24
(2017-05-26, 22:14)bsoriano Wrote: Here is what I did to get it to work using my apikey:
1. go to the folder script.imdbupdate/resources/lib
2. Edit the file imdbMovie.py
3. Around line 24 (at least that is the line number for me, using Notepad++), you will find a line like this: url="http://omdbapi.com/?i=%s" % self.__imdbID
4. Change it to look like this: url="http://omdbapi.com/?i=%s&apikey=xxxxxxxx" % self.__imdbID
5. Save the file.
I finally got my api key last night. Went to edit imdbMovie.py, but there is no line as described in your instructions. As a matter of fact there isn't any reference to omdb at all.
Code:
################
# IMDB Update #
# by Jandalf #
################
import httplib, socket, json
class imdbMovie(object):
def __init__(self, imdbID, httphandler):
self.__rating = ""
self.__votes = ""
self.__error = False
self.__imdbID = imdbID
self.getData(httphandler)
def getData(self, httphandler):
try:
httphandler.request("GET", "/?i=%s" % self.__imdbID)
response = httphandler.getresponse()
except (httplib.HTTPException, socket.timeout, socket.gaierror, socket.error):
self.__error = True
else:
if response.status == 200:
try:
data = json.loads(response.read().decode('utf8'))
if "error" in data or data["Response"] == "False":
self.__error = True
else:
self.__rating = data["imdbRating"]
self.__votes = str(data["imdbVotes"])
except:
self.__error = True
else:
self.__error = True
def rating(self): return self.__rating
def votes(self): return self.__votes
def error(self): return self.__error
def imdbID(self): return self.__imdbID
Did I miss an update or something?
Edit: DID miss an update. Went back through the last couple of pages and found the dropbox link posted by bsoriano (thanks Bart).