profiles: First load profilepic, then save json

This way, the iphone_struct information is included in saved profile pictures.
This commit is contained in:
Alexander Graf 2019-01-24 22:40:36 +01:00
parent e39ffecea4
commit 34416298a0

View File

@ -898,6 +898,11 @@ class Instaloader:
with error_handler(profile.username):
profile_name = profile.username
# Download profile picture
if profile_pic:
with self.context.error_catcher('Download profile picture of {}'.format(profile_name)):
self.download_profilepic(profile)
# Save metadata as JSON if desired.
if self.save_metadata:
json_filename = '{0}/{1}_{2}'.format(self.dirname_pattern.format(profile=profile_name,
@ -905,11 +910,6 @@ class Instaloader:
profile_name, profile.userid)
self.save_metadata_json(json_filename, profile)
# Download profile picture
if profile_pic:
with self.context.error_catcher('Download profile picture of {}'.format(profile_name)):
self.download_profilepic(profile)
# Catch some errors
if profile.is_private and (tagged or highlights or posts):
if not self.context.is_logged_in: