You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've had a great experience getting macros out of MFP via the MFP library, but getting weight (via get_measurements) has been really difficult for me. I'll be able to get weight for a day or so and then I'll hit this issue:
Traceback (most recent call last):
File "/Users/shreyasnatesan/Documents/python/get_weight.py", line 7, in
weight = client.get_measurements("Weight")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/shreyasnatesan/Desktop/NucampFolder/Python/1-Fundamentals/myenv/lib/python3.12/site-packages/myfitnesspal/client.py", line 615, in get_measurements
measurement_ids = self._get_measurement_ids(document)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/shreyasnatesan/Desktop/NucampFolder/Python/1-Fundamentals/myenv/lib/python3.12/site-packages/myfitnesspal/client.py", line 741, in _get_measurement_ids
for q in next_data_json["props"]["pageProps"]["dehydratedState"]["queries"]:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
KeyError: 'dehydratedState'
Using scripts inclusive of what we see here:
import myfitnesspal
import browser_cookie3
from datetime import date,timedelta
That happens to me periodically. Logging out, clearing cookies and trying a couple of times usually works (or wastes time while the problem fixes itself). It's probably and issue with MFP rather than you or the library.
Hey all,
I've had a great experience getting macros out of MFP via the MFP library, but getting weight (via get_measurements) has been really difficult for me. I'll be able to get weight for a day or so and then I'll hit this issue:
Traceback (most recent call last):
File "/Users/shreyasnatesan/Documents/python/get_weight.py", line 7, in
weight = client.get_measurements("Weight")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/shreyasnatesan/Desktop/NucampFolder/Python/1-Fundamentals/myenv/lib/python3.12/site-packages/myfitnesspal/client.py", line 615, in get_measurements
measurement_ids = self._get_measurement_ids(document)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/shreyasnatesan/Desktop/NucampFolder/Python/1-Fundamentals/myenv/lib/python3.12/site-packages/myfitnesspal/client.py", line 741, in _get_measurement_ids
for q in next_data_json["props"]["pageProps"]["dehydratedState"]["queries"]:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
KeyError: 'dehydratedState'
Using scripts inclusive of what we see here:
import myfitnesspal
import browser_cookie3
from datetime import date,timedelta
client = myfitnesspal.Client(browser_cookie3.chrome())
weight = client.get_measurements("Weight")
print(weight)
I'm not sure what I'm doing wrong or if this is an issue with the library itself...
The text was updated successfully, but these errors were encountered: