[RELEASE] IMDB Ratings for Movies

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
frumpsnake Offline
Junior Member
Posts: 20
Joined: Feb 2012
Reputation: 0
Post: #46
I hate to ask a stupid question but isn't it easier to just enable 'Get Movie Rating from IMDb' in the standard MovieDB scraper?
find quote
Eisi2005 Offline
Fan
Posts: 705
Joined: Feb 2011
Reputation: 1
Location: Germany
Post: #47
@cosmicr

i have updated to xbmc eden beta3. I´m using openelec latest beta and i become this error in debug log:

08:37:01 T:2951740224 NOTICE: -->Python Interpreter Initialized<--
08:37:01 T:2951740224 DEBUG: Process - The source file to load is /storage/.xbmc/addons/script.imdbratings/default.py
08:37:01 T:2951740224 DEBUG: Process - Setting the Python path to /storage/.xbmc/addons/script.imdbratings:/usr/share/xbmc/addons/script.module.simplejson/lib:/usr/share/xbmc/addons/script.module.pil/lib:/storage/.xbmc/addons/script.module.elementtree/lib:/usr/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg:/usr/lib/python2.7/site-packages/simplejson-2.1.6-py2.7-linux-i686.egg:/usr/lib/python2.7/site-packages/configobj-4.7.2-py2.7.egg:/usr/lib/python27.zip:/usr/lib/python2.7:/usr/lib/python2.7/plat-linux2:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload:/usr/lib/python2.7/site-packages:/usr/lib/python2.7/site-packages/PIL:/usr/lib/python2.7/site-packages/gtk-2.0:
08:37:01 T:2951740224 DEBUG: Process - Entering source directory /storage/.xbmc/addons/script.imdbratings
08:37:01 T:2951740224 DEBUG: Instantiating addon using automatically obtained id of "script.imdbratings" dependent on version 1.0 of the xbmc.python api
08:37:03 T:2951740224 NOTICE: IMDB Rating Script: Database type is set to SQLite
08:37:03 T:2951740224 INFO: -->Python script returned the following error<--
08:37:03 T:2951740224 ERROR: Error Type: <type 'exceptions.ImportError'>
08:37:03 T:2951740224 ERROR: Error Contents: libmysqlclient_r.so.16: cannot open shared object file: No such file or directory
08:37:03 T:2951740224 ERROR: Traceback (most recent call last):
File "/storage/.xbmc/addons/script.imdbratings/default.py", line 61, in <module>
import MySQLdb as mdb
File "/storage/.xbmc/addons/script.imdbratings/resources/lib/MySQLdb/__init__.py", line 19, in <module>
import _mysql
ImportError: libmysqlclient_r.so.16: cannot open shared object file: No such file or directory
08:37:03 T:2951740224 INFO: -->End of Python script error report<--

@frumpsnake
this addon renew the ratings from movies which are in your libary. The Get Movie from function is for first scan only. But the ratings change from day to day.

Greets
Eisi
find quote
Eisi2005 Offline
Fan
Posts: 705
Joined: Feb 2011
Reputation: 1
Location: Germany
Post: #48
@cosmicr

could you take a look at my log files ? Post before this is from a linux os with xbmc b3 and this logfile is from win7 with xbmc b3. Something is wrong with getting the database.

22:21:31 T:7132 INFO: -->Python script returned the following error<--
22:21:31 T:7132 ERROR: Error Type: <type 'exceptions.ValueError'>
22:21:31 T:7132 ERROR: Error Contents: invalid literal for int() with base 10: 'SQLite'
22:21:31 T:7132 ERROR: Traceback (most recent call last):
File "C:\Users\AdminEisi2005\AppData\Roaming\XBMC\addons\script.imdbratings\default.py​", line 46, in <module>
MySQL = int(Addon.getSetting("database"))
ValueError: invalid literal for int() with base 10: 'SQLite'
22:21:31 T:7132 INFO: -->End of Python script error report<--
22:21:31 T:7132 INFO: Python script stopped

Greets
Eisi
find quote
cosmicr Offline
Senior Member
Posts: 156
Joined: Oct 2010
Reputation: 1
Location: Australia
Post: #49
Hi Eisi2005, I'm not 100% sure but it appears I may have made a mistake in getting settings from the config file. I'm assuming others may have had this problem too, I'll look into it and try to get an update posted in the next day or so.

