Kodi Community Forum
[RELEASE] IMDB Ratings for Movies - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151)
+---- Thread: [RELEASE] IMDB Ratings for Movies (/showthread.php?tid=92132)

Pages: 1 2 3 4 5 6 7


RE: [RELEASE] IMDB Ratings for Movies - dvbtjunkie - 2013-06-21

(2013-06-21, 15:07)shedrock Wrote: Here is the log:
http://xbmclogs.com/show.php?id=30288

Its the same Error, just edit the line in default.py and smile Big Grin

(2013-06-18, 23:30)dvbtjunkie Wrote:
(2013-06-18, 08:58)Jandalf Wrote:
(2013-06-18, 00:05)dvbtjunkie Wrote: @ cosmicr
Any ideas to fix the Problem?

change this line in default.py:
Code:
pDialog.update(percent,_('beginning_update'),movie['label'],_('rating')+rating)
to
Code:
pDialog.update(int(percent),_('beginning_update'),movie['label'],_('rating')+rating)

@ Jandalf
OMG, only a convert to Integer.... Thx a lot

Now it works fine... Big Grin

Big Grin lol

@Jandalf not only in openelec, i use the normal xbmcbuntu,
it seems like a linux issue


RE: [RELEASE] IMDB Ratings for Movies - shedrock - 2013-06-21

I have approx. 1200 movies

Thank you, it works great.


RE: [RELEASE] IMDB Ratings for Movies - shedrock - 2013-06-22

Is there any way I can add a command to a remote button or even in the context menu of the skin that I am using so that I can update the IMDB ratings for each movie separately?

The reason I ask is because it takes so long to go through my entire library.

Thanks
Shedrock


RE: [RELEASE] IMDB Ratings for Movies - Jandalf - 2013-06-23

(2013-06-22, 14:06)shedrock Wrote: Is there any way I can add a command to a remote button or even in the context menu of the skin that I am using so that I can update the IMDB ratings for each movie separately?

The reason I ask is because it takes so long to go through my entire library.

Thanks
Shedrock

as far as I know it is not possible to start an addon by keyboard input. But this addon: http://forum.xbmc.org/showthread.php?tid=107331 can run in background, maybe this is an option for you.


Re: RE: [RELEASE] IMDB Ratings for Movies - jayleekay - 2013-06-23

(2013-06-18, 08:58)Jandalf Wrote:
(2013-06-18, 00:05)dvbtjunkie Wrote: @ cosmicr
Any ideas to fix the Problem?

change this line in default.py:
Code:
pDialog.update(percent,_('beginning_update'),movie['label'],_('rating')+rating)
to
Code:
pDialog.update(int(percent),_('beginning_update'),movie['label'],_('rating')+rating)



Re: RE: [RELEASE] IMDB Ratings for Movies - jayleekay - 2013-06-23

Deleted


RE: [RELEASE] IMDB Ratings for Movies - shedrock - 2013-06-23

(2013-06-23, 19:59)Jandalf Wrote:
(2013-06-22, 14:06)shedrock Wrote: Is there any way I can add a command to a remote button or even in the context menu of the skin that I am using so that I can update the IMDB ratings for each movie separately?

The reason I ask is because it takes so long to go through my entire library.

Thanks
Shedrock

as far as I know it is not possible to start an addon by keyboard input. But this addon: http://forum.xbmc.org/showthread.php?tid=107331 can run in background, maybe this is an option for you.



Thanks


RE: [RELEASE] IMDB Ratings for Movies - SNA0815 - 2013-07-06

Can anyone help catching this socket timeout error?

