From e2d42807a2a3be4b7443a5c244e0445336d365b8 Mon Sep 17 00:00:00 2001 From: SayanthD <13906889+SayanthD@users.noreply.github.com> Date: Sun, 5 Feb 2023 13:13:21 +0530 Subject: [PATCH] Fixed downloading with location id --- instaloader/sectioniterator.py | 2 +- instaloader/structures.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/instaloader/sectioniterator.py b/instaloader/sectioniterator.py index 77816f2..b16f4dc 100644 --- a/instaloader/sectioniterator.py +++ b/instaloader/sectioniterator.py @@ -29,7 +29,7 @@ class SectionIterator(Iterator[T]): def _query(self, max_id: Optional[str] = None) -> Dict[str, Any]: pagination_variables = {"max_id": max_id} if max_id is not None else {} return self._sections_extractor( - self._context.get_json(self._query_path, params={"__a": 1, **pagination_variables}) + self._context.get_json(self._query_path, params={"__a": 1, "__d": "dis", **pagination_variables}) ) def __next__(self) -> T: diff --git a/instaloader/structures.py b/instaloader/structures.py index a3569c9..6f4b935 100644 --- a/instaloader/structures.py +++ b/instaloader/structures.py @@ -638,7 +638,7 @@ class Post: location_id = int(loc['id']) if any(k not in loc for k in ('name', 'slug', 'has_public_page', 'lat', 'lng')): loc.update(self._context.get_json("explore/locations/{0}/".format(location_id), - params={'__a': 1})['native_location_data']['location_info']) + params={'__a': 1, '__d': 'dis'})['native_location_data']['location_info']) self._location = PostLocation(location_id, loc['name'], loc['slug'], loc['has_public_page'], loc.get('lat'), loc.get('lng')) return self._location