summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuo Jinghua <sunmoon1997@gmail.com>2010-11-12 13:42:18 +0800
committerLuo Jinghua <sunmoon1997@gmail.com>2010-11-12 13:42:18 +0800
commit64456b89c708bc5e2f64276e0cb48c3a7ed75660 (patch)
tree36084ff6cfd5a662e56c7fd72e42a91c887b05ea
parent6c2bb0fa0cd94c24f142baef540c11e068e075e0 (diff)
ppslist: fixed parsing search result
-rw-r--r--totem/plugin/ppslist.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/totem/plugin/ppslist.py b/totem/plugin/ppslist.py
index 6096fba..322a0a4 100644
--- a/totem/plugin/ppslist.py
+++ b/totem/plugin/ppslist.py
@@ -241,9 +241,16 @@ class PPSMovie:
self.playerurl = KANPPS + extractString(dt.find('a')['href'])
li = node.findAll('li')
span = li[0].find('span')
- if span.contents[-1]:
- self.area = self.parse_area(span.contents[-1])
- self.pubtime = extractString(li[0].contents[-1].contents[-1])
+ if span:
+ href = span.find('a')
+ if href:
+ self.area = self.parse_area(span.contents[-1])
+ else:
+ self.area = self.parse_area(span)
+ if type(li[0].contents[-1]) == BeautifulSoup.NavigableString:
+ self.pubtime = extractString(li[0].contents[-1])
+ else:
+ self.pubtime = extractString(li[0].contents[-1].contents[-1])
self.actor = ', '.join(self.parse_actors(li[1]))
self.desc = extractString(li[2].contents[-1])
self.id = self.parseid(self.playerurl)