-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KeyError: 'dehydrated state' #183
Comments
I can't reproduce the issue. Can you provide a more detailed example? What are the weights that you are expecting to be returned? |
import os.path Initialize MyFitnessPal client with Chrome cookiesclient = myfitnesspal.Client(browser_cookie3.chrome()) Define the start date as today and go back 8 daysend_date = datetime.date.today() data = [] Loop over the range of dates and collect totals for each dayfor single_date in (start_date + datetime.timedelta(n) for n in range(8)):
Convert the data list to a DataFramedf = pd.DataFrame(data) Google Sheets API integrationSCOPES = ["https://www.googleapis.com/auth/spreadsheets"] The ID of the target spreadsheet.SPREADSHEET_ID = "" def get_start_position(service, spreadsheet_id, target_date):
def main():
if name == 'main': This is the script I'm using, I'm essentially trying to get the date, weight, fat, carbs, protein, and calories for the past seven days off of MFP. I'm not sure what the "dehydrated state" issue even is. If I get rid of the try except block I get this error: Traceback (most recent call last): Seems like there's something in the client.py around "dehydratedState"? No idea what that means or how to fix that. |
I second that. it only happened from yesterday onwards - it relates to getting a weight measurement. |
Has anyone come across this before?
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'
Seems like an issue with client.py, any way to debug or fix this?
The text was updated successfully, but these errors were encountered: