diff --git a/flanabot/bots/ubereats_bot.py b/flanabot/bots/ubereats_bot.py index 2b24e99..7b53c53 100644 --- a/flanabot/bots/ubereats_bot.py +++ b/flanabot/bots/ubereats_bot.py @@ -55,9 +55,11 @@ class UberEatsBot(MultiBot, ABC): for i, cookies in enumerate(chat.ubereats['cookies']): for _ in range(3): try: - self.task_contexts[chat.id]['browser'] = await self.task_contexts[chat.id]['playwright'].chromium.launch() - context: playwright.async_api.BrowserContext = await self.task_contexts[chat.id]['browser'].new_context() - await context.add_cookies(cookies) + self.task_contexts[chat.id]['browser'] = await self.task_contexts[chat.id]['playwright'].chromium.launch(headless=False) + context: playwright.async_api.BrowserContext = await self.task_contexts[chat.id]['browser'].new_context( + storageState={'cookies': cookies}, + user_agent=flanautils.USER_AGENT + ) page = await context.new_page() await page.goto('https://www.myunidays.com/ES/es-ES/partners/ubereats/access/online')