unsee: Restrict URL to unsee domains
Otherwise it would crash any pastoob get!
This commit is contained in:
parent
99b4ce7d58
commit
31a96228db
1 changed files with 2 additions and 0 deletions
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue