Loading searx/engines/bing_images.py +2 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,8 @@ time_range_string = '&qft=+filterui:age-lt{interval}' thumb_url = "https://www.bing.com/th?id={ihk}" time_range_dict = {'day': '1440', 'week': '10080', 'month': '43200'} 'month': '43200', 'year': '525600'} # safesearch definitions safesearch_types = {2: 'STRICT', Loading searx/engines/flickr_noapi.py +2 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,8 @@ paging = True time_range_support = True time_range_dict = {'day': 60 * 60 * 24, 'week': 60 * 60 * 24 * 7, 'month': 60 * 60 * 24 * 7 * 4} 'month': 60 * 60 * 24 * 7 * 4, 'year': 60 * 60 * 24 * 7 * 52} def build_flickr_url(user_id, photo_id): Loading searx/engines/google.py +2 −1 Original line number Diff line number Diff line Loading @@ -95,7 +95,8 @@ search_url = ('https://{hostname}' + time_range_search = "&tbs=qdr:{range}" time_range_dict = {'day': 'd', 'week': 'w', 'month': 'm'} 'month': 'm', 'year': 'y'} # other URLs map_hostname_start = 'maps.google.' Loading searx/engines/google_images.py +9 −1 Original line number Diff line number Diff line Loading @@ -10,10 +10,12 @@ @parse url, title, img_src """ from datetime import date, timedelta from urllib import urlencode from json import loads from lxml import html # engine dependent config categories = ['images'] paging = True Loading @@ -29,6 +31,7 @@ search_url = 'https://www.google.com/search'\ '&yv=2'\ '&{search_options}' time_range_attr = "qdr:{range}" time_range_custom_attr = "cdr:1,cd_min:{start},cd_max{end}" time_range_dict = {'day': 'd', 'week': 'w', 'month': 'm'} Loading @@ -36,7 +39,6 @@ time_range_dict = {'day': 'd', # do search-request def request(query, params): search_options = { 'ijn': params['pageno'] - 1, 'start': (params['pageno'] - 1) * number_of_results Loading @@ -44,6 +46,12 @@ def request(query, params): if params['time_range'] in time_range_dict: search_options['tbs'] = time_range_attr.format(range=time_range_dict[params['time_range']]) elif params['time_range'] == 'year': now = date.today() then = now - timedelta(days=365) start = then.strftime('%m/%d/%Y') end = now.strftime('%m/%d/%Y') search_options['tbs'] = time_range_custom_attr.format(start=start, end=end) if safesearch and params['safesearch']: search_options['safe'] = 'on' Loading searx/engines/google_news.py +2 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,8 @@ search_url = 'https://www.google.com/search'\ time_range_attr = "qdr:{range}" time_range_dict = {'day': 'd', 'week': 'w', 'month': 'm'} 'month': 'm', 'year': 'y'} # do search-request Loading Loading
searx/engines/bing_images.py +2 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,8 @@ time_range_string = '&qft=+filterui:age-lt{interval}' thumb_url = "https://www.bing.com/th?id={ihk}" time_range_dict = {'day': '1440', 'week': '10080', 'month': '43200'} 'month': '43200', 'year': '525600'} # safesearch definitions safesearch_types = {2: 'STRICT', Loading
searx/engines/flickr_noapi.py +2 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,8 @@ paging = True time_range_support = True time_range_dict = {'day': 60 * 60 * 24, 'week': 60 * 60 * 24 * 7, 'month': 60 * 60 * 24 * 7 * 4} 'month': 60 * 60 * 24 * 7 * 4, 'year': 60 * 60 * 24 * 7 * 52} def build_flickr_url(user_id, photo_id): Loading
searx/engines/google.py +2 −1 Original line number Diff line number Diff line Loading @@ -95,7 +95,8 @@ search_url = ('https://{hostname}' + time_range_search = "&tbs=qdr:{range}" time_range_dict = {'day': 'd', 'week': 'w', 'month': 'm'} 'month': 'm', 'year': 'y'} # other URLs map_hostname_start = 'maps.google.' Loading
searx/engines/google_images.py +9 −1 Original line number Diff line number Diff line Loading @@ -10,10 +10,12 @@ @parse url, title, img_src """ from datetime import date, timedelta from urllib import urlencode from json import loads from lxml import html # engine dependent config categories = ['images'] paging = True Loading @@ -29,6 +31,7 @@ search_url = 'https://www.google.com/search'\ '&yv=2'\ '&{search_options}' time_range_attr = "qdr:{range}" time_range_custom_attr = "cdr:1,cd_min:{start},cd_max{end}" time_range_dict = {'day': 'd', 'week': 'w', 'month': 'm'} Loading @@ -36,7 +39,6 @@ time_range_dict = {'day': 'd', # do search-request def request(query, params): search_options = { 'ijn': params['pageno'] - 1, 'start': (params['pageno'] - 1) * number_of_results Loading @@ -44,6 +46,12 @@ def request(query, params): if params['time_range'] in time_range_dict: search_options['tbs'] = time_range_attr.format(range=time_range_dict[params['time_range']]) elif params['time_range'] == 'year': now = date.today() then = now - timedelta(days=365) start = then.strftime('%m/%d/%Y') end = now.strftime('%m/%d/%Y') search_options['tbs'] = time_range_custom_attr.format(start=start, end=end) if safesearch and params['safesearch']: search_options['safe'] = 'on' Loading
searx/engines/google_news.py +2 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,8 @@ search_url = 'https://www.google.com/search'\ time_range_attr = "qdr:{range}" time_range_dict = {'day': 'd', 'week': 'w', 'month': 'm'} 'month': 'm', 'year': 'y'} # do search-request Loading