mr-karan / swiggy-analytics

Analyse your swiggy orders 🍔
MIT License
273 stars 37 forks source link

fails after entering phone number #11

Closed garrykevin-ep closed 10 months ago

garrykevin-ep commented 1 year ago

Connecting to /Users/gkevin/Library/Python/3.9/bin/swiggy.db
Traceback (most recent call last):
  File "/Users/gkevin/Library/Python/3.9/bin/swiggy-analytics", line 8, in <module>
    sys.exit(main())
  File "/Users/gkevin/Library/Python/3.9/lib/python/site-packages/swiggy_analytics/swiggy_analytics.py", line 72, in main
    perform_login()
  File "/Users/gkevin/Library/Python/3.9/lib/python/site-packages/swiggy_analytics/helper.py", line 116, in perform_login
    csrf_token = establish_connection.text.split("csrfToken")[1].split("=")[
IndexError: list index out of rang
``1
abhinavprao commented 1 year ago

same issue

4razKhan commented 1 year ago

Still getting the same error:

C:\Users\XX>swiggy-analytics --save Welcome to swiggy-analytics.

This command line tool will help you fetch your order history from https://swiggy.com. You can choose to persist the detailed order information in a SQLite database or perform lightweight stats operations using in-memory calculations.

Connecting to C:\Users\XX\swiggy.db Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "C:\Users\XX\AppData\Local\Programs\Python\Python311\Scripts\swiggy-analytics.exe__main__.py", line 7, in File "C:\Users\XX\AppData\Local\Programs\Python\Python311\Lib\site-packages\swiggy_analytics\swiggy_analytics.py", line 72, in main perform_login() File "C:\Users\XX\AppData\Local\Programs\Python\Python311\Lib\site-packages\swiggy_analytics\helper.py", line 116, in perform_login csrf_token = establish_connection.text.split("csrfToken")[1].split("=")[


IndexError: list index out of range
leovarmak commented 1 year ago

@mr-karan Karan, any luck with this issue?

aswwwanth commented 10 months ago

Faced the same issue. But I am able to run if I build from the source locally and install it, instead of the package published on PyPi.

@mr-karan I think the issue is with user-agent, if a user-agent is not provided swiggy is returning a standard error page which says "We are fixing a temporary glitch. Sorry for the inconvenience." without a csrf-token. The last PyPi release was on Apr 28, 2019 and doesn't have the commit 58023827eb6f0ae38a353465d9bb7292e27daa88 which adds user-agent header in all the requests. Hence it's working when installed from a local build and not from PyPi. Will you be able to push a new release to PyPi?

mr-karan commented 10 months ago

This should be fine now with the latest release