Code:
18:03:40 T:2883466304   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <class 'socket.timeout'>
                                            Error Contents: timed out
                                            Traceback (most recent call last):
                                              File "/home/pi/.xbmc/addons/script.imdbratings/default.py", line 132, in <module>
                                                main()
                                              File "/home/pi/.xbmc/addons/script.imdbratings/default.py", line 104, in main
                                                imdbdata = simplejson.load(urllib2.urlopen(url))
                                              File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
                                                return _opener.open(url, data, timeout)
                                              File "/usr/lib/python2.7/urllib2.py", line 401, in open
                                                response = self._open(req, data)
                                              File "/usr/lib/python2.7/urllib2.py", line 419, in _open
                                                '_open', req)
                                              File "/usr/lib/python2.7/urllib2.py", line 379, in _call_chain
                                                result = func(*args)
                                              File "/usr/lib/python2.7/urllib2.py", line 1211, in http_open
                                                return self.do_open(httplib.HTTPConnection, req)
                                              File "/usr/lib/python2.7/urllib2.py", line 1184, in do_open
                                                r = h.getresponse(buffering=True)
                                              File "/usr/lib/python2.7/httplib.py", line 1034, in getresponse
                                                response.begin()
                                              File "/usr/lib/python2.7/httplib.py", line 407, in begin
                                                version, status, reason = self._read_status()
                                              File "/usr/lib/python2.7/httplib.py", line 365, in _read_status
                                                line = self.fp.readline()
                                              File "/usr/lib/python2.7/socket.py", line 447, in readline
                                                data = self._sock.recv(self._rbufsize)
                                            timeout: timed out
                                            -->End of Python script error report<--



RE: [RELEASE] IMDB Ratings for Movies - Jandalf - 2013-07-06

(2013-07-06, 18:06)SNA0815 Wrote: Can anyone help catching this socket timeout error?

Code:
18:03:40 T:2883466304   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <class 'socket.timeout'>
                                            Error Contents: timed out
                                            Traceback (most recent call last):
                                              File "/home/pi/.xbmc/addons/script.imdbratings/default.py", line 132, in <module>
                                                main()
                                              File "/home/pi/.xbmc/addons/script.imdbratings/default.py", line 104, in main
                                                imdbdata = simplejson.load(urllib2.urlopen(url))
                                              File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
                                                return _opener.open(url, data, timeout)
                                              File "/usr/lib/python2.7/urllib2.py", line 401, in open
                                                response = self._open(req, data)
                                              File "/usr/lib/python2.7/urllib2.py", line 419, in _open
                                                '_open', req)
                                              File "/usr/lib/python2.7/urllib2.py", line 379, in _call_chain
                                                result = func(*args)
                                              File "/usr/lib/python2.7/urllib2.py", line 1211, in http_open
                                                return self.do_open(httplib.HTTPConnection, req)
                                              File "/usr/lib/python2.7/urllib2.py", line 1184, in do_open
                                                r = h.getresponse(buffering=True)
                                              File "/usr/lib/python2.7/httplib.py", line 1034, in getresponse
                                                response.begin()
                                              File "/usr/lib/python2.7/httplib.py", line 407, in begin
                                                version, status, reason = self._read_status()
                                              File "/usr/lib/python2.7/httplib.py", line 365, in _read_status
                                                line = self.fp.readline()
                                              File "/usr/lib/python2.7/socket.py", line 447, in readline
                                                data = self._sock.recv(self._rbufsize)
                                            timeout: timed out
                                            -->End of Python script error report<--

surround it with:
Code:
try:
            response = imdbdata = simplejson.load(urllib2.urlopen(url))
except:
            self.__error = True
or try my add-on (->sig)


RE: [RELEASE] IMDB Ratings for Movies - collaed - 2013-12-15

Hi,

I'm using OpenELEC based on XBMC 12.2, I had to change a returned type (cast) to be able to run.
On line 115:
#lognotify the user
percent = (float(numupdated)/len(movies))*100
pDialog.update(percent,_('beginning_update'),movie['label'],_('rating')+rating)

I had to change percent = to an int.
percent = (int(numupdated)/len(movies))*100

Some specific titles are causing issues, but at the moment, some of them can be traced to issues within the JSON passed by OMDB. I understand verbosity can be an issue, but for those, I had to put in
lognotify(movie['label'] + " is about to be checked http://www.omdbapi.com/?i=" + movie['imdbnumber'])
just at line 98 before the test of the imdb number.

Kind regards,

ECB


RE: [RELEASE] IMDB Ratings for Movies - matthuisman - 2014-01-21

Hi,

Very nice and handy script.
I have made a few updates that I think improve the script a bit

1) Instead of storing the last movie ID, it now stores a list of completed movie ID's
- This allows it to fail on movies and still retry them the next time the script runs (using the last id would skip these movies)

2) Dialog now shows the current movie / total (Updating rating for movie: 23/506)

3) Start dialog now always asks you to confirm to proceed with NUMBER of movies ("You are about to update 23 movies. Proceed?")

4) If the script fails on the movie, the dialog will update and display "Error: Skipping" for 2 seconds (it will also LOG the movie name)

