paste* backends: Use the check_url decorator
This commit is contained in:
parent
4d8030b8dd
commit
c1c9b39e9d
4 changed files with 15 additions and 2 deletions
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
|
||||
from weboob.tools.browser import BaseBrowser, BrowserHTTPNotFound
|
||||
from weboob.tools.browser.decorators import id2url
|
||||
from weboob.tools.browser.decorators import id2url, check_url
|
||||
|
||||
from weboob.capabilities.paste import PasteNotFound
|
||||
|
||||
|
|
@ -54,6 +54,7 @@ class PastebinBrowser(BaseBrowser):
|
|||
raise PasteNotFound()
|
||||
|
||||
@id2url(PastebinPaste.id2url)
|
||||
@check_url(PASTE_URL)
|
||||
def get_paste(self, url):
|
||||
_id = re.match('^%s$' % self.PASTE_URL, url).groupdict()['id']
|
||||
return PastebinPaste(_id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue