coddingtonbear / python-myfitnesspal

Access your meal tracking data stored in MyFitnessPal programatically
MIT License
789 stars 138 forks source link

Authentication Error - Cookies #148

Closed SaarthShah closed 1 year ago

SaarthShah commented 1 year ago

Hi, I am getting this error while running myfitnesspal.client()

"MyfitnesspalLoginError: Could not access MyFitnessPal using the cookies provided by your browser. Are you sure you have logged in to MyFitnessPal using a browser on this computer?"

I am already logged into myfitnesspal on two different browsers, and this still doesn't seem to work. Can you help me with what I can do to make sure my cookies are visible to the package on both my machine and a google colab notebook.

hannahburkhardt commented 1 year ago

Try specifying the browser. For example:

import myfitnesspal
import browser_cookie3

client = myfitnesspal.Client(browser_cookie3.chrome())
SaarthShah commented 1 year ago

Try specifying the browser. For example:

import myfitnesspal
import browser_cookie3

client = myfitnesspal.Client(browser_cookie3.chrome())

This did not work for me, unfortunately. I am trying to use browser_cookie3 and browser_cookie3.load() does not seem to contain the myfitnesspal cookies. However, when I import the regular browsercookie module, it seems to have the myfitnesspal cookies.

SaarthShah commented 1 year ago

Got it to work, thanks a lot!