5) Script can now handle a URL timeout to the API (instead of failing) - this will cause the above error, as will no IMDB rating being returned from API

6) Entire movie loop into TRY / EXCEPT block just in case of any unaccepted errors. The completed ID's are written after this block to ensure completed movies are always recorded.

7) Updated script version to 2.1

I have uploaded it HERE for anyone who is interested Smile
(Install the same way as the original (install from ZIP_=))

Thanks,

Matt


RE: [RELEASE] IMDB Ratings for Movies - cosmicr - 2014-01-22

great work matt! I really appreciate it, I don't get nearly enough time to work on this or check the forum to support users. I'd love it if you fork my github repo and send a pull request. keeps it nice and tidy for me Smile

I'll try to update the first post sometime soon with your update.


RE: [RELEASE] IMDB Ratings for Movies - wgstarks - 2014-01-22

(2014-01-21, 09:17)matthuisman Wrote: Hi,

Very nice and handy script.
I have made a few updates that I think improve the script a bit

1) Instead of storing the last movie ID, it now stores a list of completed movie ID's
- This allows it to fail on movies and still retry them the next time the script runs (using the last id would skip these movies)

2) Dialog now shows the current movie / total (Updating rating for movie: 23/506)

3) Start dialog now always asks you to confirm to proceed with NUMBER of movies ("You are about to update 23 movies. Proceed?")

4) If the script fails on the movie, the dialog will update and display "Error: Skipping" for 2 seconds (it will also LOG the movie name)

5) Script can now handle a URL timeout to the API (instead of failing) - this will cause the above error, as will no IMDB rating being returned from API

6) Entire movie loop into TRY / EXCEPT block just in case of any unaccepted errors. The completed ID's are written after this block to ensure completed movies are always recorded.

7) Updated script version to 2.1

I have uploaded it HERE for anyone who is interested Smile
(Install the same way as the original (install from ZIP_=))

Thanks,

Matt

Very nice. I like the way the script skips problem videos. I notice an oddity though. The script updated all videos starting with "1" thru the letter "D" then skipped to "M" thru "Z" then went back and updated the video ratings for the ones that had been skipped. Does the script order the scan based on old vs new maybe? I've been adding local trailers for all my videos because of problems streaming trailers from YouTube and it looks like all the videos that were skipped have just been "Refreshed" within the past week. Just an oddity that made me curious. I saved a debug log of this although I don't really think it's a bug since every video did get updated except one that was skipped to avoid the script failure.

Has this script been added to the official repo yet? Just wondering if I need to keep an eye out for updates.


RE: [RELEASE] IMDB Ratings for Movies - matthuisman - 2014-01-22

Hi,

I'm pretty sure the API returns the list in order from newest to oldest scanned in?
Code:
command='{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "params": {"properties" : ["rating", "imdbnumber", "votes", "top250", "year"] }, "id": 1}'
So, your newest movies scan in first.

I have just updated it so the list is reversed.
It makes more sense to start with older scanned in movies (older IMDB rating or using older scraper settings when scanned in)

DOWNLOAD LINK

Thanks,

Matt


RE: [RELEASE] IMDB Ratings for Movies - wgstarks - 2014-01-22

(2014-01-22, 09:59)matthuisman Wrote: Hi,

I'm pretty sure the API returns the list in order from newest to oldest scanned in?
Code:
command='{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "params": {"properties" : ["rating", "imdbnumber", "votes", "top250", "year"] }, "id": 1}'
So, your newest movies scan in first.

I have just updated it so the list is reversed.
It makes more sense to start with older scanned in movies (older IMDB rating or using older scraper settings when scanned in)

DOWNLOAD LINK

Thanks,

Matt

Thanks for the reply. Actually my newest movies scanned last with vs 2.1. Sort of. I have been doing "batch" refreshes to add local trailers to my db for the past several weeks. Remove the video from the db, clean, re-add the video folder with trailer, update db. Started with "A" and have worked thru "L" so far (slow process Smile). The scan started with videos that were added to the db perhaps a little more than a week ago then scanned the oldest ones and at the very end scanned the most recent (less than one week) entries.

This to me isn't really a big deal. I scan my entire library so the order doesn't really make much difference. The ability to bypass problem videos that were previously resulting in script failure is a major improvement. Just thought I'd provide a little feedback.

If you're interested in feature requests a automated scheduler would be nice. Monthly scans or something along that line.