mirror of
https://github.com/Second-Hand-Friends/kleinanzeigen-bot.git
synced 2026-03-12 10:31:50 +01:00
fix: auto-restart when captcha was encountered
This commit is contained in:
@@ -1196,6 +1196,8 @@ def main(args:list[str]) -> None:
|
||||
bot = KleinanzeigenBot()
|
||||
atexit.register(bot.close_browser_session)
|
||||
nodriver.loop().run_until_complete(bot.run(args))
|
||||
except CaptchaEncountered as ex:
|
||||
raise ex
|
||||
except Exception:
|
||||
error_handlers.on_exception(*sys.exc_info())
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ def on_exception(ex_type:type[BaseException] | None, ex_value:BaseException | No
|
||||
LOG.error(ex_value)
|
||||
else:
|
||||
LOG.error("%s: %s", ex_type.__name__, ex_value)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def on_sigint(_sig:int, _frame:FrameType | None) -> None:
|
||||
|
||||
Reference in New Issue
Block a user