So this problem has returned.

I hadn't been actually using imdbpy in a while, but I think this is a
result of the rewrite that happened 2012-01-29


This seems to fix it.  I'm trying to make the code a bit more
resilient, but I'm not sure it needs it.  so you can probably simplify
as needed.

The show I was using to test was 0441718

Basically, every episode in the unknown season gets number -1.
Fortunately they're all still there in the 'episdode -1' key, so just
extract them.

diff -r 58ce09901775 imdb/parser/http/movieParser.py
--- a/imdb/parser/http/movieParser.py   Thu Jan 24 22:34:38 2013 +0100
+++ b/imdb/parser/http/movieParser.py   Thu Feb 07 23:52:54 2013 -0800
@@ -1486,6 +1486,14 @@
         try: selected_season = int(selected_season)
         except: pass
         nd = {selected_season: {}}
+        if 'episode -1' in data:
+          counter = 1
+          for episode in data['episode -1']:
+            while 'episode %d' % counter in data:
+              counter += 1
+            k = 'episode %d' % counter
+            data[k] = [episode]
+          del data['episode -1']
         for episode_nr, episode in data.iteritems():
             if not (episode and episode[0] and
                     episode_nr.startswith('episode ')):

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Imdbpy-help mailing list
Imdbpy-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/imdbpy-help

Reply via email to