coddingtonbear / python-myfitnesspal

Access your meal tracking data stored in MyFitnessPal programatically
MIT License
797 stars 139 forks source link

What's the best way to persist programmatic access to myfitnesspal? #149

Closed dkvdm closed 1 year ago

dkvdm commented 1 year ago

I've moved to 2.0.0 some time ago, and I'm aware that browser login is utilized to create a cookiejar for python-myfitnesspal use. However, what's the best way to ensure continued use if (for example) this is deployed on a headless machine? So far I've solved it by creating a script that generates a cookie jar by pickle.dump(client.session.cookies,filehandler) to dump the cookiejar to file, and myfitnesspal.Client(cookiejar=jar) on the other side to load and unpickle the cookiejar from file.

That being said, I'm still getting frequent auth issues...is there any way to extend login session time? Thanks and a happy new year!