aboutsummaryrefslogtreecommitdiff
path: root/modules/imgur.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-10-31 17:44:21 +0000
committerGravatar jesopo2018-10-31 17:44:21 +0000
commit04e369a92d193a1b013344ff2e4506b381604600 (patch)
tree377d46d9da060545b233a98f72cc30c0e2688729 /modules/imgur.py
parentSupport galleries in modules/imgur.py (diff)
signature
Use gallery API endpoint for gallery urls
Diffstat (limited to 'modules/imgur.py')
-rw-r--r--modules/imgur.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/imgur.py b/modules/imgur.py
index 7430499c..dd586b4f 100644
--- a/modules/imgur.py
+++ b/modules/imgur.py
@@ -5,7 +5,9 @@ from src import ModuleManager, utils
REGEX_IMAGE = re.compile("https?://(?:i\.)?imgur.com/(\w+)")
REGEX_GALLERY = re.compile("https?://imgur.com/gallery/(\w+)")
+
URL_IMAGE = "https://api.imgur.com/3/image/%s"
+URL_GALLERY = "https://api.imgur.com/3/gallery/%s"
class Module(ModuleManager.BaseModule):
def _prefix(self, data):
@@ -35,7 +37,7 @@ class Module(ModuleManager.BaseModule):
def _gallery_info(self, hash):
api_key = self.bot.config["imgur-api-key"]
- result = utils.http.get_url(URL_IMAGE % hash,
+ result = utils.http.get_url(URL_GALLERY % hash,
headers={"Authorization": "Client-ID %s" % api_key},
json=True)