diff --git a/weboob/backends/aum/backend.py b/weboob/backends/aum/backend.py index 6c9d2408..27302375 100644 --- a/weboob/backends/aum/backend.py +++ b/weboob/backends/aum/backend.py @@ -49,6 +49,7 @@ class AuMBackend(BaseBackend, ICapMessages, ICapMessagesReply, ICapDating, ICapC ICON = os.path.join(os.path.dirname(__file__), 'data/logo.png') CONFIG = {'username': BaseBackend.ConfigField(description='Username on website'), 'password': BaseBackend.ConfigField(description='Password of account', is_masked=True), + 'register': BaseBackend.ConfigField(default=False, description='Register as new account?'), } STORAGE = {'profiles_walker': {'viewed': []}, 'sluts': {}, @@ -56,7 +57,18 @@ class AuMBackend(BaseBackend, ICapMessages, ICapMessagesReply, ICapDating, ICapC BROWSER = AuMBrowser def create_default_browser(self): - return self.create_browser(self.config['username'], self.config['password']) + if self.config['register']: + browser = self.create_browser(self.config['username']) + browser.register(password= self.config['password'], + sex= 0, + birthday_d= 1, + birthday_m= 1, + birthday_y= 1970, + zipcode= 75001, + country= 'fr', + godfather= '') + else: + return self.create_browser(self.config['username'], self.config['password']) def get_status(self): with self.browser: diff --git a/weboob/backends/aum/browser.py b/weboob/backends/aum/browser.py index 00cf4e21..fca349cb 100644 --- a/weboob/backends/aum/browser.py +++ b/weboob/backends/aum/browser.py @@ -104,11 +104,11 @@ class AuMBrowser(BaseBrowser): return func(self, *args, **kwargs) return inner - def register(self, nickname, password, sex, birthday_d, birthday_m, birthday_y, zipcode, country, godfather=''): + def register(self, password, sex, birthday_d, birthday_m, birthday_y, zipcode, country, godfather=''): if not self.is_on_page(RegisterPage): self.location('http://www.adopteunmec.com/register2.php') - return self.page.register(nickname, password, sex, birthday_d, birthday_m, birthday_y, zipcode, country, godfather) + return self.page.register(password, sex, birthday_d, birthday_m, birthday_y, zipcode, country, godfather) @pageaccess def add_photo(self, name, f): diff --git a/weboob/backends/aum/captcha.py b/weboob/backends/aum/captcha.py index 7b7d367a..7c1bf900 100644 --- a/weboob/backends/aum/captcha.py +++ b/weboob/backends/aum/captcha.py @@ -156,7 +156,6 @@ class Decoder: browser.openurl('/register2.php') c = Captcha(browser.openurl('/captcha.php')) - print 'Decoded: %s' % c.text for tile in c: checksum = tile.checksum()