Update of /cvsroot/freevo/freevo/src/util
In directory sc8-pr-cvs1:/tmp/cvs-serv3736

Modified Files:
        fxdimdb.py 
Log Message:
looks like imdb changed the interface again

Index: fxdimdb.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/util/fxdimdb.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** fxdimdb.py  9 Jan 2004 06:30:49 -0000       1.2
--- fxdimdb.py  9 Jan 2004 19:49:04 -0000       1.3
***************
*** 12,15 ****
--- 12,18 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.3  2004/01/09 19:49:04  dischi
+ # looks like imdb changed the interface again
+ #
  # Revision 1.2  2004/01/09 06:30:49  outlyer
  # Two fixes:
***************
*** 161,166 ****
              response = urllib2.urlopen(req)
          except urllib2.HTTPError, error:
              raise FxdImdb_Net_Error("IMDB unreachable : " + error) 
-             return None
              
          regexp_get_imdb_id = re.compile(r'''
--- 164,169 ----
              response = urllib2.urlopen(req)
          except urllib2.HTTPError, error:
+             print 'Oops'
              raise FxdImdb_Net_Error("IMDB unreachable : " + error) 
              
          regexp_get_imdb_id = re.compile(r'''
***************
*** 180,218 ****
              return self.imdb_id_list
          
!         regexp_type  = re.compile(r'''
!         <H2><A[ ]NAME=.*?>
!         (?P<type>.*?)     # Most popular searches/Movies/TV-Movies/Video Games etc.
!         </A></H2>
!         ''', re.VERBOSE)
! 
!         regexp_imdb_list_entry = re.compile(r'''
!         <LI><A[ ]HREF="/(?:Title\?|title/tt)  # match both old and new style 
!         (?P<id>      \d+)/">                  # imdb id
!         (?P<title>   .*?)\s*                  # imdb movie title
!         \(
!         (?P<year>    \d{4}.*?)                # year and possibly /I, /II etc.
!         \)</A>
!         ''', re.VERBOSE)
  
-         type = ''
          for line in response.read().split("\n"):
              m = regexp_type.match(line)
              if m:
!                 type = m.group('type')
!                 # delete plural s
!                 if type in ('Movies', 'TV-Movies'):
!                     type = type[:-1]
!     
!             m = regexp_imdb_list_entry.search(line)
! 
!             if m and not type == 'Video Games':
!                 id   = m.group('id')
!                 name = m.group('title')
!                 year = m.group('year')
!     
                  # delete " before and after name
                  if name[0] == '"' and name [-1] == '"':
                      name=name[1:-1]
!     
                  # only add entries that hasn't been added before
                  for i in self.imdb_id_list:
--- 183,204 ----
              return self.imdb_id_list
          
!         regexp_type  = re.compile('.*<tr><td valign="top" align="right">'+
!                                   '.*/title/tt(\d+)/">(.*)\((\d{4})\)(.*)</a>')
  
          for line in response.read().split("\n"):
+             line = line.replace('&#34;', '"')
              m = regexp_type.match(line)
              if m:
!                 #print line
!                 id, name, year, info = m.groups(0)
!                 name = name.strip().rstrip()
!                 type = ''
                  # delete " before and after name
                  if name[0] == '"' and name [-1] == '"':
+                     type = 'TV Show'
                      name=name[1:-1]
!                 elif info.find('(TV)') != -1:
!                     type = 'TV Movie'
!                     
                  # only add entries that hasn't been added before
                  for i in self.imdb_id_list:
***************
*** 290,294 ****
              except: 
                  pass
!         else: self.append = False
  
          # XXX: add this back in without using parseMovieFile
--- 276,281 ----
              except: 
                  pass
!         else:
!             self.append = False
  
          # XXX: add this back in without using parseMovieFile




-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to