-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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 extractor error #391
Comments
Hello debagos,
debagos writes:
It looks like Facebook had changed the Instagram profile page. I get a **graphql** key-error all the time...
```
[gallery-dl][debug] Version 1.10.1
[gallery-dl][debug] Python 3.6.8 - Linux-4.18.0-25-generic-x86_64-with-Ubuntu-18.10-cosmic
[gallery-dl][debug] requests 2.22.0 - urllib3 1.22
[1/3] https://www.instagram.com/REDACTED/
[gallery-dl][debug] Starting DownloadJob for 'https://www.instagram.com/REDACTED/'
[gallery-dl][debug] Updating urllib3 ciphers
[instagram][debug] Using InstagramUserExtractor for 'https://www.instagram.com/REDACTED/'
[instagram][info] Logging in as REDACTED
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): www.instagram.com
[urllib3.connectionpool][debug] https://www.instagram.com:443 "GET /accounts/login/ HTTP/1.1" 200 9511
[urllib3.connectionpool][debug] https://www.instagram.com:443 "GET /web/__mid/ HTTP/1.1" 200 28
[urllib3.connectionpool][debug] https://www.instagram.com:443 "POST /accounts/login/ajax/ HTTP/1.1" 200 296
[urllib3.connectionpool][debug] https://www.instagram.com:443 "GET /REDACTED/ HTTP/1.1" 200 None
[instagram][error] An unexpected error occurred: KeyError - 'graphql'. 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 "/usr/local/lib/python3.6/dist-packages/gallery_dl/job.py", line 47, in run
for msg in self.extractor:
File "/usr/local/lib/python3.6/dist-packages/gallery_dl/extractor/instagram.py", line 36, in items
for data in self.instagrams():
File "/usr/local/lib/python3.6/dist-packages/gallery_dl/extractor/instagram.py", line 205, in _extract_profilepage
yield from self._extract_page(url, 'ProfilePage')
File "/usr/local/lib/python3.6/dist-packages/gallery_dl/extractor/instagram.py", line 169, in _extract_page
base_shared_data = shared_data['entry_data'][page_type][0]['graphql']
KeyError: 'graphql'
[2/3] [...]
```
Thank you for fixing, wish you a great day, yours sincerely.
JFTR, at least public profiles seems to work (if also a public profile
is problematic please share a possible non-redacted URL to reproduce
this issue).
If noone beat me I'll try to investigate further later this UTC evening
if I can find a private profile.
Thanks!
|
Leonardo Taccari writes:
[...]
JFTR, at least public profiles seems to work (if also a public profile
is problematic please share a possible non-redacted URL to reproduce
this issue).
If noone beat me I'll try to investigate further later this UTC evening
if I can find a private profile.
[...]
I couldn't reproduce it neither with a private profile (I have tried
both gallery-dl 1.10.1 and latest Git HEAD (on NetBSD/evbarm and Python
3.7, but probably that's not important)).
Can you please share more information?
At least by relooking at the verbose output
```
[gallery-dl][debug] Version 1.10.1
[gallery-dl][debug] Python 3.6.8 - Linux-4.18.0-25-generic-x86_64-with-Ubuntu-18.10-cosmic
[gallery-dl][debug] requests 2.22.0 - urllib3 1.22
[1/3] https://www.instagram.com/REDACTED/
[gallery-dl][debug] Starting DownloadJob for 'https://www.instagram.com/REDACTED/'
[gallery-dl][debug] Updating urllib3 ciphers
[instagram][debug] Using InstagramUserExtractor for 'https://www.instagram.com/REDACTED/'
[instagram][info] Logging in as REDACTED
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): www.instagram.com
[urllib3.connectionpool][debug] https://www.instagram.com:443 "GET /accounts/login/ HTTP/1.1" 200 9511
[urllib3.connectionpool][debug] https://www.instagram.com:443 "GET /web/__mid/ HTTP/1.1" 200 28
[urllib3.connectionpool][debug] https://www.instagram.com:443 "POST /accounts/login/ajax/ HTTP/1.1" 200 296
[urllib3.connectionpool][debug] https://www.instagram.com:443 "GET /REDACTED/ HTTP/1.1" 200 None
The `None' is unespected, i.e. getting the profile account should return
a response with several data.
I would expect as [.../3] something like:
[1/3] user: <your_username>
[...]
[2/3] email: <email>
[3/3] https://www.instagram.com/<private_profile>
[gallery-dl][debug] Starting DownloadJob for 'https://www.instagram.com/<private_profile>'
[instagram][debug] Using InstagramUserExtractor for 'https://www.instagram.com/<private_profile>'
[instagram][info] Logging in as <your_username>
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): www.instagram.com:443
[urllib3.connectionpool][debug] https://www.instagram.com:443 "GET /accounts/login/ HTTP/1.1" 200 9503
[urllib3.connectionpool][debug] https://www.instagram.com:443 "GET /web/__mid/ HTTP/1.1" 200 28
[urllib3.connectionpool][debug] https://www.instagram.com:443 "POST /accounts/login/ajax/ HTTP/1.1" 200 296
[urllib3.connectionpool][debug] https://www.instagram.com:443 "GET /<private_profile>/ HTTP/1.1" 200 18517
(That's when invoking gallery-dl as
`gallery-dl -u <your_username> -p <your_password> https://www.instagram.com/<private_profile>')
|
Actually it doesn't matter if public or private profile... Edit: |
debagos writes:
Actually it doesn't matter if public or private profile...
I started the same downloads again without authentication towards Instagram and it worked. So maybe the extractor isn't causing the problem here.
I reckon that the problem is cause by my password.
It contains a apostrophe and it was easier to use a config which contains the username and password, than escaping the apostrophe successfully. That's why I don't use the `-u <your_username> -p <your_password>` method. I use `--config <path>` instead.
My method worked fine for weeks, but now it seems like I'm not logged in anymore through Gallery-DL...
Can you please retry to login again via the web browser and then retry
to gallery-dl a profile as authenticated user?
At least after a couple of logins it seems that - when logging via the
web browser - Instagram asks for a verification code that is sent via
email and then should be filled in the form when logging in.
I have never hit that via gallery-dl but this could explain the problem
you are seeing (that's just a wild guess though without inspecting the
responses).
|
I created a local copy of this repo and now I'm fiddling around, trying to find the cause...
in extractor/instagram.py |
@debagos Did you manage to find anything? Does this error still exist? If it does, could you add from .. import util
util.dump_json(shared_data)
exit() after
and post the output here? (Maybe use pastebin or similar if its too long) The contents of page might also be interesting.
|
Sorry, I'm pretty busy at the moment...
My assumption is that I am part of a canary/experimental group which gets a newer Instagram layout. My knowledge about python (or programming in general) is very low, so I am not able to resolve this problem by myself. Even if I post my |
Thank you for the detailed response!
This would be handled by first checking if it's the "old" layout, i.e. if there is a
Yes, I would really like to see in how your Instagram (data) layout differs from a "normal" one, so this can hopefully be fixed. You also don't have to post the contents of |
Maybe related: instaloader/instaloader#394 |
So in the last few days I have recently been getting this Commands typed in to the terminal
Below is the output.
|
The '_sharedData' of Post pages is missing its 'graphql' part for logged in users. This data is now included in the parameters of a function call to '__additionalDataLoaded(...)' And, of course, video extraction with youtube-dl broke because of this change as well.
My own account now also has the new "layout" for Post pages it seems, and I've managed to implement a fix (5fa6ff0). But, as the commit message says, video downloads when logged in no longer work. Disabling |
It looks like Facebook had changed the Instagram profile page. I get a graphql key-error all the time...
Thank you for fixing, wish you a great day, yours sincerely.
The text was updated successfully, but these errors were encountered: