Comments (9)
The issue you're having isn't from this module, its from basic python syntax you're not following. Please take the time to learn the basics of python for a week or month and you'll understand where I'm coming from.
from instagrapi.
As I said, you're asking very beginner questions, please learn Python. If you know Python then it's easy to understand example code and what it's trying to achieve, you don't need a full code example as that is not necessary, what is there is enough, any more is just redundant and unnecessary.
I'm not going to tell you what to do as you don't know Python, and you won't learn anything if I just give you the answer, at your level, you shouldn't just copy and paste code examples you don't understand.
Being a master at education doesn't make you know Python. Learning python makes you know python.
from instagrapi.
I change the code to this
cl.load_settings("session.json")
cl.get_timeline_feed() # check session, is valid. If it’s not valid, you’ll get an exception.
user_followers = cl.user_followers(cl.user_id)
print ("SIGUEN-->")
for user_id, user_info in user_followers.items():
username = user_info.username # Accede al username del usuario
print(user_id, username)
But give other error
`
Traceback (most recent call last):
File "C:\python310\lib\site-packages\instagrapi\mixins\public.py", line 165, in _send_public_request
response.raise_for_status()
File "C:\python310\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/graphql/query/?variables=%7B%22id%22%3A%221531580299%22%2C%22include_reel%22%3Atrue%2C%22fetch_mutual%22%3Afalse%2C%22first%22%3A12%2C%22after%22%3A%22QVFEUUdsMXhYc2hsQTlRVk9GV1ZTS3FPUEZIZkJIVUNaNk5YdWd2Z2g4emc5UlJfRURPdHdWQTRoc0QzcXhQUlg3TVpzNmNpUldWcTlzTjJUa1FqSzdSaQ%3D%3D%22%7D&query_hash=5aefa9893005572d237da5068082d8d5
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\python310\lib\site-packages\instagrapi\mixins\user.py", line 784, in user_followers
users = self.user_followers_gql(user_id, amount)
File "C:\python310\lib\site-packages\instagrapi\mixins\user.py", line 689, in user_followers_gql
users, _ = self.user_followers_gql_chunk(str(user_id), amount)
File "C:\python310\lib\site-packages\instagrapi\mixins\user.py", line 655, in user_followers_gql_chunk
data = self.public_graphql_request(
File "C:\python310\lib\site-packages\instagrapi\mixins\public.py", line 245, in public_graphql_request
body_json = self.public_request(
File "C:\python310\lib\site-packages\instagrapi\mixins\public.py", line 122, in public_request
raise e
File "C:\python310\lib\site-packages\instagrapi\mixins\public.py", line 99, in public_request
return self._send_public_request(url, **kwargs)
File "C:\python310\lib\site-packages\instagrapi\mixins\public.py", line 198, in _send_public_request
raise ClientError(e, response=e.response)
instagrapi.exceptions.ClientError: 401 Client Error: Unauthorized for url: https://www.instagram.com/graphql/query/?variables=%7B%22id%22%3A%221531580299%22%2C%22include_reel%22%3Atrue%2C%22fetch_mutual%22%3Afalse%2C%22first%22%3A12%2C%22after%22%3A%22QVFEUUdsMXhYc2hsQTlRVk9GV1ZTS3FPUEZIZkJIVUNaNk5YdWd2Z2g4emc5UlJfRURPdHdWQTRoc0QzcXhQUlg3TVpzNmNpUldWcTlzTjJUa1FqSzdSaQ%3D%3D%22%7D&query_hash=5aefa9893005572d237da5068082d8d5
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\python310\lib\site-packages\instagrapi\mixins\private.py", line 360, in _send_private_request
response.raise_for_status()
File "C:\python310\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://i.instagram.com/api/v1/friendships/1531580299/followers/?max_id=&count=200&rank_token=1531580299_4b7dc35c-c3cf-4773-b615-258bd40b2907&search_surface=follow_list_page&query=&enable_groups=true
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python37\archivos-pyhton-instagram\insta-2023.py", line 33, in
user_followers = cl.user_followers(cl.user_id)
File "C:\python310\lib\site-packages\instagrapi\mixins\user.py", line 788, in user_followers
users = self.user_followers_v1(user_id, amount)
File "C:\python310\lib\site-packages\instagrapi\mixins\user.py", line 755, in user_followers_v1
users, _ = self.user_followers_v1_chunk(str(user_id), amount)
File "C:\python310\lib\site-packages\instagrapi\mixins\user.py", line 717, in user_followers_v1_chunk
result = self.private_request(
File "C:\python310\lib\site-packages\instagrapi\mixins\private.py", line 535, in private_request
raise e
File "C:\python310\lib\site-packages\instagrapi\mixins\private.py", line 520, in private_request
self._send_private_request(endpoint, **kwargs)
File "C:\python310\lib\site-packages\instagrapi\mixins\private.py", line 459, in _send_private_request
raise ClientError(e, response=e.response, **last_json)
instagrapi.exceptions.ClientError: Please wait a few minutes before you try again.
`
from instagrapi.
from instagrapi.
I'm sorry I don't see where I have to implement
username = "vadenovias"
password = "*************"
cl = Client()
cl.delay_range = [1, 8]
cl.login( username,password)
cl.dump_settings("session.json")
followers = cl.user_followers_v1(cl.user_id_from_username(username))
reggards
from instagrapi.
Hello, you're asking a very beginner to python question. Please learn python before using an api wrapper framework like this
from instagrapi.
Hello,
If you had examples maybe it would be easier to see. Without basic examples it is difficult for people who don't know that much.
But I doubt that the error is mine when it works on an account with less than 900 users but when I do the "video_boda" one it immediately detects me and banned.
user_info_dict = cl.user_info_by_username_v1(username).dict()
I dont know if you are saying me that put here.
followers = cl.user_followers_v1(user_info_dict )
I don't know if you're telling me to convert it into a dictionary because I never call user_info_by_username in my code.
Yes, I don't know much about Python, but I do know much about education.
A greeting.****
from instagrapi.
What you say will be, I have developed with Python a program to reveal with the guests' mobiles using the Telegram API https://www.youtube.com/watch?v=VxFEkneaJzE and my own photobooth application for weddings https://www.youtube.com/watch?v=DEDoJIM3Epo. Maybe it's your API that's not right, maybe you're too smart for everyone around you. Thank you for your unparalleled help.
from instagrapi.
ok perfect.
from instagrapi.
Related Issues (20)
- [BUG] Error 400 when logging in HOT 38
- [BUG]
- how add users to a group chat
- [BUG] Getting Client Error when running from EC2 Instance HOT 1
- [BUG] Datalikers says insufficient funds
- [BUG] HOT 2
- [BUG] get_timeline_feed ignores max_id
- [BUG] Public API is not working HOT 2
- [BUG] There is a problem with Public graphgql request
- [BUG] HikerAPI not working
- [BUG] Status 201: JSONDecodeError in public_request (url=https://www.instagram.com/nike/?__a=1&__d=dis) >>> HOT 7
- TypeError: unsupported operand type(s) for |: 'type' and 'type'[BUG] HOT 3
- [BUG] Private API for searching hashtags throws a validation error HOT 2
- [BUG] instagram suspends the account even after paid proxy use HOT 1
- add can_support_threading for chronological order comment
- Collections
- [bug] [user_followers_v1_chunk] Is instagram sabotaging api requests?
- [BUG] user_following() returns Status 404
- Home feed from Client()
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from instagrapi.