Errors with fetching iphone struct in highlights and story items
milana-94888u opened this issue · comments
Describe the bug
Trying to get items from a highlight (received with Instaloader.get_highlights
). When fetching iphone structure with previously logged in it raises an exception instaloader.exceptions.ConnectionException: JSON Query to api/v1/feed/reels_media/?reel_ids=highlight:17850423018138899: HTTP error code 401.
(17850423018138899 is the unique id of the highlight). The same problem with iphone structure appears when trying to fetch reels as it raises the identical error instaloader.exceptions.ConnectionException: JSON Query to api/v1/feed/reels_media/?reel_ids=1063213434: HTTP error code 401.
(1063213434 is the profile user id).
To Reproduce
- Create an Instaloader object with
iphone_support=True
(the context should support iphone) - Login into an existing instagram account
- Fetch any profile with highlights
- Fetch any of its highlights
- Try to get items from it
- e.g.
next(bot.get_highlights(profile)).get_items()
where bot is your Instaloader object and profile is the fetched profile
Expected behavior
InstaloaderContext.get_iphone_json
call that returns correct iphone structure
Error messages and tracebacks
JSON Query to api/v1/feed/reels_media/?reel_ids=highlight:17850423018138899: HTTP error code 401. [retrying; skip with ^C]
JSON Query to api/v1/feed/reels_media/?reel_ids=highlight:17850423018138899: HTTP error code 401. [retrying; skip with ^C]
Traceback (most recent call last):
File "/home/milana/.local/lib/python3.11/site-packages/instaloader/instaloadercontext.py", line 409, in get_json
raise ConnectionException("HTTP error code {}.".format(resp.status_code))
instaloader.exceptions.ConnectionException: HTTP error code 401.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/milana/.local/lib/python3.11/site-packages/instaloader/instaloadercontext.py", line 409, in get_json
raise ConnectionException("HTTP error code {}.".format(resp.status_code))
instaloader.exceptions.ConnectionException: HTTP error code 401.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/milana/.local/lib/python3.11/site-packages/instaloader/instaloadercontext.py", line 409, in get_json
raise ConnectionException("HTTP error code {}.".format(resp.status_code))
instaloader.exceptions.ConnectionException: HTTP error code 401.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/milana/.local/lib/python3.11/site-packages/instaloader/instaloadercontext.py", line 567, in get_iphone_json
response = self.get_json(path, params, 'i.instagram.com', tempsession, response_headers=response_headers)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/milana/.local/lib/python3.11/site-packages/instaloader/instaloadercontext.py", line 435, in get_json
return self.get_json(path=path, params=params, host=host, session=sess, _attempt=_attempt + 1,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/milana/.local/lib/python3.11/site-packages/instaloader/instaloadercontext.py", line 435, in get_json
return self.get_json(path=path, params=params, host=host, session=sess, _attempt=_attempt + 1,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/milana/.local/lib/python3.11/site-packages/instaloader/instaloadercontext.py", line 425, in get_json
raise ConnectionException(error_string) from err
instaloader.exceptions.ConnectionException: JSON Query to api/v1/feed/reels_media/?reel_ids=highlight:17850423018138899: HTTP error code 401.```
**Instaloader version**
4.10.3
**Additional context**
The similar problem first occurred on March 9th. At this date `InstaloaderContext.get_iphone_json` started to return an empty json structure unlike it acted before returned one filled with data. I tried to change an account but it didn't change the iphone structure problems. Other calls that require login are working normally so the problem is only with iphone support