Pastebin: handle user pages
Not used for anything (for now), but you can be redirected to them after login.
This commit is contained in:
parent
21d43b1e64
commit
a37359807a
2 changed files with 5 additions and 1 deletions
|
|
@ -23,7 +23,7 @@ from weboob.tools.browser.decorators import id2url, check_url
|
||||||
|
|
||||||
from weboob.capabilities.paste import PasteNotFound
|
from weboob.capabilities.paste import PasteNotFound
|
||||||
|
|
||||||
from .pages import PastePage, PostPage
|
from .pages import PastePage, PostPage, UserPage
|
||||||
from .paste import PastebinPaste
|
from .paste import PastebinPaste
|
||||||
|
|
||||||
import urllib
|
import urllib
|
||||||
|
|
@ -41,6 +41,7 @@ class PastebinBrowser(BaseBrowser):
|
||||||
PASTE_URL = 'http://%s/(?P<id>\w+)' % DOMAIN
|
PASTE_URL = 'http://%s/(?P<id>\w+)' % DOMAIN
|
||||||
API_URL = 'http://%s/api/api_post.php' % DOMAIN
|
API_URL = 'http://%s/api/api_post.php' % DOMAIN
|
||||||
PAGES = {PASTE_URL: PastePage,
|
PAGES = {PASTE_URL: PastePage,
|
||||||
|
'http://%s/u/(?P<username>.+)' % DOMAIN: UserPage,
|
||||||
'http://%s/' % DOMAIN: PostPage}
|
'http://%s/' % DOMAIN: PostPage}
|
||||||
|
|
||||||
def __init__(self, api_key, *args, **kwargs):
|
def __init__(self, api_key, *args, **kwargs):
|
||||||
|
|
|
||||||
|
|
@ -79,3 +79,6 @@ class PostPage(BasePastebinPage):
|
||||||
if expiration:
|
if expiration:
|
||||||
self.browser['paste_expire_date'] = [expiration]
|
self.browser['paste_expire_date'] = [expiration]
|
||||||
self.browser.submit()
|
self.browser.submit()
|
||||||
|
|
||||||
|
class UserPage(BasePastebinPage):
|
||||||
|
pass
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue