From c2abb129850f487e7c5ccd9eefdb85fdb92e88bd Mon Sep 17 00:00:00 2001 From: Laurent Bachelier Date: Thu, 14 Apr 2011 19:36:35 +0200 Subject: [PATCH] paste* backends: Use the page regexp to find out the id --- weboob/backends/pastealacon/pages.py | 4 +--- weboob/backends/pastebin/pages.py | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/weboob/backends/pastealacon/pages.py b/weboob/backends/pastealacon/pages.py index d320d390..ec4a7cfa 100644 --- a/weboob/backends/pastealacon/pages.py +++ b/weboob/backends/pastealacon/pages.py @@ -20,7 +20,6 @@ from weboob.tools.browser import BasePage -from urlparse import urlparse import re __all__ = ['PastePage', 'PostPage', 'CaptchaPage'] @@ -38,8 +37,7 @@ class PastePage(BasePage): """ Find out the ID from the URL """ - path = urlparse(self.url).path - return path[1:] + return self.group_dict['id'] class PostPage(BasePage): def post(self, paste): diff --git a/weboob/backends/pastebin/pages.py b/weboob/backends/pastebin/pages.py index 7c00058e..7f175535 100644 --- a/weboob/backends/pastebin/pages.py +++ b/weboob/backends/pastebin/pages.py @@ -19,7 +19,6 @@ from weboob.tools.browser import BasePage -from urlparse import urlparse __all__ = ['PastePage', 'PostPage'] @@ -37,8 +36,7 @@ class PastePage(BasePage): """ Find out the ID from the URL """ - path = urlparse(self.url).path - return path[1:] + return self.group_dict['id'] class PostPage(BasePage):