From 25f8274eeb68a834d044807f749c175d0bd48aaa Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Fri, 26 Aug 2011 12:48:48 +0200 Subject: [PATCH] use a right way to prevent weboob to be detected as a robot --- weboob/backends/phpbb/pages/forum.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/weboob/backends/phpbb/pages/forum.py b/weboob/backends/phpbb/pages/forum.py index 81928a5a..da47f2c0 100644 --- a/weboob/backends/phpbb/pages/forum.py +++ b/weboob/backends/phpbb/pages/forum.py @@ -18,6 +18,7 @@ # along with weboob. If not, see . +from time import sleep from urlparse import urlsplit, parse_qs from weboob.tools.browser import BrokenPageError @@ -213,6 +214,8 @@ class PostingPage(PhpBBPage): # $diff = time() - $creation_time; # // If creation_time and the time() now is zero we can assume it was not a human doing this (the check for if ($diff)... # if ($diff && ($diff <= $timespan || $timespan === -1)) - self.browser['creation_time'] = str(int(self.browser['creation_time']) - 10) + # But as the form_token depends on the create_time value, I can't + # change it. But I can wait a second before posting... + sleep(1) self.browser.submit(name='post')