coddingtonbear / python-myfitnesspal

Access your meal tracking data stored in MyFitnessPal programatically
MIT License
794 stars 136 forks source link

new error #80

Closed mcarlock1 closed 5 years ago

mcarlock1 commented 5 years ago

Unable to fetch user metadata; this may cause Myfitnesspal to behave incorrectly if you have logged-in with your e-mail address rather than your basic username; status 504

my program was working last week so this is a new error


JSONDecodeError Traceback (most recent call last)

in ----> 1 client = myfitnesspal.Client('username_example') 2 3 Day = client.get_date(begin_year, begin_month, begin_day) 4 Date = str(today) 5 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/myfitnesspal/client.py in __init__(self, username, password, login, unit_aware) 56 self.session = requests.Session() 57 if login: ---> 58 self._login() 59 60 @property /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/myfitnesspal/client.py in _login(self) 110 111 self._auth_data = self._get_auth_data() --> 112 self._user_metadata = self._get_user_metadata() 113 114 # authenticity token required for measurement set function. /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/myfitnesspal/client.py in _get_user_metadata(self) 161 ) 162 --> 163 return result.json()['item'] 164 165 def _get_full_name(self, raw_name): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/models.py in json(self, **kwargs) 894 # used. 895 pass --> 896 return complexjson.loads(self.text, **kwargs) 897 898 @property /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw) 346 parse_int is None and parse_float is None and 347 parse_constant is None and object_pairs_hook is None and not kw): --> 348 return _default_decoder.decode(s) 349 if cls is None: 350 cls = JSONDecoder /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py in decode(self, s, _w) 335 336 """ --> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end()) 338 end = _w(s, end).end() 339 if end != len(s): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py in raw_decode(self, s, idx) 353 obj, end = self.scan_once(s, idx) 354 except StopIteration as err: --> 355 raise JSONDecodeError("Expecting value", s, err.value) from None 356 return obj, end JSONDecodeError: Expecting value: line 1 column 1 (char 0)
corbanvilla commented 5 years ago

What did you do to fix? I'm having the same issue