I didn't do a lot of testing on other systems, all I know is it worked on my machine Tongue

I've got a few machines so I'll test it a bit more thoroughly...

@frumpsnake:
Two reasons, when I started this addon the inbuilt scraper only got the rating from themoviedb, but now this addon is useful to update an already existing library.
find quote
Eisi2005 Offline
Fan
Posts: 705
Joined: Feb 2011
Reputation: 1
Location: Germany
Post: #50
@cosmicr

thx for working on it.

If you need someone to test, gibe me the files to change and i will test it for you.

I have one win7 64 bit with b3 and one linux (openelec) with b3.

Greets
Eisi
find quote
Eisi2005 Offline
Fan
Posts: 705
Joined: Feb 2011
Reputation: 1
Location: Germany
Post: #51
@cosmicr

i don´t wont to nerv you, but is there anything i could do to test myself in your settings. something that i put the directory to my database manuel ?

Greets
Eisi
find quote
Eisi2005 Offline
Fan
Posts: 705
Joined: Feb 2011
Reputation: 1
Location: Germany
Post: #52
@cosmicr

did you found any time to look in your script ?

Greets
Eisi
find quote
tinybutstrong Offline
Fan
Posts: 331
Joined: Sep 2010
Reputation: 0
Post: #53
Yeah, I get a similar error:

Code:
14:30:31 T:3760  NOTICE: -->Python Interpreter Initialized<--
14:30:32 T:3760  NOTICE: Service: 4804 actors took 0.35500001907348633
14:30:55 T:7324   ERROR: Control 1 in window 10099 has been asked to focus, but it can't
14:31:09 T:6440 WARNING: XFILE::CFileFactory::CreateLoader - Unsupported protocol(addons) in addons://more/executable.tbn
14:31:11 T:7332  NOTICE: -->Python Interpreter Initialized<--
14:31:11 T:7332  NOTICE: IMDB Rating Script: Database type is set to SQLite
14:31:11 T:7332   ERROR: Error Type: <type 'exceptions.ImportError'>
14:31:11 T:7332   ERROR: Error Contents: No module named _mysql
14:31:11 T:7332   ERROR: Traceback (most recent call last):
                                              File "C:\XBMC\portable_data\addons\script.imdbratings\default.py", line 61, in <module>
                                                import MySQLdb as mdb
                                              File "C:\XBMC\portable_data\addons\script.imdbratings\resources/lib\MySQLdb\__init__.py", line 19, in <module>
                                                import _mysql
                                            ImportError: No module named _mysql

I'm not using MySQL.

I wish to have Rotten Tomatoes (user+critics) + IMDB both ratings display in skin.
find quote
cosmicr Offline
Senior Member
Posts: 156
Joined: Oct 2010
Reputation: 1
Location: Australia
Post: #54
hi all, sorry I disappeared off the face of the earth, but I have been very busy with other things.

I don't have time to fix the problem, but it looks like I got too hasty in testing mysql and stuffed up the check between sqlite and mysql at the start (so it's always trying mysql even if you have sqlite).

If someone wants to fix it, check the source on my git page, it shouldn't take too much to fix.
find quote
dvbtjunkie Offline
Junior Member
Posts: 10
Joined: Apr 2010
Reputation: 0
Location: Germany
Post: #55
Hey nice Script,
probably i found a Bug.
I don't know why, but some movies in my database have a wrong IMDBID.

for example:

Armored have a numeric ID 0913354 but need that ID tt0913354

The Script fails to open the wrong IMDB Site : http://www.imdb.com/title/0913354/

It is possible to add in your Code a ID Check like that:

If 'tt' in num:
Try Base_URL + num
else:
Base_URL + "tt" + num

Sorry I'm a python newbie my language is VBScript..

Thanks

This is not my Solution to solve my IMDBID Problem in my database but it makes the script run.
or
It's a remote possibility to help me to change all wrong IMDBID in my Database... Big Grin
find quote
zosky Offline
Donor
Posts: 304
Joined: Dec 2008
Reputation: 1
Location: toronto. canada
Post: #56
(2012-04-28 23:54)cosmicr Wrote:  hi all, sorry I disappeared off the face of the earth, but I have been very busy with other things.

