diff options
| author | Cqoicebordel <Cqoicebordel@users.noreply.github.com> | 2014-12-23 01:41:25 +0100 |
|---|---|---|
| committer | Cqoicebordel <Cqoicebordel@users.noreply.github.com> | 2014-12-23 01:41:25 +0100 |
| commit | 829948b85df0510e331372bcd60cb31db9c96a5c (patch) | |
| tree | 1cd082f7cb0dd4fb2de821ed9347843326d7d6d1 /searx/engines | |
| parent | 550232fc21ff2c3ae9a5de3d8b999de66c96171c (diff) | |
Add language support
Allow the user to select a language. It must be written in english, and capitalized, ie : English, French, German, Hungarian...
Diffstat (limited to 'searx/engines')
| -rw-r--r-- | searx/engines/subtitleseeker.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/searx/engines/subtitleseeker.py b/searx/engines/subtitleseeker.py index 346298300..c72f81899 100644 --- a/searx/engines/subtitleseeker.py +++ b/searx/engines/subtitleseeker.py @@ -16,6 +16,8 @@ from lxml import html categories = ['videos'] paging = True +language = "" + # search-url url = 'http://www.subtitleseeker.com/' search_url = url+'search/TITLES/{query}&p={pageno}' @@ -41,6 +43,10 @@ def response(resp): for result in dom.xpath(results_xpath): link = result.xpath(".//a")[0] href = link.attrib.get('href') + + if language is not "": + href = href + language + "/" + title = escape(link.xpath(".//text()")[0]) content = result.xpath('.//div[contains(@class,"red")]//text()')[0] |