diff options
| author | 2019-11-26 13:41:40 +0000 | |
|---|---|---|
| committer | 2019-11-26 13:42:01 +0000 | |
| commit | 2d21dfa22931bdb887ccccba4a33e6fa4755e94b (patch) | |
| tree | 6ef5e304e3e9a69f9afd66ac0bee4d98ec115399 /modules/duckduckgo.py | |
| parent | remove all `eagle` stuff from nr.py (diff) | |
utils.http.Response.data should always be `bytes` - add .decode and .soup
Diffstat (limited to 'modules/duckduckgo.py')
| -rw-r--r-- | modules/duckduckgo.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/duckduckgo.py b/modules/duckduckgo.py index 6660d158..f43d2376 100644 --- a/modules/duckduckgo.py +++ b/modules/duckduckgo.py @@ -18,9 +18,9 @@ class Module(ModuleManager.BaseModule): if phrase: page = utils.http.request(URL_DDG, get_params={ "q": phrase, "format": "json", "no_html": "1", - "no_redirect": "1"}, json=True) + "no_redirect": "1"}).json() - if page and page.data["AbstractURL"]: - event["stdout"].write(page.data["AbstractURL"]) + if page and page["AbstractURL"]: + event["stdout"].write(page["AbstractURL"]) else: event["stderr"].write("No results found") |
