-
-
Notifications
You must be signed in to change notification settings - Fork 608
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
WebAPI: Unable to get rhx_gis from init request #170
Comments
Your issue report does not conform to the issue template that has been specified for this repo: Please edit your issue to comply with the template requirement. This issue will be closed after 24 hours if no followup action is taken. [This comment is auto-generated. ref=notemplate] |
I'm getting the same issue. Using version 1.6.0, with instagram_web_api. |
Yes, the same issue. rhx_gis was expelled from IG response |
I've just run into the same issue and fixed it temporarily by using a static rhx_gis that I found online. Use something like this to get it working for now: rhx_gis = self._extract_rhx_gis(init_res_content) or "4f8732eb9ba7d1c8e8897a75d6474d4eb3f5279137431b2aafb71fafe2abe178" Edit: I've just tried using any string as a rhx_gis and everything still works neatly. |
I do not work with this library, but I also encountered this problem. With the help of js reverse, I seem to have found a solution. In sharedData data is output on the page. See field config->viewerId. It is now transmitted instead of rhx_gis. The string to form md5 looks like: in this way, sharedData fragment:
|
Based on two upper commenters: line 317 in client.py
Will solve the problem |
You can actually put any string there and it will work, you don't have to extract anything. I've tried that myself though. |
This works for Python 3
|
Had to make some changes to the code above to make it work:
b'tmp_str' is just the string 'tmp_str', which negates the point of generating one |
This is still an issue :) |
I've put the fix that @Mithorium suggested in a fork and made a pull request into the base repository. Take it or leave it but I hope this can be resolved soon! Instagram's changed their APIs out from under us before and it's always a bit of a fire drill getting them up and running again |
I'm still having this problem. I don't think the PR will be accepted though @thekensman , both lines of code added produce security issues in Codacy. |
Yes I'm not sure if there's a more secure fix to be had - the PR is there for convenience, or to inspire a more robust solution to replace it |
I've fixed this issue with creating new class and overwrite it's static method.
|
for some reasons @pourya2374 's code gives me an error. So I edited it slightly to fix this error: import hashlib
import string
import random
from instagram_web_api import Client
class MyClient(Client):
@staticmethod
def _extract_rhx_gis(html):
options = string.ascii_lowercase + string.digits
text = ''.join([random.choice(options) for _ in range(8)])
return hashlib.md5(text.encode()).hexdigest() |
This issue is still present, why isn't there any fix on the master branch yet? |
@javad94 it worked for me a few weeks but suddenly I'm getting the same error:
|
Getting same error as @pyinto |
@pyinto @reformedot Instagram does not allow sending a plain text password at |
I provided a fix with code from @javad94 |
@eracle I tried your fix, but as others described, now I'm getting:
Not sure how to fix per the |
No solutions ? i still have the same error as @agucova |
Here is the working solution as of 1 July, use MyClient instead of using the libraries class directly.
|
Please take a look at the code above. |
I'm sorry, but I'm being stupid. I don't know how to add cookies to them, I get an error.
In the line:
I'm just trying to create and make an example from here: |
well actually you have to remove the |
Hey guys, this is web enc_password api:
the secret_key have 200 times.
It returns: |
python 2.7 script version of @HashamGhuffary
|
I have the same issue. In on web mode and when I tried with Client() return rhx_gis error. Any solution? |
I'm a little confused? Where does this go? Does anything else need to be replaced so that the MyClient class will be used instead? |
@ajbenz18 you should put that at top of your script. |
Using this solution gave me a JSONDecodeError when using
Edit: It gives me the same error when logged in. |
you're better off using python 3.5 or 2.7 |
#enc_password = f"#PWD_INSTAGRAM_BROWSER:0:{time}:{self.password}" For others running into issues, please note these 2 lines in the code i posted above ^_^ the syntax for formatting password changes from 2.7 to 3.5 ... |
Ok, thanks! |
does this fix the issue or is it just better generally when using the package? |
Weere you able to get a solution? |
@Ladet02 |
it worked for me |
Please follow the guide below
x
into all the boxes [ ] relevant to your issue (==> [x] no spaces).Before submitting an issue, make sure you have:
Which client are you using?
instagram_private_api/
)instagram_web_api/
)Describe your issue
Hi everyone,
From today web api will report error "Unable to get rhx_gis from init request".
I researched about this issue in other projects, some suggest to remove rhx_gis and X-Instagram-GIS, I tried this solution, at first it could successfully login and call api, but later web api reported "instagram_web_api.errors.ClientBadRequestError". I had also processed the challenges from IG website, but still no success any more.
Would be very nice if someone finds how to fix this new change.
Thanks.
Paste the output of
python -V
here:Code:
Error/Debug Log:
The text was updated successfully, but these errors were encountered: