question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Login now includes a hidden captcha that prevents python-myfitnesspal from logging-in

See original GitHub issue

Morning,

I wonder if something API-side has changed? Up to last night I was connecting fine, now this:

Traceback (most recent call last):
  File "/home/andy/MFP/importmyfitnesspal.py", line 19, in <module>
    client = myfitnesspal.Client('############', password='###################')
  File "/usr/local/lib/python3.10/dist-packages/myfitnesspal/client.py", line 80, in __init__
    self._login()
  File "/usr/local/lib/python3.10/dist-packages/myfitnesspal/client.py", line 132, in _login
    raise MyfitnesspalLoginError()

Any thoughts?

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
coddingtonbearcommented, Aug 27, 2022

OK… good and bad news!

The good news is that I’ve updated this library such that it’s again able to access MyFitnessPal on your behalf. You can find those changes in version 2.0.0 of this library.

The bad news is that, as you might guess from the major version bump, the way we access login credentials had to be changed in ways that may limit how useful this library is to you. I’m really sorry about that, but I don’t see an alternative at the moment.

Now that MyFitnessPal has added a hidden captcha to their log in flow, this library will no longer be able to log in directly in the manner it was historically doing so. Instead, this library now uses the browser_cookie3 library for gathering cookies from your local browser for use when interacting with MyFitnessPal.

To be a little more concrete:

  • Before: you could store a username and password combination in your system keyring, or provide a username and password combination directly to this library for use when interacting with MyFitnessPal.
  • Now: you must log in to MyFitnessPal using an actual real-life browser in the same environment as you would use this library, and this library will find the credentials your browser stored after logging-in for use when interacting with MyFitnessPal.

If any of you have any clever ideas of other ways of getting around this limitation, I’d love to hear them!

Cheers & good luck!

1reaction
coddingtonbearcommented, Aug 27, 2022

You can absolutely instantiate your own cookiejar and hand it directly to myfitnesspal.Client – just import the class from http.cookiejar.CookieJar and set the cookies you need. See the cookiejar parameter on the client here: https://python-myfitnesspal.readthedocs.io/en/latest/api/client.html.

Unfortunately, though, you’re still going to need to log-in in an actual browser somewhere to find your session token given that the log-in flow has that invisible captcha. There is unfortunately no avenue forward via which we can return to accepting a username/password combination directly as we were before while a captcha is present.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python-myfitnesspal/changelog.markdown at master
Now uses the browser_cookie3 library for gathering log in credentials ... to the recent addition of a hidden captcha in the log-in flow...
Read more >
python - Trying to log in to MyFitnessPal via requests
Try this: r = requests.get('https://www.myfitnesspal.com/account/login', auth= ('email', 'password')). I got a 200 response wit this.
Read more >
Recaptcha is not working for myfitnesspal.com
The recaptcha will not complete on myfitnesspal.com. ... Go to myfitnesspal.com; Attempt to log in; The recaptcha fails.
Read more >
eKP - River Thames Conditions - Environment Agency - GOV.UK
#bachdim Alkaan, Paris sg malmo, Chill out mix download free, Natalia ginzburg interview, Emevi camisinin son hali, Chi5 chayeb mp3, 56 minutes from...
Read more >
Untitled
Susanne iwarsson, 4-14-1 formation, Victim 2011 film cast, Cmake if string contains, It audit vs risk assessment, Stefan raab markus kuhn, Federacion golf ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found