subzeroid / instagrapi

🔥 The fastest and powerful Python library for Instagram Private API 2024
https://hikerapi.com/p/bkXQlaVe
MIT License
4.22k stars 667 forks source link

mention people in post[BUG] #1512

Closed erftube closed 1 year ago

erftube commented 1 year ago

Describe the bug tried to use mention feature

Traceback Traceback (most recent call last): File "C:\Users\Erfan\Desktop\instagram_register\IgBot\instagrapi\mixins\public.py", line 168, in _send_public_request response.raise_for_status() File "C:\Users\Erfan\Desktop\instagram_register\venv\Lib\site-packages\requests\models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://www.instagram.com/erftube/?__a=1&__d=dis

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\Erfan\Desktop\instagram_register\IgBot\instagrapi\mixins\user.py", line 192, in user_info_by_username user = self.user_info_by_username_gql(username) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Erfan\Desktop\instagram_register\IgBot\instagrapi\mixins\user.py", line 145, in user_info_by_username_gql return extract_user_gql(self.public_a1_request(f"/{username!s}/")["user"]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Erfan\Desktop\instagram_register\IgBot\instagrapi\mixins\public.py", line 213, in public_a1_request response = self.public_request( ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Erfan\Desktop\instagram_register\IgBot\instagrapi\mixins\public.py", line 123, in public_request raise e File "C:\Users\Erfan\Desktop\instagram_register\IgBot\instagrapi\mixins\public.py", line 100, in public_request return self._send_public_request(url, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Erfan\Desktop\instagram_register\IgBot\instagrapi\mixins\public.py", line 201, in _send_public_request raise ClientError(e, response=e.response) instagrapi.exceptions.ClientError: 401 Client Error: Unauthorized for url: https://www.instagram.com/erftube/?__a=1&__d=dis

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\Erfan\Desktop\instagram_register\venv\Lib\site-packages\urllib3\response.py", line 710, in _error_catcher yield File "C:\Users\Erfan\Desktop\instagram_register\venv\Lib\site-packages\urllib3\response.py", line 814, in _raw_read data = self._fp_read(amt) if not fp_closed else b"" ^^^^^^^^^^^^^^^^^^ File "C:\Users\Erfan\Desktop\instagram_register\venv\Lib\site-packages\urllib3\response.py", line 799, in _fp_read return self._fp.read(amt) if amt is not None else self._fp.read() ^^^^^^^^^^^^^^^^^^ File "C:\Users\Erfan\AppData\Local\Programs\Python\Python311\Lib\http\client.py", line 465, in read s = self.fp.read(amt) ^^^^^^^^^^^^^^^^^ File "C:\Users\Erfan\AppData\Local\Programs\Python\Python311\Lib\socket.py", line 706, in readinto return self._sock.recv_into(b) ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Erfan\AppData\Local\Programs\Python\Python311\Lib\ssl.py", line 1278, in recv_into return self.read(nbytes, buffer) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Erfan\AppData\Local\Programs\Python\Python311\Lib\ssl.py", line 1134, in read return self._sslobj.read(len, buffer) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ssl.SSLError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2546)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "C:\Users\Erfan\Desktop\instagram_register\venv\Lib\site-packages\requests\models.py", line 816, in generate yield from self.raw.stream(chunk_size, decode_content=True) File "C:\Users\Erfan\Desktop\instagram_register\venv\Lib\site-packages\urllib3\response.py", line 940, in stream data = self.read(amt=amt, decode_content=decode_content) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Erfan\Desktop\instagram_register\venv\Lib\site-packages\urllib3\response.py", line 879, in read data = self._raw_read(amt) ^^^^^^^^^^^^^^^^^^^ File "C:\Users\Erfan\Desktop\instagram_register\venv\Lib\site-packages\urllib3\response.py", line 813, in _raw_read with self._error_catcher(): File "C:\Users\Erfan\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 155, in exit self.gen.throw(typ, value, traceback) File "C:\Users\Erfan\Desktop\instagram_register\venv\Lib\site-packages\urllib3\response.py", line 721, in _error_catcher raise SSLError(e) from e urllib3.exceptions.SSLError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2546)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\Erfan\Desktop\instagram_register\IgBot\instagrapi\mixins\private.py", line 346, in _send_private_request response = self.private.get( ^^^^^^^^^^^^^^^^^ File "C:\Users\Erfan\Desktop\instagram_register\venv\Lib\site-packages\requests\sessions.py", line 602, in get return self.request("GET", url, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Erfan\Desktop\instagram_register\venv\Lib\site-packages\requests\sessions.py", line 589, in request resp = self.send(prep, send_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Erfan\Desktop\instagram_register\venv\Lib\site-packages\requests\sessions.py", line 747, in send r.content File "C:\Users\Erfan\Desktop\instagram_register\venv\Lib\site-packages\requests\models.py", line 899, in content self._content = b"".join(self.iter_content(CONTENT_CHUNK_SIZE)) or b"" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Erfan\Desktop\instagram_register\venv\Lib\site-packages\requests\models.py", line 824, in generate raise RequestsSSLError(e) requests.exceptions.SSLError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2546)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\Erfan\Desktop\instagram_register\IgBot\action_test_post.py", line 534, in erftube = cl.user_info_by_username('erftube') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Erfan\Desktop\instagram_register\IgBot\instagrapi\mixins\user.py", line 200, in user_info_by_username user = self.user_info_by_username_v1(username) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Erfan\Desktop\instagram_register\IgBot\instagrapi\mixins\user.py", line 169, in user_info_by_username_v1 raise e File "C:\Users\Erfan\Desktop\instagram_register\IgBot\instagrapi\mixins\user.py", line 163, in user_info_by_username_v1 result = self.private_request(f"users/{username}/usernameinfo/") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Erfan\Desktop\instagram_register\IgBot\instagrapi\mixins\private.py", line 533, in private_request raise e File "C:\Users\Erfan\Desktop\instagram_register\IgBot\instagrapi\mixins\private.py", line 518, in private_request self._send_private_request(endpoint, **kwargs) File "C:\Users\Erfan\Desktop\instagram_register\IgBot\instagrapi\mixins\private.py", line 459, in _send_private_request raise ClientConnectionError("{e.class.name} {e}".format(e=e)) instagrapi.exceptions.ClientConnectionError: SSLError [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2546)

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

adw0rd commented 1 year ago

instagrapi.exceptions.ClientConnectionError: SSLError [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2546)

You have connection problems, perhaps with the ISP, proxy provider or instagram has limited you. This is not an Instagrapi bug