fix ripbang userscript for command line (not spawned)

This commit is contained in:
Daniel Dimijian 2022-03-02 01:20:21 -05:00
parent ac4ca6bfe2
commit dc50793d2d
1 changed files with 2 additions and 1 deletions

View File

@ -20,7 +20,8 @@ except ImportError:
for argument in sys.argv[1:]:
bang = '!' + argument
r = requests.get('https://duckduckgo.com/',
params={'q': bang + ' SEARCHTEXT'})
params={'q': bang + ' SEARCHTEXT'},
headers={'user-agent': 'test/0.0.1'})
searchengine = unquote(re.search("url=[^']+", r.text).group(0))
searchengine = searchengine.replace('url=', '')