Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[instagram] InstagramStoriesExtractor. KeyError: 'reels_media' #5257

Closed
OriginOfAbsolution opened this issue Feb 29, 2024 · 5 comments
Closed

Comments

@OriginOfAbsolution
Copy link

[gallery-dl][debug] Version 1.26.8
[gallery-dl][debug] Python 3.11.1 - Windows-10-10.0.19045-SP0
[gallery-dl][debug] requests 2.28.1 - urllib3 1.26.13
[gallery-dl][debug] Configuration Files ['%USERPROFILE%\gallery-dl.conf']
[gallery-dl][debug] Starting DownloadJob for 'https://www.instagram.com/stories/msjennafischer'
[instagram][debug] Using InstagramStoriesExtractor for 'https://www.instagram.com/stories/msjennafischer'
[cookies][debug] Extracting cookies from C:\Users\USER\AppData\Roaming\Mozilla\Firefox\Profiles\ru8t6une.default-release\cookies.sqlite
[cookies][info] Extracted 1496 cookies from Firefox
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): www.instagram.com:443
[urllib3.connectionpool][debug] https://www.instagram.com:443 "GET /api/v1/users/web_profile_info/?username=msjennafischer HTTP/1.1" 200 41137
[instagram][debug] Sleeping 6.81 seconds (request)
[urllib3.connectionpool][debug] https://www.instagram.com:443 "GET /api/v1/feed/reels_media/?reel_ids=1479085453 HTTP/1.1" 200 26
[instagram][error] An unexpected error occurred: KeyError - 'reels_media'. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .
[instagram][debug]
Traceback (most recent call last):
File "C:\Program Files\Python311\Lib\site-packages\gallery_dl\job.py", line 127, in run
for msg in extractor:
File "C:\Program Files\Python311\Lib\site-packages\gallery_dl\extractor\instagram.py", line 65, in items
for post in self.posts():
^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\site-packages\gallery_dl\extractor\instagram.py", line 544, in posts
reels = self.api.reels_media(reel_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\site-packages\gallery_dl\extractor\instagram.py", line 692, in reels_media
return self._call(endpoint, params=params)["reels_media"]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
KeyError: 'reels_media'


Never happened before, this is the first time

@mikf
Copy link
Owner

mikf commented Feb 29, 2024

Your Firefox cookies have expired or something to that extend.

I can reproduce this error by disabling cookies:

$ gallery-dl https://www.instagram.com/stories/msjennafischer
instagram/msjennafischer/3313027909458592752.mp4
instagram/msjennafischer/3313524737879348680.mp4
instagram/msjennafischer/3313553871564445032.mp4
instagram/msjennafischer/3313633687433373278.mp4
instagram/msjennafischer/3313671356386255631.mp4

$ gallery-dl -o cookies="" https://www.instagram.com/stories/msjennafischer
[instagram][error] An unexpected error occurred: KeyError - 'reels_media'.

@OriginOfAbsolution
Copy link
Author

I think so. I relog my Instagram account and everything works well. I never got this error before, even If my cookies have expired. It was a different error, like "Redirect to login page..." to tell me that I need to relog again, not this error.

@matt38697778
Copy link

Your Firefox cookies have expired or something to that extend.

I can reproduce this error by disabling cookies:

$ gallery-dl https://www.instagram.com/stories/msjennafischer
instagram/msjennafischer/3313027909458592752.mp4
instagram/msjennafischer/3313524737879348680.mp4
instagram/msjennafischer/3313553871564445032.mp4
instagram/msjennafischer/3313633687433373278.mp4
instagram/msjennafischer/3313671356386255631.mp4

$ gallery-dl -o cookies="" https://www.instagram.com/stories/msjennafischer
[instagram][error] An unexpected error occurred: KeyError - 'reels_media'.

I have a similar issue and tried the example link, but I got the same error

Q:\Download\gallery-dl>gallery-dl https://www.instagram.com/stories/msjennafischer
[instagram][error] An unexpected error occurred: KeyError - 'reels_media'. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .

@Hrxn
Copy link
Contributor

Hrxn commented Mar 7, 2024

Are you running latest dev version?

@matt38697778
Copy link

I think so.

Microsoft Windows [Version 10.0.19045.4046]
(c) Microsoft Corporation. All rights reserved.

Q:\Download\gallery-dl>gallery-dl --version
1.26.8

Q:\Download\gallery-dl>gallery-dl https://www.instagram.com/stories/msjennafischer
[instagram][error] An unexpected error occurred: KeyError - 'reels_media'. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .

Q:\Download\gallery-dl>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants