Author: duncan
Date: Fri Feb 23 21:42:22 2007
New Revision: 9261

Modified:
   branches/rel-1/freevo/src/util/fxdimdb.py

Log:
Fixes for changes to imdb html data
Patch Christian Aistleitner applied
Also updated call to translate xml entities


Modified: branches/rel-1/freevo/src/util/fxdimdb.py
==============================================================================
--- branches/rel-1/freevo/src/util/fxdimdb.py   (original)
+++ branches/rel-1/freevo/src/util/fxdimdb.py   Fri Feb 23 21:42:22 2007
@@ -600,7 +600,8 @@
             print "Unicode error; check that /usr/lib/python2.x/site.py has 
the correct default encoding"
             pass
 
-        title = soup.find('strong', {'class':'title'})
+        #title = soup.title
+        title = soup.find('h1')
         image = soup.find('img', { 'title':title.next.strip() })
 
         self.title = title.next.strip()
@@ -633,16 +634,16 @@
         self.info['genre'] = ''
         genre=soup.find(text='Genre:').parent
         genres = []
-        while genre.findNextSibling('a').string != '(more)':
+        while genre.findNextSibling('a').string != 'more':
             genres.append(genre.findNextSibling('a').string.strip())
             genre=genre.findNextSibling('a')
         self.info['genre'] = genres[0]
         for i in genres[1:]:
             self.info['genre'] += ' / ' + i
-        rating = soup.find(text='User Rating:').parent.findNextSibling('b')
+        rating = soup.find(text='User 
Rating:').findNext(text=re.compile('/10'))
         if rating:
-            votes = rating.next.next.strip()
-            self.info['rating'] = rating.string.strip() + ' ' + votes.strip()
+            votes = rating.findNext('a')
+            self.info['rating'] = rating.strip() + ' (' + votes.string.strip() 
+ ')'
         else:
             self.info['rating'] = ''
         runtime = soup.find(text='Runtime:')

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to