From 31a96228db02f0623adfdb7a1846c42f385c664c Mon Sep 17 00:00:00 2001 From: Laurent Bachelier Date: Fri, 10 Oct 2014 23:30:58 +0200 Subject: [PATCH] unsee: Restrict URL to unsee domains Otherwise it would crash any pastoob get! --- modules/unsee/module.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/unsee/module.py b/modules/unsee/module.py index 7812357b..938c2aa5 100644 --- a/modules/unsee/module.py +++ b/modules/unsee/module.py @@ -22,6 +22,7 @@ from weboob.tools.backend import Module from weboob.capabilities.paste import BasePaste from weboob.tools.capabilities.paste import BasePasteModule from weboob.tools.capabilities.paste import image_mime +from weboob.deprecated.browser.decorators import check_url import re from .browser import UnseeBrowser @@ -57,6 +58,7 @@ class UnseeModule(Module, BasePasteModule): mime = image_mime(contents, ('gif', 'jpeg', 'png')) return 20 * int(mime is not None) + @check_url('https?://unsee.cc/.+') def get_paste(self, id): paste = UnPaste(id) paste.contents = self.browser.get_image(id).encode('base64')