diff options
| author | Adam Tauber <asciimoo@gmail.com> | 2015-06-04 16:39:13 -0400 |
|---|---|---|
| committer | Adam Tauber <asciimoo@gmail.com> | 2015-06-04 16:39:13 -0400 |
| commit | aa1b8fa79b0f9f66c2913b5acae5a63545504e70 (patch) | |
| tree | 61cd1fa527b745b47c691ab1eab58bef7c5d07db /searx/engines/youtube_noapi.py | |
| parent | cdf931f949f8eaa13522c07577177af1e8863a41 (diff) | |
| parent | dafedbfc55773bac65838d1a63765ecb78bbc7ab (diff) | |
Merge pull request #354 from asciimoo/bing_news
Bing news based on RSS output
Diffstat (limited to 'searx/engines/youtube_noapi.py')
| -rw-r--r-- | searx/engines/youtube_noapi.py | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/searx/engines/youtube_noapi.py b/searx/engines/youtube_noapi.py index 108b8950f..401fca4c9 100644 --- a/searx/engines/youtube_noapi.py +++ b/searx/engines/youtube_noapi.py @@ -11,6 +11,7 @@ from urllib import quote_plus from lxml import html from searx.engines.xpath import extract_text +from searx.utils import list_get # engine dependent config categories = ['videos', 'music'] @@ -34,14 +35,6 @@ title_xpath = './/div[@class="yt-lockup-content"]/h3/a' content_xpath = './/div[@class="yt-lockup-content"]/div[@class="yt-lockup-description yt-ui-ellipsis yt-ui-ellipsis-2"]' -# get element in list or default value -def list_get(a_list, index, default=None): - if len(a_list) > index: - return a_list[index] - else: - return default - - # returns extract_text on the first result selected by the xpath or None def extract_text_from_dom(result, xpath): r = result.xpath(xpath) |