diff --git a/modules/imgur/module.py b/modules/imgur/module.py index 07712532..035c4c6e 100644 --- a/modules/imgur/module.py +++ b/modules/imgur/module.py @@ -23,6 +23,7 @@ from weboob.capabilities.paste import CapPaste, BasePaste from weboob.tools.capabilities.paste import image_mime from weboob.capabilities.base import StringField from weboob.deprecated.browser import StandardBrowser +from weboob.deprecated.browser.decorators import check_url from urllib import urlencode import re @@ -91,6 +92,7 @@ class ImgurModule(Module, CapPaste): paste.id = json['data']['id'] paste.delete_url = 'https://api.imgur.com/3/image/%s' % json['data']['deletehash'] + @check_url('https?://(?:[a-z]+\.)?imgur.com/') def get_paste(self, id): paste = ImgPaste(id) paste.contents = self.browser.readurl(paste.raw_url).encode('base64')