diff options
author | Luo Jinghua <sunmoon1997@gmail.com> | 2009-12-27 09:39:48 +0800 |
---|---|---|
committer | Luo Jinghua <sunmoon1997@gmail.com> | 2009-12-27 09:39:48 +0800 |
commit | 113c126e1c2b1744928293c54ff871eb2650d867 (patch) | |
tree | 3d922b4ae3b1541970c2a78a53f4302fe95dbf63 | |
parent | 90d11c2d427a2deb803733031f7153c4e5d2cb0f (diff) |
ppslist: fixed area parsing
-rw-r--r-- | totem/plugin/ppslist.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/totem/plugin/ppslist.py b/totem/plugin/ppslist.py index 515b375..5aff637 100644 --- a/totem/plugin/ppslist.py +++ b/totem/plugin/ppslist.py @@ -206,6 +206,12 @@ class PPSMovie: result = {}.fromkeys(result).keys() return result + def parse_area (self, node): + area = unicode(extractString(node.contents[-1]), 'utf-8') + if area.find (u':') >= 0: + area = area[area.find(u':') + 1:] + return area.encode('utf-8') + def parse (self, node): self.files = [] self.pixbuf = None @@ -217,7 +223,7 @@ class PPSMovie: self.cn = extractNumber(dt.contents[-1], 1) self.playerurl = KANPPS + extractString(dt.find('a')['href']) li = node.findAll('li') - self.area = extractString(li[0].find('span').contents[-1]) + self.area = self.parse_area(li[0].find('span')) self.pubtime = extractString(li[0].contents[-1]) self.actor = ', '.join(self.parse_actors(li[1])) self.desc = extractString(li[2].contents[-1]) |