Comments (1)
Alternative DM with Instagrapi
from instagrapi import Client
from myInfo import my_password, my_username, receiver_username, message, time
log in to your Instagram account
api = Client()
api.login(my_username, my_password) # if this line throws an error, then either your login info is wrong, OR instagram policies were triggered because you logged in too many times. If so, you need to manually login to your account and verify the account to proceed
print('Logged in successfully!')
search for the receiver's user by username
user = api.search_users(receiver_username)
from datetime import datetime
from time import sleep
def send_message(message, user_id):
while True:
now = datetime.now()
if [now.hour, now.minute] == time:
api.direct_send(message, [user_id])
print('Message sent successfully!')
sleep(60) # check the time every minute
if user: # if receiver's user is found
send_message(message, user[0].pk) # user[0].pk = user_id
else:
print(f"No search results found for username '{receiver_username}'")
log out of your Instagram account
api.logout()
from instagrapi.
Related Issues (20)
- How to Check if a Media Item Has Already Been Liked in instagrapi? HOT 1
- search_music [BUG] HOT 1
- Pin comment [BUG]
- [BUG] login error: invalid_parameters
- [BUG] Two factor authentication not working anymore, "Invalid parameters"
- Question. How to not get blocked.
- Scheduled posts for creator (professional) accounts
- [feature request] Batch Password Modification Function
- UKNOWN response: challenge_resolve, challenge_resolve_simple, handle_challenge_result
- When Sign Up feature will be added ?
- List of current_follow_requests
- Unsend_Message Feature
- Media likers using GraphQL
- Question: user_medias() able to get range?? Are there any methods to getting ranges of media?
- [BUG] not uploaded reels in cron
- Only use the api to upload video to instagram? HOT 1
- login not working[BUG]
- [BUG] Empty response message when using `signup`
- Need examples for StorySticker
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.