marclave / InstaBot

A simple Instagram bot written in Python
199 stars 74 forks source link

OAuthRateLimitException is thrown after 30 liked images #5

Open fro35i opened 10 years ago

fro35i commented 10 years ago

After I liked 30 images, I get the following error message: {"meta":{"error_type":"OAuthRateLimitException","code":429,"error_message":"The maximum number of requests per hour has been exceeded. You have made 38 requests of the 30 allowed in the last hour."}}

So it seems that only 30 requests are allowed in one hour? Does instagram have such a bad request limitation now or does the limitation of unsigned requests might be the problem?

marclave commented 10 years ago

Hi fro35i, I am signing the requests with the header, I do not know why we are getting this limitation http://instagram.com/developer/restrict-api-requests/# because in my latest commit f4523880f93c04066bdb7a7bb5eca3f5ea06087f I have signed and requested the correct header request. As stated previously, I will be investigating tonight, let me know if you find anything. Thanks

guygnarly commented 10 years ago

I found this information on a forum which may assist, but I'm really not positive. However, it may be something to look into:

"I've discovered what it most likely is. You're using webbrowser bots, or at least your bot is sending requests to Websta.me website, instead of actually sending the requests directly to IG's API. I did some reading on their Limits page in the Developer section of their site and read that unsigned requests (requests not send from the website where the access token was gained) will be even more limited than unsigned requests. But the thing is, I don't think I can bypass this because it requires a header called "X-Insta-Forwarded-For" which requires both the website IP and their client secret. However, I can always just send requests to websites like iconosquare, etc."

marclave commented 10 years ago

Hi GuyGnarly, the bot is sending requests through Instagrams API, the only interaction with Websta.me is the parsing of the top 100 hastags. Notice in the source code I have a function called encodeAndRequest; this function adds the header with the request

visualrealityink commented 9 years ago

I too am experiencing this issue. {"meta":{"error_type":"OAuthRateLimitException","code":429,"error_message":"The maximum number of requests per hour has been exceeded. You have made 32 requests of the 30 allowed in the last hour."}}SOMETHING WENT WRONG 429

visualrealityink commented 9 years ago

Hi marclave, I do see where you are using the instagram API, if I am not mistaken the problem is due to the fact that the "accesstoken" is not being pulled from within your application from the instagram API. You require us to set it in profile.yml therefore this makes the request "unsigned". I believe you need to establish a connection with the instagram API and request a new "accesstoken" and extract it from the returned url every 30 likes.

marclave commented 9 years ago

Hi visualrealityink, I see how that can be the issue, I will try and code this tonight(Just got out of a linear circuit lab), thanks!

visualrealityink commented 9 years ago

Hi marclave, No problem. Just to be safe I would request a new "accesstoken" every 25 to 27 likes that way you have a bit of padding ;) Let me know when you have posted the code and I will give a test run for you.

visualrealityink commented 9 years ago

Hi marclave,

If I can be of any help just let me know.

marclave commented 9 years ago

Hi visualrealityink,

Yeah this week is really busy for me but I will be able to work on it this weekend. If you want to branch and try a solution go for it. I think i need to re-write most of the structure of the present InstaBot but if you find a simple work around, great!

visualrealityink commented 9 years ago

I will fork it tonight and play with it. All you should need to do is write a function that gets a new instagram UR, strip the accesstoken code and use it.

visualrealityink commented 9 years ago

Hi marclave,

I have part of the solution already derrived. I am going to fork the project and upload my new additions. They are not complete. What I have done so far is pulled in https://github.com/Instagram/python-instagram and have gotten it to return the "access_token" what I have not gotten done yet is to have that token intigrated into your code. If we get that "access_token" that I am pulling from the "python-instagram" module and storing into your code that runs we should be set. I will have it forked in a few hours.

mko510 commented 9 years ago

Hi,

Any new updates in this thread?

jerryromel commented 9 years ago

Any update, would love to see progress @visualrealityink

jrefos1 commented 9 years ago

Hi,

Any new updates in this thread? the script stop working after 30 likes :( @visualrealityink @marclave

chinciusan commented 9 years ago

"the script stop working after 30 likes" -same issue for me

marclave commented 9 years ago

Hi everyone, I have not been updating this thread because i worked extensively on a fix but found no workaround, I know the 30 like limit is not enjoyable; however, I have been very busy and will try again next weekend. I will update this thread, thank you.

AyuReadyX commented 9 years ago

you think mechanize would be better for passing the hmac sig etc instead of pycurl? just a guess, i forked btw ill be doing some messing with it

ramiyahya commented 9 years ago

Hi Marclave,

Do you have any plans on fixing this issue?

marclave commented 9 years ago

@ramiyahya i have tried many approaches and no ideas really..

arvand commented 9 years ago

@marclave Can't you edit the code in a way so that the bot will like the pictures and follow users through webstagram?