I don't have time to fix the problem, but it looks like I got too hasty in testing mysql and stuffed up the check between sqlite and mysql at the start (so it's always trying mysql even if you have sqlite).

If someone wants to fix it, check the source on my git page, it shouldn't take too much to fix.

Respect !! life happens. thanks for telling us.

for the record, i am using mySQL and it seems borked too Sad

is it telling me to levelUP my elves ?

Code:
23:12:26 T:139800489211648    INFO: -->Python script returned the following error<--
23:12:26 T:139800489211648   ERROR: Error Type: <type 'exceptions.ImportError'>
23:12:26 T:139800489211648   ERROR: Error Contents: /home/zosky/.xbmc/addons/script.imdbratings/resources/lib/_mysql.so: wrong ELF class: ELFCLASS32
23:12:26 T:139800489211648   ERROR: Traceback (most recent call last):
                                              File "/home/zosky/.xbmc/addons/script.imdbratings/default.py", line 61, in <module>
                                                import MySQLdb as mdb
                                              File "/home/zosky/.xbmc/addons/script.imdbratings/resources/lib/MySQLdb/__init__.py", line 19, in <module>
                                                import _mysql
                                            ImportError: /home/zosky/.xbmc/addons/script.imdbratings/resources/lib/_mysql.so: wrong ELF class: ELFCLASS32
23:12:26 T:139800489211648    INFO: -->End of Python script error report<--
23:12:26 T:139800489211648    INFO: Python script stopped

eight xbmc devices mostly openElec
atom/ion | iphone4 | hpTouchPad | raspberryPI ...
central mySQL db ( +20TB NAS ) +maraschino +IRtoy.v2 +yatse
[Image: widget]
find quote
dvbtjunkie Offline
Junior Member
Posts: 10
Joined: Apr 2010
Reputation: 0
Location: Germany
Post: #57
(2012-07-06 00:26)dvbtjunkie Wrote:  Hey nice Script,
probably i found a Bug.
I don't know why, but some movies in my database have a wrong IMDBID.

for example:

Armored have a numeric ID 0913354 but need that ID tt0913354

The Script fails to open the wrong IMDB Site : http://www.imdb.com/title/0913354/

It is possible to add in your Code a ID Check like that:

If 'tt' in num:
Try Base_URL + num
else:
Base_URL + "tt" + num

Sorry I'm a python newbie my language is VBScript..

Thanks

This is not my Solution to solve my IMDBID Problem in my database but it makes the script run.
or
It's a remote possibility to help me to change all wrong IMDBID in my Database... Big Grin

Database problem solved:

Edit with SQLLiteExplorer : http://wiki.xbmc.org/index.php?title=HOW...base-files

Statement: UPDATE movie SET c09 = "tt" || c09 WHERE c09 not like 'tt%';
find quote
papampi Offline
Senior Member
Posts: 171
Joined: Feb 2005
Reputation: 0
Post: #58
I get error and script failed !!!

