1
0
mirror of https://github.com/instaloader/instaloader.git synced 2024-08-18 04:39:39 +02:00

Fix a KeyError when fetching post metadata fails

Fixes #824.
This commit is contained in:
Alexander Graf 2020-11-13 11:20:31 +01:00
parent f4ecfea64c
commit 74f7970b50

View File

@ -147,10 +147,6 @@ class Post:
)
self._full_metadata_dict = pic_json['data']['shortcode_media']
if self._full_metadata_dict is None:
# issue #449
self._context.error("Fetching Post metadata failed (issue #449). "
"The following data has been returned:\n"
+ json.dumps(pic_json['entry_data'], indent=2))
raise BadResponseException("Fetching Post metadata failed.")
if self.shortcode != self._full_metadata_dict['shortcode']:
self._node.update(self._full_metadata_dict)