The new woob repository is here: https://gitlab.com/woob/woob. This gitlab will be removed soon.

The new woob repository is here: https://gitlab.com/woob/woob. This gitlab will be removed soon.

Commit 81503a88 authored by Romain Bignon's avatar Romain Bignon

do not crash when the limitation rate is reached

parent 3df00b63
......@@ -100,9 +100,19 @@ def like_profile(self):
return
profile = self.recs.pop()
if 'tinder_rate_limited' in profile['_id']:
self.logger.info(profile['bio'])
return 600
resp = self.request('/like/%s' % profile['_id'])
if resp['match']:
self.logger.error('Match with %s!' % profile['name'])
else:
self.logger.info('Liked %s (%r)' % (profile['name'], profile['common_likes']))
if len(self.recs) > 0:
return 1
else:
return 60
......@@ -58,11 +58,12 @@ def is_running(self):
return self._view_cron is not None
def view_profile(self):
next_try = 1
try:
self._browser.like_profile()
next_try = self._browser.like_profile()
finally:
if self._view_cron is not None:
self._view_cron = self._sched.schedule(1, self.view_profile)
self._view_cron = self._sched.schedule(next_try, self.view_profile)
class TinderModule(Module, CapMessages, CapMessagesPost, CapDating):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment