diff options
| author | 2019-11-26 13:41:40 +0000 | |
|---|---|---|
| committer | 2019-11-26 13:42:01 +0000 | |
| commit | 2d21dfa22931bdb887ccccba4a33e6fa4755e94b (patch) | |
| tree | 6ef5e304e3e9a69f9afd66ac0bee4d98ec115399 /modules/shorturl.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/shorturl.py')
| -rw-r--r-- | modules/shorturl.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/shorturl.py b/modules/shorturl.py index e18cdcfd..10bd9dd3 100644 --- a/modules/shorturl.py +++ b/modules/shorturl.py @@ -57,10 +57,10 @@ class Module(ModuleManager.BaseModule): access_token = self.bot.config.get("bitly-api-key", None) if access_token: page = utils.http.request(URL_BITLYSHORTEN, get_params={ - "access_token": access_token, "longUrl": url}, json=True) + "access_token": access_token, "longUrl": url}).json() - if page and page.data["data"]: - return page.data["data"]["url"] + if page["data"]: + return page["data"]["url"] return None def _find_url(self, target, args): |
