Closed voxoff79 closed 1 year ago
Hey @voxoff79,
This should be fixed in the latest GitHub and PyPI versions (0.0.26).
thanks @official-antique, i manage to get it work but now only works the first time when i try to run the script again:
Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/instagrapi/mixins/public.py", line 130, in _send_public_request response.raise_for_status() File "/usr/local/lib/python3.10/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/explore/tags/xxxx/?__a=1&__d=dis
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/instagrapi/mixins/hashtag.py", line 418, in hashtag_medias_recent medias = self.hashtag_medias_recent_a1(name, amount) File "/usr/local/lib/python3.10/site-packages/instagrapi/mixins/hashtag.py", line 381, in hashtag_medias_recent_a1 return self.hashtag_medias_a1(name, amount, tab_key="edge_hashtag_to_media") File "/usr/local/lib/python3.10/site-packages/instagrapi/mixins/hashtag.py", line 220, in hashtag_mediasa1 medias, = self.hashtag_medias_a1_chunk(name, amount, tab_key) File "/usr/local/lib/python3.10/site-packages/instagrapi/mixins/hashtag.py", line 164, in hashtag_medias_a1_chunk data = self.public_a1_request( File "/usr/local/lib/python3.10/site-packages/instagrapi/mixins/public.py", line 173, in public_a1_request response = self.public_request( File "/usr/local/lib/python3.10/site-packages/instagrapi/mixins/public.py", line 91, in public_request raise e File "/usr/local/lib/python3.10/site-packages/instagrapi/mixins/public.py", line 74, in public_request return self._send_public_request(url, **kwargs) File "/usr/local/lib/python3.10/site-packages/instagrapi/mixins/public.py", line 163, in _send_public_request raise ClientError(e, response=e.response) instagrapi.exceptions.ClientError: 401 Client Error: Unauthorized for url: https://www.instagram.com/explore/tags/xxx/?__a=1&__d=dis
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/instagrapi/mixins/private.py", line 302, in _send_private_request response.raise_for_status() File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://i.instagram.com/api/v1/tags/oportobyfoot/sections/
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/xxx/Desktop/instaPy2/script.py", line 7, in
thnks in advance
@voxoff79 login_required usually means you'll have to delete the settings.json and relogin, it seems to be a bug with authentication I've also found with creating a post.
I'll probably have to add a function to do or check that.
yes, if i delete the settings.json file it works again but i need to re enter the verification code etc. Thanks.
That should only be needed once, once you have the new .json file you just need the username and password.
Yes but as you say "you'll have to delete the settings.json and relogin".
When i do that it works the first time (when the json file doesn't exists) then later when i try again to run the script it appears the error message instagrapi.exceptions.LoginRequired: login_required but in the beginning of the error message says [INFO]: Successfully logged in as: xxx
So it only works when the json files doesn't exists.
I hope this helps!
thnks
Hi @official-antique i'm getting this error can you help?
Traceback (most recent call last): File "/instaPy2/script.py", line 7, in
session.like(amount=10, iterable=['python'], type=LikeType.Tags)
File "/usr/local/lib/python3.11/site-packages/instapy2/instapy2.py", line 239, in like
medias = self.medias_tag(amount=amount, tag=tag, randomize_media=randomize_media, skip_top=skip_top)
^^^^^^^^^^^^^^^^^
AttributeError: 'InstaPy2' object has no attribute '_InstaPy2medias_tag'. Did you mean: '_InstaPy2Base__medias_tag'?
thanks for your work!