diff --git a/tvrage/api.py b/tvrage/api.py index 0e504a9..0a19215 100644 --- a/tvrage/api.py +++ b/tvrage/api.py @@ -115,8 +115,8 @@ class Show(object): """represents a TV show description from tvrage.com this class is kind of a wrapper around the following of tvrage's xml feeds: - * http://www.tvrage.com/feeds/search.php?show=SHOWNAME - * http://www.tvrage.com/feeds/episode_list.php?sid=SHOWID + * http://services.tvrage.com/feeds/search.php?show=SHOWNAME + * http://services.tvrage.com/feeds/episode_list.php?sid=SHOWID """ def __init__(self, name): @@ -158,7 +158,7 @@ def __init__(self, name): snum = int(season.attrib['no']) except KeyError: pass # TODO: adding handeling for specials and movies - # bsp: http://www.tvrage.com/feeds/episode_list.php?sid=3519 + # bsp: http://services.tvrage.com/feeds/episode_list.php?sid=3519 else: self.episodes[snum] = Season() for episode in season: diff --git a/tvrage/feeds.py b/tvrage/feeds.py index c144533..d5a8e25 100644 --- a/tvrage/feeds.py +++ b/tvrage/feeds.py @@ -34,7 +34,7 @@ import xml.etree.ElementTree as et -BASE_URL = 'http://www.tvrage.com/feeds/%s.php?%s=%s' +BASE_URL = 'http://services.tvrage.com/feeds/%s.php?%s=%s' def _fetch_xml(url, node=None): diff --git a/tvrage/quickinfo.py b/tvrage/quickinfo.py index dca9715..7f6b419 100644 --- a/tvrage/quickinfo.py +++ b/tvrage/quickinfo.py @@ -28,8 +28,7 @@ from urllib2 import urlopen, URLError, quote from util import _fetch from exceptions import ShowNotFound - -BASE_URL = 'http://services.tvrage.com/tools/quickinfo.php' +s/tools/quickinfo.php' def fetch(show, exact=False, ep=None): @@ -45,7 +44,20 @@ def fetch(show, exact=False, ep=None): else: data = resp.replace('
', '').splitlines()
         for line in data:
-            k, v = line.split('@')
+      ne in data:
+            try:
+                if '@@' in line:
+                    line = line.replace('@@','@')
+                    k, v = line.split('@')
+                    v = '@' + v
+                else:
+                    k, v = line.split('@')
+
+            except ValueError, err:
+
+                except ValueError, err: #"Ended@"
+                    k = line.replace('@',"")
+                    v = ""
             # TODO: use datetimeobj for dates
             show_info[k] = (v.split(' | ') if ' | ' in v else
                             (v.split('^') if '^' in v else v))
diff --git a/tvrage/util.pyc b/tvrage/util.pyc
new file mode 100644
index 0000000..53973d3
Binary files /dev/null and b/tvrage/util.pyc differ