I am using this library to get posts of hashtags. I am making an API using Flask, it works fine locally but when i host it on azures web services. I get an error . Please find the error below:
/appsvctmp/volatile/logs/runtime/d5f92bf973d20675b79fc2f3d9f3bedabeeb8b3f669735dc97125d57a71f61f8.log
2022-05-10T06:35:00.007156779Z: [ERROR] File "/tmp/8da31ca160dbd85/antenv/lib/python3.9/site-packages/instagrapi/private.py", line 298, in private_request
2022-05-10T06:35:00.007160779Z: [ERROR] raise e
2022-05-10T06:35:00.007165779Z: [ERROR] File "/tmp/8da31ca160dbd85/antenv/lib/python3.9/site-packages/instagrapi/private.py", line 285, in private_request
2022-05-10T06:35:00.007169880Z: [ERROR] self._send_private_request(endpoint, kwargs)
2022-05-10T06:35:00.007185280Z: [ERROR] File "/tmp/8da31ca160dbd85/antenv/lib/python3.9/site-packages/instagrapi/private.py", line 231, in _send_private_request
2022-05-10T06:35:00.007205681Z: [ERROR] raise ClientThrottledError(e, response=e.response, last_json)
2022-05-10T06:35:00.007209481Z: [ERROR] instagrapi.exceptions.ClientThrottledError: Please wait a few minutes before you try again.
2022-05-10T06:35:00.016250483Z: [INFO] 172.16.2.5 - - [10/May/2022:06:35:00 +0000] "GET /api/instagrapy?query=lebanon HTTP/1.1" 500 265 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36"
2022-05-10T06:38:06.762997087Z: [INFO] 172.16.2.5 - - [10/May/2022:06:38:06 +0000] "GET / HTTP/1.1" 200 24 "-" "AlwaysOn"
2022-05-10T06:43:06.985525660Z: [INFO] 172.16.2.5 - - [10/May/2022:06:43:06 +0000] "GET / HTTP/1.1" 200 24 "-" "AlwaysOn"
Ending Log Tail of existing logs ---
Starting Live Log Stream ---
2022-05-10T06:44:49.815446274Z: [ERROR] Status 429: Too many requests
2022-05-10T06:44:49.815501676Z: [ERROR] [2022-05-10 06:44:49,813] ERROR in app: Exception on /api/instagrapy [GET]
2022-05-10T06:44:49.815509376Z: [ERROR] Traceback (most recent call last):
2022-05-10T06:44:49.815514277Z: [ERROR] File "/tmp/8da31ca160dbd85/antenv/lib/python3.9/site-packages/instagrapi/private.py", line 176, in _send_private_request
2022-05-10T06:44:49.815519277Z: [ERROR] response.raise_for_status()
2022-05-10T06:44:49.815523877Z: [ERROR] File "/tmp/8da31ca160dbd85/antenv/lib/python3.9/site-packages/requests/models.py", line 960, in raise_for_status
2022-05-10T06:44:49.815528777Z: [ERROR] raise HTTPError(http_error_msg, response=self)
2022-05-10T06:44:49.815533477Z: [ERROR] requests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url: https://i.instagram.com/api/v1/accounts/get_prefill_candidates/
2022-05-10T06:44:49.815538277Z: [ERROR]
2022-05-10T06:44:49.815542678Z: [ERROR] During handling of the above exception, another exception occurred:
2022-05-10T06:44:49.815547178Z: [ERROR]
2022-05-10T06:44:49.815551378Z: [ERROR] Traceback (most recent call last):
2022-05-10T06:44:49.815555678Z: [ERROR] File "/tmp/8da31ca160dbd85/antenv/lib/python3.9/site-packages/flask/app.py", line 2073, in wsgi_app
2022-05-10T06:44:49.815560278Z: [ERROR] response = self.full_dispatch_request()
2022-05-10T06:44:49.815565278Z: [ERROR] File "/tmp/8da31ca160dbd85/antenv/lib/python3.9/site-packages/flask/app.py", line 1518, in full_dispatch_request
2022-05-10T06:44:49.815569878Z: [ERROR] rv = self.handle_user_exception(e)
2022-05-10T06:44:49.815574179Z: [ERROR] File "/tmp/8da31ca160dbd85/antenv/lib/python3.9/site-packages/flask/app.py", line 1516, in full_dispatch_request
2022-05-10T06:44:49.815578679Z: [ERROR] rv = self.dispatch_request()
2022-05-10T06:44:49.815583079Z: [ERROR] File "/tmp/8da31ca160dbd85/antenv/lib/python3.9/site-packages/flask/app.py", line 1502, in dispatch_request
2022-05-10T06:44:49.815587679Z: [ERROR] return self.ensure_sync(self.view_functions[rule.endpoint])(req.view_args)
2022-05-10T06:44:49.815592179Z: [ERROR] File "/tmp/8da31ca160dbd85/app.py", line 304, in instagrapy
2022-05-10T06:44:49.815596579Z: [ERROR] cl.login("omardatam", "-txnK9ZQ6Rn-W7W")
2022-05-10T06:44:49.815601180Z: [ERROR] File "/tmp/8da31ca160dbd85/antenv/lib/python3.9/site-packages/instagrapi/auth.py", line 185, in login
2022-05-10T06:44:49.815631481Z: [ERROR] self.pre_login_flow()
2022-05-10T06:44:49.815635781Z: [ERROR] File "/tmp/8da31ca160dbd85/antenv/lib/python3.9/site-packages/instagrapi/auth.py", line 22, in pre_login_flow
2022-05-10T06:44:49.815639881Z: [ERROR] self.get_prefill_candidates(True)
2022-05-10T06:44:49.815643781Z: [ERROR] File "/tmp/8da31ca160dbd85/antenv/lib/python3.9/site-packages/instagrapi/auth.py", line 44, in get_prefill_candidates
2022-05-10T06:44:49.815647781Z: [ERROR] return self.private_request(
2022-05-10T06:44:49.815651581Z: [ERROR] File "/tmp/8da31ca160dbd85/antenv/lib/python3.9/site-packages/instagrapi/private.py", line 298, in private_request
2022-05-10T06:44:49.815655681Z: [ERROR] raise e
2022-05-10T06:44:49.815660581Z: [ERROR] File "/tmp/8da31ca160dbd85/antenv/lib/python3.9/site-packages/instagrapi/private.py", line 285, in private_request
2022-05-10T06:44:49.815664782Z: [ERROR] self._send_private_request(endpoint, kwargs)
2022-05-10T06:44:49.815668582Z: [ERROR] File "/tmp/8da31ca160dbd85/antenv/lib/python3.9/site-packages/instagrapi/private.py", line 231, in _send_private_request
2022-05-10T06:44:49.815672682Z: [ERROR] raise ClientThrottledError(e, response=e.response, **last_json)
2022-05-10T06:44:49.815676582Z: [ERROR] instagrapi.exceptions.ClientThrottledError: Please wait a few minutes before you try again.
2022-05-10T06:44:49.819819019Z: [INFO] 172.16.2.5 - - [10/May/2022:06:44:49 +0000] "GET /api/instagrapy?query=lebanon HTTP/1.1" 500 265 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36"
2022-05-10T06:46:37 No new trace in the past 1 min(s).
2022-05-10T06:47:37 No new trace in the past 2 min(s).
2022-05-10T06:48:07.265275952Z: [INFO] 172.16.2.5 - - [10/May/2022:06:48:07 +0000] "GET / HTTP/1.1" 200 24 "-" "AlwaysOn"
I am using this library to get posts of hashtags. I am making an API using Flask, it works fine locally but when i host it on azures web services. I get an error . Please find the error below:
/appsvctmp/volatile/logs/runtime/d5f92bf973d20675b79fc2f3d9f3bedabeeb8b3f669735dc97125d57a71f61f8.log 2022-05-10T06:35:00.007156779Z: [ERROR] File "/tmp/8da31ca160dbd85/antenv/lib/python3.9/site-packages/instagrapi/private.py", line 298, in private_request 2022-05-10T06:35:00.007160779Z: [ERROR] raise e 2022-05-10T06:35:00.007165779Z: [ERROR] File "/tmp/8da31ca160dbd85/antenv/lib/python3.9/site-packages/instagrapi/private.py", line 285, in private_request 2022-05-10T06:35:00.007169880Z: [ERROR] self._send_private_request(endpoint, kwargs) 2022-05-10T06:35:00.007185280Z: [ERROR] File "/tmp/8da31ca160dbd85/antenv/lib/python3.9/site-packages/instagrapi/private.py", line 231, in _send_private_request 2022-05-10T06:35:00.007205681Z: [ERROR] raise ClientThrottledError(e, response=e.response, last_json) 2022-05-10T06:35:00.007209481Z: [ERROR] instagrapi.exceptions.ClientThrottledError: Please wait a few minutes before you try again. 2022-05-10T06:35:00.016250483Z: [INFO] 172.16.2.5 - - [10/May/2022:06:35:00 +0000] "GET /api/instagrapy?query=lebanon HTTP/1.1" 500 265 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36" 2022-05-10T06:38:06.762997087Z: [INFO] 172.16.2.5 - - [10/May/2022:06:38:06 +0000] "GET / HTTP/1.1" 200 24 "-" "AlwaysOn" 2022-05-10T06:43:06.985525660Z: [INFO] 172.16.2.5 - - [10/May/2022:06:43:06 +0000] "GET / HTTP/1.1" 200 24 "-" "AlwaysOn" Ending Log Tail of existing logs --- Starting Live Log Stream --- 2022-05-10T06:44:49.815446274Z: [ERROR] Status 429: Too many requests 2022-05-10T06:44:49.815501676Z: [ERROR] [2022-05-10 06:44:49,813] ERROR in app: Exception on /api/instagrapy [GET] 2022-05-10T06:44:49.815509376Z: [ERROR] Traceback (most recent call last): 2022-05-10T06:44:49.815514277Z: [ERROR] File "/tmp/8da31ca160dbd85/antenv/lib/python3.9/site-packages/instagrapi/private.py", line 176, in _send_private_request 2022-05-10T06:44:49.815519277Z: [ERROR] response.raise_for_status() 2022-05-10T06:44:49.815523877Z: [ERROR] File "/tmp/8da31ca160dbd85/antenv/lib/python3.9/site-packages/requests/models.py", line 960, in raise_for_status 2022-05-10T06:44:49.815528777Z: [ERROR] raise HTTPError(http_error_msg, response=self) 2022-05-10T06:44:49.815533477Z: [ERROR] requests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url: https://i.instagram.com/api/v1/accounts/get_prefill_candidates/ 2022-05-10T06:44:49.815538277Z: [ERROR] 2022-05-10T06:44:49.815542678Z: [ERROR] During handling of the above exception, another exception occurred: 2022-05-10T06:44:49.815547178Z: [ERROR] 2022-05-10T06:44:49.815551378Z: [ERROR] Traceback (most recent call last): 2022-05-10T06:44:49.815555678Z: [ERROR] File "/tmp/8da31ca160dbd85/antenv/lib/python3.9/site-packages/flask/app.py", line 2073, in wsgi_app 2022-05-10T06:44:49.815560278Z: [ERROR] response = self.full_dispatch_request() 2022-05-10T06:44:49.815565278Z: [ERROR] File "/tmp/8da31ca160dbd85/antenv/lib/python3.9/site-packages/flask/app.py", line 1518, in full_dispatch_request 2022-05-10T06:44:49.815569878Z: [ERROR] rv = self.handle_user_exception(e) 2022-05-10T06:44:49.815574179Z: [ERROR] File "/tmp/8da31ca160dbd85/antenv/lib/python3.9/site-packages/flask/app.py", line 1516, in full_dispatch_request 2022-05-10T06:44:49.815578679Z: [ERROR] rv = self.dispatch_request() 2022-05-10T06:44:49.815583079Z: [ERROR] File "/tmp/8da31ca160dbd85/antenv/lib/python3.9/site-packages/flask/app.py", line 1502, in dispatch_request 2022-05-10T06:44:49.815587679Z: [ERROR] return self.ensure_sync(self.view_functions[rule.endpoint])(req.view_args) 2022-05-10T06:44:49.815592179Z: [ERROR] File "/tmp/8da31ca160dbd85/app.py", line 304, in instagrapy 2022-05-10T06:44:49.815596579Z: [ERROR] cl.login("omardatam", "-txnK9ZQ6Rn-W7W") 2022-05-10T06:44:49.815601180Z: [ERROR] File "/tmp/8da31ca160dbd85/antenv/lib/python3.9/site-packages/instagrapi/auth.py", line 185, in login 2022-05-10T06:44:49.815631481Z: [ERROR] self.pre_login_flow() 2022-05-10T06:44:49.815635781Z: [ERROR] File "/tmp/8da31ca160dbd85/antenv/lib/python3.9/site-packages/instagrapi/auth.py", line 22, in pre_login_flow 2022-05-10T06:44:49.815639881Z: [ERROR] self.get_prefill_candidates(True) 2022-05-10T06:44:49.815643781Z: [ERROR] File "/tmp/8da31ca160dbd85/antenv/lib/python3.9/site-packages/instagrapi/auth.py", line 44, in get_prefill_candidates 2022-05-10T06:44:49.815647781Z: [ERROR] return self.private_request( 2022-05-10T06:44:49.815651581Z: [ERROR] File "/tmp/8da31ca160dbd85/antenv/lib/python3.9/site-packages/instagrapi/private.py", line 298, in private_request 2022-05-10T06:44:49.815655681Z: [ERROR] raise e 2022-05-10T06:44:49.815660581Z: [ERROR] File "/tmp/8da31ca160dbd85/antenv/lib/python3.9/site-packages/instagrapi/private.py", line 285, in private_request 2022-05-10T06:44:49.815664782Z: [ERROR] self._send_private_request(endpoint, kwargs) 2022-05-10T06:44:49.815668582Z: [ERROR] File "/tmp/8da31ca160dbd85/antenv/lib/python3.9/site-packages/instagrapi/private.py", line 231, in _send_private_request 2022-05-10T06:44:49.815672682Z: [ERROR] raise ClientThrottledError(e, response=e.response, **last_json) 2022-05-10T06:44:49.815676582Z: [ERROR] instagrapi.exceptions.ClientThrottledError: Please wait a few minutes before you try again. 2022-05-10T06:44:49.819819019Z: [INFO] 172.16.2.5 - - [10/May/2022:06:44:49 +0000] "GET /api/instagrapy?query=lebanon HTTP/1.1" 500 265 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36" 2022-05-10T06:46:37 No new trace in the past 1 min(s). 2022-05-10T06:47:37 No new trace in the past 2 min(s). 2022-05-10T06:48:07.265275952Z: [INFO] 172.16.2.5 - - [10/May/2022:06:48:07 +0000] "GET / HTTP/1.1" 200 24 "-" "AlwaysOn"