From 1f2a0c15e211e6b7708f01dd961f67ec5265551c Mon Sep 17 00:00:00 2001 From: dgw Date: Sat, 10 Aug 2024 02:06:59 -0700 Subject: [PATCH] search: remove flaky builtin, replaced by external plugin Also lets us drop `xmltodict` as a core dependency; `search.py` was the last place using it. --- pyproject.toml | 1 - sopel/builtins/search.py | 232 ------ .../builtins/search/test_example_duck_0.yaml | 720 ---------------- .../builtins/search/test_example_duck_1.yaml | 767 ------------------ .../search/test_example_suggest_0.yaml | 53 -- .../search/test_example_suggest_1.yaml | 62 -- .../search/test_example_suggest_2.yaml | 54 -- 7 files changed, 1889 deletions(-) delete mode 100644 sopel/builtins/search.py delete mode 100644 test/vcr/builtins/search/test_example_duck_0.yaml delete mode 100644 test/vcr/builtins/search/test_example_duck_1.yaml delete mode 100644 test/vcr/builtins/search/test_example_suggest_0.yaml delete mode 100644 test/vcr/builtins/search/test_example_suggest_1.yaml delete mode 100644 test/vcr/builtins/search/test_example_suggest_2.yaml diff --git a/pyproject.toml b/pyproject.toml index bc7dc8e49..4285837a5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,7 +44,6 @@ classifiers = [ ] requires-python = ">=3.8" dependencies = [ - "xmltodict>=0.12,<0.14", "pytz", "requests>=2.24.0,<3.0.0", "dnspython<3.0", diff --git a/sopel/builtins/search.py b/sopel/builtins/search.py deleted file mode 100644 index a777481e4..000000000 --- a/sopel/builtins/search.py +++ /dev/null @@ -1,232 +0,0 @@ -""" -search.py - Sopel Search Engine Plugin -Copyright 2008-9, Sean B. Palmer, inamidst.com -Copyright 2012, Elsie Powell, embolalia.com -Licensed under the Eiffel Forum License 2. - -https://sopel.chat -""" -from __future__ import annotations - -import re - -import requests -import xmltodict # type: ignore[import] - -from sopel import plugin -from sopel.tools import web - -PLUGIN_OUTPUT_PREFIX = '[search] ' - -header_spoof = { - 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36', -} -r_bing = re.compile(r'

') - - -def bing_search(query, lang='en-US'): - base = 'https://www.bing.com/search' - parameters = { - 'mkt': lang, - 'q': query, - } - response = requests.get(base, parameters, headers=header_spoof) - - match = r_bing.search(response.text) - - if match: - return web.decode(match.group(1)) - - -def duck_search(query): - query = query.replace('!', '') - base = 'https://duckduckgo.com/html/' - parameters = { - 'kl': 'us-en', - 'q': query, - } - content = requests.get(base, parameters, headers=header_spoof).text - - if 'web-result' in content: # filter out the ads on top of the page - content = content.split('web-result')[1] - - match = r_duck.search(content) - - if match: - return web.decode(match.group(1)) - - -def duck_api(query): - if '!bang' in query.lower(): - return 'https://duckduckgo.com/bang.html' - - base = 'https://api.duckduckgo.com/' - parameters = { - 'format': 'json', - 'no_html': '1', - 'no_redirect': '1', - 'q': query, - } - try: - results = requests.get(base, parameters).json() - except ValueError: - return None - if results['Redirect']: - return results['Redirect'] - else: - return None - - -@plugin.command('duck', 'ddg', 'g') -# test for bad Unicode handling in py2 -@plugin.example( - '.duck site:grandorder.wiki chulainn alter', - r'https?:\/\/grandorder\.wiki\/C%C3%BA_Chulainn.*', - re=True, - online=True, - vcr=True) -# the last example (in source line order) is what .help displays -@plugin.example( - '.duck sopel.chat irc bot', - r'https?:\/\/.*sopel.*', - re=True, - online=True, - vcr=True) -@plugin.output_prefix(PLUGIN_OUTPUT_PREFIX) -def duck(bot, trigger): - """Queries DuckDuckGo for the specified input.""" - query = trigger.group(2) - if not query: - bot.reply('{prefix}{command} what?'.format( - prefix=bot.settings.core.help_prefix, - command=trigger.group(1), - )) - return - - # If the API gives us something, say it and stop - result = duck_api(query) - if result: - bot.say(result) - return - - # Otherwise, look it up on the HTML version - uri = duck_search(query) - - if uri: - bot.say(uri) - if 'last_seen_url' in bot.memory: - bot.memory['last_seen_url'][trigger.sender] = uri - else: - msg = "No results found for '%s'." % query - if query.count('site:') >= 2: - # This check exists because of issue #1415. - # The shortcut link will take the user there. - msg += " Try again with at most one 'site:' operator." - msg += " See https://sopel.chat/i/1415 for why." - bot.reply(msg) - - -@plugin.command('bing') -@plugin.example('.bing sopel.chat irc bot') -@plugin.output_prefix(PLUGIN_OUTPUT_PREFIX) -def bing(bot, trigger): - """Queries Bing for the specified input.""" - if not trigger.group(2): - bot.reply('{}bing what?'.format(bot.settings.core.help_prefix)) - return - - query = trigger.group(2) - result = bing_search(query) - - if result: - bot.say(result) - else: - msg = "No results found for '%s'." % query - if query.count('site:') >= 2: - # This check exists because of issue #1415. - # The shortcut link will take the user there. - msg += " Try again with at most one 'site:' operator." - msg += " See https://sopel.chat/i/1415 for why." - bot.reply(msg) - - -@plugin.command('search') -@plugin.example('.search sopel irc bot') -@plugin.output_prefix(PLUGIN_OUTPUT_PREFIX) -def search(bot, trigger): - """Searches both Bing and DuckDuckGo.""" - if not trigger.group(2): - bot.reply('{}search for what?'.format(bot.settings.core.help_prefix)) - return - - query = trigger.group(2) - bu = bing_search(query) or '-' - du = duck_search(query) or '-' - - if bu == '-' and du == '-': - msg = "No results found for '%s'." % query - if query.count('site:') >= 2: - # This check exists because of issue #1415. - # The shortcut link will take the user there. - msg += " Try again with at most one 'site:' operator." - msg += " See https://sopel.chat/i/1415 for why." - bot.reply(msg) - return - elif bu == du: - result = '%s (b, d)' % bu - else: - if len(bu) > 150: - bu = '(extremely long link)' - if len(du) > 150: - du = '(extremely long link)' - result = '%s (b), %s (d)' % (bu, du) - - bot.say(result) - - -@plugin.command('suggest') -@plugin.example('.suggest', '.suggest what?') -@plugin.example('.suggest sopel irc', 'sopel irc', online=True, vcr=True) -@plugin.example('.suggest wikip', 'wikipedia', online=True, vcr=True, user_help=True) -@plugin.example('.suggest lkashdfiauwgaef', 'Sorry, no result.', online=True, vcr=True) -@plugin.output_prefix(PLUGIN_OUTPUT_PREFIX) -def suggest(bot, trigger): - """Suggests terms starting with given input""" - if not trigger.group(2): - bot.reply('{}suggest what?'.format(bot.settings.core.help_prefix)) - return - - query = trigger.group(2) - - # Using Google isn't necessarily ideal, but at most they'll be able to build - # a composite profile of all users on a given instance, not a profile of any - # single user. This can be switched out as soon as someone finds (or builds) - # an alternative suggestion API. - base = 'https://suggestqueries.google.com/complete/search' - parameters = { - 'output': 'toolbar', - 'hl': 'en', - 'q': query, - } - - response = requests.get(base, parameters) - answer = xmltodict.parse(response.text)['toplevel'] - - try: - answer = answer['CompleteSuggestion'] - - try: - answer = answer[0] - except KeyError: - # only one suggestion; don't need to extract first item - pass - - answer = answer['suggestion']['@data'] - except TypeError: - answer = None - - if answer: - bot.say(answer) - else: - bot.reply('Sorry, no result.') diff --git a/test/vcr/builtins/search/test_example_duck_0.yaml b/test/vcr/builtins/search/test_example_duck_0.yaml deleted file mode 100644 index f62495187..000000000 --- a/test/vcr/builtins/search/test_example_duck_0.yaml +++ /dev/null @@ -1,720 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate, br - Connection: - - keep-alive - User-Agent: - - python-requests/2.31.0 - method: GET - uri: https://api.duckduckgo.com/?format=json&no_html=1&no_redirect=1&q=sopel.chat+irc+bot - response: - body: - string: '{"Abstract":"","AbstractSource":"","AbstractText":"","AbstractURL":"","Answer":"","AnswerType":"","Definition":"","DefinitionSource":"","DefinitionURL":"","Entity":"","Heading":"","Image":"","ImageHeight":"","ImageIsLogo":"","ImageWidth":"","Infobox":"","Redirect":"","RelatedTopics":[],"Results":[],"Type":"","meta":{"attribution":null,"blockgroup":null,"created_date":"2021-03-24","description":"testing","designer":null,"dev_date":"2021-03-24","dev_milestone":"development","developer":[{"name":"zt","type":"duck.co","url":"https://duck.co/user/zt"}],"example_query":"","id":"just_another_test","is_stackexchange":0,"js_callback_name":"another_test","live_date":null,"maintainer":{"github":""},"name":"Just - Another Test","perl_module":"DDG::Lontail::AnotherTest","producer":null,"production_state":"offline","repo":"fathead","signal_from":"just_another_test","src_domain":"how - about there","src_id":null,"src_name":"hi there","src_options":{"directory":"","is_fanon":0,"is_mediawiki":0,"is_wikipedia":0,"language":"","min_abstract_length":null,"skip_abstract":0,"skip_abstract_paren":0,"skip_icon":0,"skip_image_name":0,"skip_qr":"","src_info":"","src_skip":""},"src_url":"Hello - there","status":null,"tab":"is this source","topic":[],"unsafe":null}}' - headers: - Access-Control-Allow-Origin: - - '*' - Cache-Control: - - max-age=1 - Connection: - - keep-alive - Content-Encoding: - - br - Content-Security-Policy: - - 'default-src ''none'' ; connect-src https://duckduckgo.com https://*.duckduckgo.com - https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ ; - manifest-src https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; media-src https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; script-src blob: https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ''unsafe-inline'' ''unsafe-eval'' ; font-src data: https://duckduckgo.com - https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; img-src data: https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; style-src https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ''unsafe-inline'' ; object-src ''none'' ; worker-src blob: ; child-src blob: https://duckduckgo.com - https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; frame-src blob: https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; form-action https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; frame-ancestors ''self'' ; base-uri ''self'' ; block-all-mixed-content ;' - Content-Type: - - application/x-javascript - Date: - - Thu, 12 Oct 2023 04:39:27 GMT - Expect-CT: - - max-age=0 - Expires: - - Thu, 12 Oct 2023 04:39:28 GMT - Permissions-Policy: - - interest-cohort=() - Referrer-Policy: - - origin - Server: - - nginx - Server-Timing: - - total;dur=39;desc="Backend Total" - Strict-Transport-Security: - - max-age=31536000 - Transfer-Encoding: - - chunked - Vary: - - Accept-Encoding - X-Content-Type-Options: - - nosniff - X-DuckDuckGo-Locale: - - en_US - X-DuckDuckGo-Results: - - '1' - X-Frame-Options: - - SAMEORIGIN - X-XSS-Protection: - - 1;mode=block - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate, br - Connection: - - keep-alive - User-Agent: - - Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like - Gecko) Chrome/55.0.2883.87 Safari/537.36 - method: GET - uri: https://duckduckgo.com/html/?kl=us-en&q=sopel.chat+irc+bot - response: - body: - string: "\r\n302 Found\r\n\r\n

302 - Found

\r\n
nginx
\r\n\r\n\r\n" - headers: - Cache-Control: - - max-age=1 - Connection: - - keep-alive - Content-Length: - - '138' - Content-Security-Policy: - - 'default-src ''none'' ; connect-src https://duckduckgo.com https://*.duckduckgo.com - https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ ; - manifest-src https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; media-src https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; script-src blob: https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; font-src data: https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; img-src data: https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; style-src https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; object-src ''none'' ; worker-src blob: ; child-src blob: https://duckduckgo.com - https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; frame-src blob: https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; frame-ancestors ''self'' ; base-uri ''self'' ; block-all-mixed-content ;' - Content-Type: - - text/html - Date: - - Thu, 12 Oct 2023 04:39:27 GMT - Expect-CT: - - max-age=0 - Expires: - - Thu, 12 Oct 2023 04:39:28 GMT - Location: - - https://html.duckduckgo.com/html/?kl=us-en&q=sopel.chat+irc+bot - Permissions-Policy: - - interest-cohort=() - Referrer-Policy: - - origin - Server: - - nginx - Strict-Transport-Security: - - max-age=31536000 - X-Content-Type-Options: - - nosniff - X-DuckDuckGo-Locale: - - en_US - X-Frame-Options: - - SAMEORIGIN - X-XSS-Protection: - - 1;mode=block - status: - code: 302 - message: Moved Temporarily -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate, br - Connection: - - keep-alive - User-Agent: - - Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like - Gecko) Chrome/55.0.2883.87 Safari/537.36 - method: GET - uri: https://html.duckduckgo.com/html/?kl=us-en&q=sopel.chat+irc+bot - response: - body: - string: "\n\n\n\n\n\n\n - \ \n - \ \n \n \n \n sopel.chat irc bot at DuckDuckGo\n - \ \n \n \n \n \n \n\n\n\n
\n\n
\n \n
\n\n - \
\n
\n\n
\n \n\n\n
\n\n
\n - \ \n \n
\n\n\n - \ \n \n \n \n\n
\n \n
\n\n
\n \n
\n\n
\n\n - \
\n\n\n\n\n\n\n\n
\n
\n
\n\n \n\n\n\n - \ \n\n\n \n\n \n\n\n\n \n\n\n - \ \n\n \n\n\n\n \n\n\n \n\n - \ \n\n\n\n \n\n\n \n\n \n\n\n\n \n\n\n - \ \n\n - \ \n\n\n\n \n\n\n \n\n - \ \n\n\n\n \n\n\n \n\n - \ \n\n\n\n \n\n\n \n\n \n\n\n\n \n\n\n \n\n \n\n\n\n \n\n\n \n\n \n\n\n\n \n\n\n \n\n \n\n\n\n \n\n\n \n\n \n\n\n\n \n\n\n - \ \n\n \n\n\n\n \n\n\n - \ \n\n - \ \n\n\n\n \n\n\n \n\n \n\n\n\n \n\n\n \n\n - \ \n\n\n\n \n\n\n \n\n \n\n\n\n \n\n\n \n\n \n\n\n\n \n\n\n \n\n \n\n\n\n \n\n\n \n\n \n\n\n\n\n - \ \n \n
\n
\n \n \n \n - \ \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n
\n - \
\n \n\n\n\n
\n - \ Feedback\n - \
\n
\n
\n
\n\n\n\n
\n
\n\n
\n\n - \ \n \n \n\n\n" - headers: - Cache-Control: - - max-age=1 - Connection: - - keep-alive - Content-Encoding: - - br - Content-Security-Policy: - - 'default-src ''none'' ; connect-src https://duckduckgo.com https://*.duckduckgo.com - https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ ; - manifest-src https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; media-src https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; script-src blob: https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; font-src data: https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; img-src data: https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; style-src https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; object-src ''none'' ; worker-src blob: ; child-src blob: https://duckduckgo.com - https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; frame-src blob: https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; frame-ancestors ''self'' ; base-uri ''self'' ; block-all-mixed-content ;' - Content-Type: - - text/html; charset=UTF-8 - Date: - - Thu, 12 Oct 2023 04:39:28 GMT - Expect-CT: - - max-age=0 - Expires: - - Thu, 12 Oct 2023 04:39:29 GMT - Permissions-Policy: - - interest-cohort=() - Referrer-Policy: - - origin - Server: - - nginx - Server-Timing: - - total;dur=856;desc="Backend Total" - Set-Cookie: - - kl=us-en; Secure; HttpOnly; SameSite=Strict;Expires=Fri, 11 Oct 2024 04:39:27 - GMT; - Strict-Transport-Security: - - max-age=31536000 - Transfer-Encoding: - - chunked - Vary: - - Accept-Encoding - X-Content-Type-Options: - - nosniff - X-DuckDuckGo-Locale: - - en_US - X-Frame-Options: - - SAMEORIGIN - X-XSS-Protection: - - 1;mode=block - status: - code: 200 - message: OK -version: 1 diff --git a/test/vcr/builtins/search/test_example_duck_1.yaml b/test/vcr/builtins/search/test_example_duck_1.yaml deleted file mode 100644 index f6b94e3c6..000000000 --- a/test/vcr/builtins/search/test_example_duck_1.yaml +++ /dev/null @@ -1,767 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate, br - Connection: - - keep-alive - User-Agent: - - python-requests/2.31.0 - method: GET - uri: https://api.duckduckgo.com/?format=json&no_html=1&no_redirect=1&q=site%3Agrandorder.wiki+chulainn+alter - response: - body: - string: '{"Abstract":"","AbstractSource":"","AbstractText":"","AbstractURL":"","Answer":"","AnswerType":"","Definition":"","DefinitionSource":"","DefinitionURL":"","Entity":"","Heading":"","Image":"","ImageHeight":"","ImageIsLogo":"","ImageWidth":"","Infobox":"","Redirect":"","RelatedTopics":[],"Results":[],"Type":"","meta":{"attribution":null,"blockgroup":null,"created_date":"2021-03-24","description":"testing","designer":null,"dev_date":"2021-03-24","dev_milestone":"development","developer":[{"name":"zt","type":"duck.co","url":"https://duck.co/user/zt"}],"example_query":"","id":"just_another_test","is_stackexchange":0,"js_callback_name":"another_test","live_date":null,"maintainer":{"github":""},"name":"Just - Another Test","perl_module":"DDG::Lontail::AnotherTest","producer":null,"production_state":"offline","repo":"fathead","signal_from":"just_another_test","src_domain":"how - about there","src_id":null,"src_name":"hi there","src_options":{"directory":"","is_fanon":0,"is_mediawiki":0,"is_wikipedia":0,"language":"","min_abstract_length":null,"skip_abstract":0,"skip_abstract_paren":0,"skip_icon":0,"skip_image_name":0,"skip_qr":"","src_info":"","src_skip":""},"src_url":"Hello - there","status":null,"tab":"is this source","topic":[],"unsafe":null}}' - headers: - Access-Control-Allow-Origin: - - '*' - Cache-Control: - - max-age=1 - Connection: - - keep-alive - Content-Encoding: - - br - Content-Security-Policy: - - 'default-src ''none'' ; connect-src https://duckduckgo.com https://*.duckduckgo.com - https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ ; - manifest-src https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; media-src https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; script-src blob: https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ''unsafe-inline'' ''unsafe-eval'' ; font-src data: https://duckduckgo.com - https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; img-src data: https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; style-src https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ''unsafe-inline'' ; object-src ''none'' ; worker-src blob: ; child-src blob: https://duckduckgo.com - https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; frame-src blob: https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; form-action https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; frame-ancestors ''self'' ; base-uri ''self'' ; block-all-mixed-content ;' - Content-Type: - - application/x-javascript - Date: - - Thu, 12 Oct 2023 04:39:28 GMT - Expect-CT: - - max-age=0 - Expires: - - Thu, 12 Oct 2023 04:39:29 GMT - Permissions-Policy: - - interest-cohort=() - Referrer-Policy: - - origin - Server: - - nginx - Server-Timing: - - total;dur=37;desc="Backend Total" - Strict-Transport-Security: - - max-age=31536000 - Transfer-Encoding: - - chunked - Vary: - - Accept-Encoding - X-Content-Type-Options: - - nosniff - X-DuckDuckGo-Locale: - - en_US - X-DuckDuckGo-Results: - - '1' - X-Frame-Options: - - SAMEORIGIN - X-XSS-Protection: - - 1;mode=block - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate, br - Connection: - - keep-alive - User-Agent: - - Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like - Gecko) Chrome/55.0.2883.87 Safari/537.36 - method: GET - uri: https://duckduckgo.com/html/?kl=us-en&q=site%3Agrandorder.wiki+chulainn+alter - response: - body: - string: "\r\n302 Found\r\n\r\n

302 - Found

\r\n
nginx
\r\n\r\n\r\n" - headers: - Cache-Control: - - max-age=1 - Connection: - - keep-alive - Content-Length: - - '138' - Content-Security-Policy: - - 'default-src ''none'' ; connect-src https://duckduckgo.com https://*.duckduckgo.com - https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ ; - manifest-src https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; media-src https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; script-src blob: https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; font-src data: https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; img-src data: https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; style-src https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; object-src ''none'' ; worker-src blob: ; child-src blob: https://duckduckgo.com - https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; frame-src blob: https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; frame-ancestors ''self'' ; base-uri ''self'' ; block-all-mixed-content ;' - Content-Type: - - text/html - Date: - - Thu, 12 Oct 2023 04:39:28 GMT - Expect-CT: - - max-age=0 - Expires: - - Thu, 12 Oct 2023 04:39:29 GMT - Location: - - https://html.duckduckgo.com/html/?kl=us-en&q=site%3Agrandorder.wiki+chulainn+alter - Permissions-Policy: - - interest-cohort=() - Referrer-Policy: - - origin - Server: - - nginx - Strict-Transport-Security: - - max-age=31536000 - X-Content-Type-Options: - - nosniff - X-DuckDuckGo-Locale: - - en_US - X-Frame-Options: - - SAMEORIGIN - X-XSS-Protection: - - 1;mode=block - status: - code: 302 - message: Moved Temporarily -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate, br - Connection: - - keep-alive - User-Agent: - - Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like - Gecko) Chrome/55.0.2883.87 Safari/537.36 - method: GET - uri: https://html.duckduckgo.com/html/?kl=us-en&q=site%3Agrandorder.wiki+chulainn+alter - response: - body: - string: "\n\n\n\n\n\n\n - \ \n - \ \n \n \n \n site:grandorder.wiki chulainn alter - at DuckDuckGo\n \n \n \n \n \n \n\n\n\n \n\n
\n \n
\n\n - \
\n
\n\n
\n \n\n\n
\n\n
\n - \ \n \n
\n\n\n - \ \n \n \n \n\n
\n \n
\n\n
\n \n
\n\n
\n\n - \
\n\n\n\n\n\n\n\n
\n
\n
\n\n \n\n\n\n - \ \n\n\n \n\n \n\n\n\n \n\n\n - \ \n\n - \ \n\n\n\n \n\n\n \n\n - \ \n\n\n\n \n\n\n \n\n - \ \n\n\n\n \n\n\n \n\n \n\n\n\n \n\n\n - \ \n\n - \ \n\n\n\n \n\n\n \n\n \n\n\n\n \n\n\n \n\n \n\n\n\n \n\n\n - \ \n\n \n\n\n\n \n\n\n \n\n \n\n\n\n \n\n\n \n\n \n\n\n\n \n\n\n \n\n \n\n\n\n \n\n\n - \ \n\n \n\n\n\n \n\n\n \n\n \n\n\n\n \n\n\n - \ \n\n - \ \n\n\n\n \n\n\n \n\n \n\n\n\n \n\n\n \n\n \n\n\n\n \n\n\n \n\n \n\n\n\n \n\n\n \n\n \n\n\n\n \n\n\n \n\n - \ \n\n\n\n \n\n\n \n\n \n\n\n\n \n\n\n \n\n \n\n\n\n \n\n\n \n\n \n\n\n\n\n - \ \n \n
\n
\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n
\n - \
\n \n\n\n\n
\n - \ Feedback\n - \
\n
\n
\n
\n\n\n\n
\n
\n\n
\n\n - \ \n \n \n\n\n" - headers: - Cache-Control: - - max-age=1 - Connection: - - keep-alive - Content-Encoding: - - br - Content-Security-Policy: - - 'default-src ''none'' ; connect-src https://duckduckgo.com https://*.duckduckgo.com - https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ ; - manifest-src https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; media-src https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; script-src blob: https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; font-src data: https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; img-src data: https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; style-src https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; object-src ''none'' ; worker-src blob: ; child-src blob: https://duckduckgo.com - https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; frame-src blob: https://duckduckgo.com https://*.duckduckgo.com https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/ - ; frame-ancestors ''self'' ; base-uri ''self'' ; block-all-mixed-content ;' - Content-Type: - - text/html; charset=UTF-8 - Date: - - Thu, 12 Oct 2023 04:39:29 GMT - Expect-CT: - - max-age=0 - Expires: - - Thu, 12 Oct 2023 04:39:30 GMT - Permissions-Policy: - - interest-cohort=() - Referrer-Policy: - - origin - Server: - - nginx - Server-Timing: - - total;dur=606;desc="Backend Total" - Set-Cookie: - - kl=us-en; Secure; HttpOnly; SameSite=Strict;Expires=Fri, 11 Oct 2024 04:39:28 - GMT; - Strict-Transport-Security: - - max-age=31536000 - Transfer-Encoding: - - chunked - Vary: - - Accept-Encoding - X-Content-Type-Options: - - nosniff - X-DuckDuckGo-Locale: - - en_US - X-Frame-Options: - - SAMEORIGIN - X-XSS-Protection: - - 1;mode=block - status: - code: 200 - message: OK -version: 1 diff --git a/test/vcr/builtins/search/test_example_suggest_0.yaml b/test/vcr/builtins/search/test_example_suggest_0.yaml deleted file mode 100644 index 8a4e99528..000000000 --- a/test/vcr/builtins/search/test_example_suggest_0.yaml +++ /dev/null @@ -1,53 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate, br - Connection: - - keep-alive - User-Agent: - - python-requests/2.31.0 - method: GET - uri: https://suggestqueries.google.com/complete/search?output=toolbar&hl=en&q=lkashdfiauwgaef - response: - body: - string: - headers: - Alt-Svc: - - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 - Cache-Control: - - private, max-age=3600 - Content-Encoding: - - gzip - Content-Security-Policy: - - 'object-src ''none'';base-uri ''self'';script-src ''nonce-yoXc9HzWTdGO9RKE1Acudw'' - ''strict-dynamic'' ''report-sample'' ''unsafe-eval'' ''unsafe-inline'' https: - http:;report-uri https://csp.withgoogle.com/csp/gws/xsrp' - Content-Type: - - text/xml; charset=ISO-8859-1 - Date: - - Thu, 12 Oct 2023 04:39:29 GMT - Expires: - - Thu, 12 Oct 2023 04:39:29 GMT - P3P: - - CP="This is not a P3P policy! See g.co/p3phelp for more info." - Server: - - gws - Set-Cookie: - - 1P_JAR=2023-10-12-04; expires=Sat, 11-Nov-2023 04:39:29 GMT; path=/; domain=.google.com; - Secure - - NID=511=EDlXqJw8GIVnkknq9WCPq-iS6jGJAaE5aoJrBdn0MHgUw7s7fedPgPYNqkijDLggXLwIN3ZrcyvQZ-BZZmepycsJ0Ye-oy6T5G3zUtJgUAvym_DfBst5Ug8waBXcvNyVg5v4U5TAW9QyzUW35i6NZ3f9kpNOksKFlUT5UAXiVS4; - expires=Fri, 12-Apr-2024 04:39:29 GMT; path=/; domain=.google.com; HttpOnly - Transfer-Encoding: - - chunked - X-Frame-Options: - - SAMEORIGIN - X-XSS-Protection: - - '0' - status: - code: 200 - message: OK -version: 1 diff --git a/test/vcr/builtins/search/test_example_suggest_1.yaml b/test/vcr/builtins/search/test_example_suggest_1.yaml deleted file mode 100644 index f91a660bd..000000000 --- a/test/vcr/builtins/search/test_example_suggest_1.yaml +++ /dev/null @@ -1,62 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate, br - Connection: - - keep-alive - User-Agent: - - python-requests/2.31.0 - method: GET - uri: https://suggestqueries.google.com/complete/search?output=toolbar&hl=en&q=wikip - response: - body: - string: - headers: - Alt-Svc: - - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 - Cache-Control: - - private, max-age=3600 - Content-Encoding: - - gzip - Content-Security-Policy: - - 'object-src ''none'';base-uri ''self'';script-src ''nonce-ZhhjlE3AKG1y99DS-lRDMw'' - ''strict-dynamic'' ''report-sample'' ''unsafe-eval'' ''unsafe-inline'' https: - http:;report-uri https://csp.withgoogle.com/csp/gws/xsrp' - Content-Type: - - text/xml; charset=ISO-8859-1 - Date: - - Thu, 12 Oct 2023 04:39:29 GMT - Expires: - - Thu, 12 Oct 2023 04:39:29 GMT - P3P: - - CP="This is not a P3P policy! See g.co/p3phelp for more info." - Server: - - gws - Set-Cookie: - - 1P_JAR=2023-10-12-04; expires=Sat, 11-Nov-2023 04:39:29 GMT; path=/; domain=.google.com; - Secure - - NID=511=UgsnerPc1dI5PMohIss-UiIUw3x_rOLP_sxO8gmZkuxyrpa7Iq4m4wDK4tZTWT4kMBMS6euma3kFUB2Tl9jrSdHulPrzoTgK0yZG_r_gr8uemYmNhndNcEn18gvCN89m8k7EnYapDx5P9Sbxr5ufxR2ruXS-OmU6iqu0p88oPqM; - expires=Fri, 12-Apr-2024 04:39:29 GMT; path=/; domain=.google.com; HttpOnly - Transfer-Encoding: - - chunked - X-Frame-Options: - - SAMEORIGIN - X-XSS-Protection: - - '0' - status: - code: 200 - message: OK -version: 1 diff --git a/test/vcr/builtins/search/test_example_suggest_2.yaml b/test/vcr/builtins/search/test_example_suggest_2.yaml deleted file mode 100644 index 9f0127fbd..000000000 --- a/test/vcr/builtins/search/test_example_suggest_2.yaml +++ /dev/null @@ -1,54 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate, br - Connection: - - keep-alive - User-Agent: - - python-requests/2.31.0 - method: GET - uri: https://suggestqueries.google.com/complete/search?output=toolbar&hl=en&q=sopel+irc - response: - body: - string: - headers: - Alt-Svc: - - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 - Cache-Control: - - private, max-age=3600 - Content-Encoding: - - gzip - Content-Security-Policy: - - 'object-src ''none'';base-uri ''self'';script-src ''nonce-ZNUDAmWQ5jWHwsBTLOrGXw'' - ''strict-dynamic'' ''report-sample'' ''unsafe-eval'' ''unsafe-inline'' https: - http:;report-uri https://csp.withgoogle.com/csp/gws/xsrp' - Content-Type: - - text/xml; charset=ISO-8859-1 - Date: - - Thu, 12 Oct 2023 04:39:29 GMT - Expires: - - Thu, 12 Oct 2023 04:39:29 GMT - P3P: - - CP="This is not a P3P policy! See g.co/p3phelp for more info." - Server: - - gws - Set-Cookie: - - 1P_JAR=2023-10-12-04; expires=Sat, 11-Nov-2023 04:39:29 GMT; path=/; domain=.google.com; - Secure - - NID=511=jlELNMjRfk79a0trEFcZFKHypFdBzv4AODS-ttpnXttvig8APhjENyAlXfiSGgicvm8DNjxoBW4NUAah5Ubw2ABcODT5w5UgXvTTXOpMrJEtQFtmviJvJe_wlbVH3T87PNdX46acUC91aS9_N12SMm_hznR9VBVazAYv4JRpPUg; - expires=Fri, 12-Apr-2024 04:39:29 GMT; path=/; domain=.google.com; HttpOnly - Transfer-Encoding: - - chunked - X-Frame-Options: - - SAMEORIGIN - X-XSS-Protection: - - '0' - status: - code: 200 - message: OK -version: 1