debug :
Code:
17:33:42 T:2595224384  NOTICE: -->Python Interpreter Initialized<--
17:33:42 T:2595224384   DEBUG: Process - The source file to load is /home/payam/.xbmc/addons/script.imdbratings/default.py
17:33:42 T:2595224384   DEBUG: Process - Setting the Python path to /home/payam/.xbmc/addons/script.imdbratings:/home/payam/.xbmc/addons/script.module.xbmcswift/lib:/home/payam/.xbmc/addons/script.module.simplejson/lib:/home/payam/.xbmc/addons/script.module.myconnpy/lib:/home/payam/.xbmc/addons/script.module.beautifulsoup/lib:/usr/share/xbmc/addons/script.module.pil/lib:/home/payam/.xbmc/addons/script.common.plugin.cache/lib:/home/payam/.xbmc/addons/script.module.simple.downloader/lib:/home/payam/.xbmc/addons/script.module.parsedom/lib:/home/payam/.xbmc/addons/script.module.elementtree/lib:/usr/share/xbmc/addons/script.module.pysqlite/lib:/usr/lib/python2.7:/usr/lib/python2.7/plat-linux2:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload:/usr/local/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages/PIL:/usr/lib/python2.7/dist-packages/gst-0.10:/usr/lib/python2.7/dist-packages/gtk-2.0:/usr/lib/pymodules/python2.7:/usr/lib/python2.7/dist-packages/ubuntu-sso-client:/usr/lib/python2.7/dist-packages/ubuntuone-client:/usr/lib/python2.7/dist-packages/ubuntuone-control-panel:/usr/lib/python2.7/dist-packages/ubuntuone-couch:/usr/lib/python2.7/dist-packages/ubuntuone-installer:/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol:/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode:
17:33:42 T:2595224384   DEBUG: Process - Entering source directory /home/payam/.xbmc/addons/script.imdbratings
17:33:42 T:2595224384   DEBUG: Instantiating addon using automatically obtained id of "script.imdbratings" dependent on version 1.0 of the xbmc.python api
17:33:42 T:2595224384  NOTICE: IMDB Rating Script: Database type is set to MySQL
17:33:42 T:2595224384  NOTICE: IMDB Rating Script: MySQL Server Address is 192.168.1.14
17:33:42 T:2595224384    INFO: Loading skin file: DialogYesNo.xml
17:33:42 T:3015259904   DEBUG: ------ Window Init (DialogYesNo.xml) ------
17:33:42 T:3015259904   DEBUG: ------ Window Init (DialogKaiToast.xml) ------
17:33:45 T:2682678080   DEBUG: JSONRPC Server: New connection detected
17:33:45 T:2682678080    INFO: JSONRPC Server: New connection added
17:33:53 T:3015259904   DEBUG: ------ Window Deinit (DialogKaiToast.xml) ------
17:33:53 T:3015259904   DEBUG: SDLKeyboard: scancode: 71, sym: 0114, unicode: 0000, modifier: 1000
17:33:53 T:3015259904   DEBUG: OnKey: left (f082) pressed, action is Left
17:33:54 T:3015259904   DEBUG: SDLKeyboard: scancode: 24, sym: 000d, unicode: 000d, modifier: 1000
17:33:54 T:3015259904   DEBUG: OnKey: return (f00d) pressed, action is Select
17:33:54 T:3015259904   DEBUG: ------ Window Deinit (DialogYesNo.xml) ------
17:33:54 T:2595224384    INFO: -->Python script returned the following error<--
17:33:54 T:2595224384   ERROR: Error Type: <type 'exceptions.ImportError'>
17:33:54 T:2595224384   ERROR: Error Contents: libmysqlclient_r.so.16: cannot open shared object file: No such file or directory
17:33:54 T:2595224384   ERROR: Traceback (most recent call last):
                                              File "/home/payam/.xbmc/addons/script.imdbratings/default.py", line 61, in <module>
                                                import MySQLdb as mdb
                                              File "/home/payam/.xbmc/addons/script.imdbratings/resources/lib/MySQLdb/__init__.py", line 19, in <module>
                                                import _mysql
                                            ImportError: libmysqlclient_r.so.16: cannot open shared object file: No such file or directory
17:33:54 T:2595224384    INFO: -->End of Python script error report<--
17:33:54 T:2595224384    INFO: Python script stopped

any idea how to slove this error ?

Proud xbmp/xbmc user since early days of 1st gen xbox

XBMC on :
Tronsmart S89 Quad Core - AMLinux
Atv1 + Crystall HD - Crystalbuntu
Raspberry Pi - Openelec
Xios DS - Linux the-hydra
1st gen xbox, JB Atv2, Ouya, ...
find quote
dvbtjunkie Offline
Junior Member
Posts: 10
Joined: Apr 2010
Reputation: 0
Location: Germany
Star  RE: [RELEASE] IMDB Ratings for Movies
Post: #59
@ cosmicr
i love your script,
it is possible to get a upgrade to Frodo?
After Upgrade my XBMC to Frodo, it is impossible to install Undecided
Thx a lot
find quote
hop6919 Offline
Junior Member
Posts: 13
Joined: Feb 2012
Reputation: 0
Post: #60
I've written a small .net app that refreshes the IMDB score in XBMC by scraping the IMDB site directly. It works with Frodo and either the local SQLite database or the shared MySQL library. Here's the link:

https://bitbucket.org/sstanford/imdb-sco...c/overview

It's only for the films I'm afraid. It also doesnt update the .nfo files - but these can be updated by exporting the video library in XBMC and overwriting in the normal way.
(This post was last modified: 2014-01-28 12:51 by hop6919.)
find quote
Post Reply