def do_search(self, title, year, video_type):
try:
url = urlparse.urljoin(self.base_link, self.search_link)
url = url % urllib.quote_plus(cleantitle.query(title))
result = client.request(url)
result = client.parseDOM(result, 'div', attrs={'class': 'item'})
for row in result:
row_type = client.parseDOM(row, 'div', attrs={'class': 'typepost'})[0]
if row_type != video_type:
continue
names = client.parseDOM(row, 'span', attrs={'class': 'tt'})[0]
names = names.split('/')
year_found = client.parseDOM(row, 'span', attrs={'class': 'year'})
if self.name_matches(names, title, year) and (len(year_found) == 0 or year_found[0] == year):
url = client.parseDOM(row, 'a', ret='href')[0]
return urlparse.urljoin(self.base_link, url)
except :
return
评论列表
文章目录