dmaasland / lastpass-authenticator-export

221 stars 39 forks source link

Invalid literal for in() with base 10 #2

Closed ikwyl6 closed 2 years ago

ikwyl6 commented 3 years ago

Describe the Bug

When running script:

$ ./lastpass-authenticator-export.py -u ikwyl6@email.com

and enter my password, I get:

Traceback (most recent call last):
  File "/mnt/wd1000/BTSync/RPi conf files/dev/lastpass-authenticator-export/./lastpass-authenticator-export.py", line 176, in <module>
    main()
  File "/mnt/dev/lastpass-authenticator-export/./lastpass-authenticator-export.py", line 169, in main
    session, csrf, key = login(username, password, otp)
  File "/mnt/dev/lastpass-authenticator-export/./lastpass-authenticator-export.py", line 51, in login
    iteration_count = iterations(username)
  File "/mnt/dev/lastpass-authenticator-export/./lastpass-authenticator-export.py", line 32, in iterations
    iterations = int(r.text)
ValueError: invalid literal for int() with base 10: ''

When I tried to debug, I tried to print r.text from def iterations but it comes up as empty. When I print r.status_code that is equal to 420 https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#Unofficial_codes

Let me know if I can do anything to help solve. I'd really like to be able to get my QR codes!

dmaasland commented 3 years ago

Ah, hmm. It seems LastPass doesn't always return the iteration count. Could you do a git pull and try again?

ikwyl6 commented 3 years ago

I changed iterations = int(r.text) to iterations = int(float(r.text)) and this may have fixed it:

https://stackoverflow.com/questions/1841565/valueerror-invalid-literal-for-int-with-base-10