mirror of
https://github.com/instaloader/instaloader.git
synced 2024-07-14 23:00:06 +02:00
Fixed fetching a users profile information (#1561)
* fixed fetching a users profile information switched to new api/v1/users/web_profile_info/?username=xy endpoint * fixed non existing users thanks to @Dibort for fixing this!
This commit is contained in:
parent
5a24064012
commit
90cfeaf471
@ -764,8 +764,11 @@ class Profile:
|
|||||||
def _obtain_metadata(self):
|
def _obtain_metadata(self):
|
||||||
try:
|
try:
|
||||||
if not self._has_full_metadata:
|
if not self._has_full_metadata:
|
||||||
metadata = self._context.get_json('{}/feed/'.format(self.username), params={})
|
metadata = self._context.get_iphone_json(f'api/v1/users/web_profile_info/?username={self.username}',
|
||||||
self._node = metadata['entry_data']['ProfilePage'][0]['graphql']['user']
|
params={})
|
||||||
|
if metadata['data']['user'] is None:
|
||||||
|
raise ProfileNotExistsException('Profile {} does not exist.'.format(self.username))
|
||||||
|
self._node = metadata['data']['user']
|
||||||
self._has_full_metadata = True
|
self._has_full_metadata = True
|
||||||
except (QueryReturnedNotFoundException, KeyError) as err:
|
except (QueryReturnedNotFoundException, KeyError) as err:
|
||||||
top_search_results = TopSearchResults(self._context, self.username)
|
top_search_results = TopSearchResults(self._context, self.username)
|
||||||
|
Loading…
Reference in New Issue
Block a user