@@ -0,0 +1,64 @@
1+## Subtitleseeker (Video)
2+#
3+# @website http://www.subtitleseeker.com
4+# @provide-api no
5+#
6+# @using-api no
7+# @results HTML
8+# @stable no (HTML can change)
9+# @parse url, title, content
10+
11+from cgi import escape
12+from urllib import quote_plus
13+from lxml import html
14+
15+# engine dependent config
16+categories = ['videos']
17+paging = True
18+language = ""
19+
20+# search-url
21+url = 'http://www.subtitleseeker.com/'
22+search_url = url+'search/TITLES/{query}&p={pageno}'
23+
24+# specific xpath variables
25+results_xpath = '//div[@class="boxRows"]'
26+
27+
28+# do search-request
29+def request(query, params):
30+ params['url'] = search_url.format(query=quote_plus(query),
31+ pageno=params['pageno'])
32+ return params
33+
34+
35+# get response from search-request
36+def response(resp):
37+ results = []
38+
39+ dom = html.fromstring(resp.text)
40+
41+ # parse results
42+ for result in dom.xpath(results_xpath):
43+ link = result.xpath(".//a")[0]
44+ href = link.attrib.get('href')
45+
46+ if language is not "":
47+ href = href + language + "/"
48+
49+ title = escape(link.xpath(".//text()")[0])
50+
51+ content = result.xpath('.//div[contains(@class,"red")]//text()')[0]
52+ content = content + " - "
53+ content = content + html.tostring(result.xpath('.//div[contains(@class,"grey-web")]')[0], method='text')
54+
55+ if result.xpath(".//span") != []:
56+ content = content + " - (" + result.xpath(".//span//text()")[0].strip() + ")"
57+
58+ # append result
59+ results.append({'url': href,
60+ 'title': title,
61+ 'content': escape(content)})
62+
63+ # return results
64+ return results