Project Requests instagram using Python code
You can download it from GitHub Project
Requirements
Channel
- YouTube : https://www.youtube.com/TaiLeOfficial
Clone and Install Script
git clone https://github.com/taile-official/Requests-Action-Instagram
cd Requests-Action-Instagram
pip install -r thuvien.txt
Import
import Instagram
from InstagramApi import Instagram
Gọi Class
cookie = "Cookie Web Instagram"
ins = Instagram(cookie)
Gọi class Instagram với tham số là cookie web Instagram ins = Instagram(cookie)
Những lần tiếp theo chỉ cần gọi hàm theo ý vì cookie đã được đính vào class
Sau khi gọi class Instagram với cookie
ins.setValues()
Dùng để set các tường name trong cookie tổng để URL trả về kết quả chính xác Nếu không gọi hàm này sẽ ko thể sử dụng các hàm khác
infoUser = ins.getInfo()
print(infoUser)
#(5472148373, "Lê Tuấn Tài")
follow = ins.followId(id user instagram)
print(follow) # => bool : True or False
'''
follow = ins.followId(54636757344)
print(follow)
>>> True
'''
like = ins.likePost(id post instagram)
print(like) # => bool : True or False
'''
like = ins.likePost(72636374624757344)
print(like)
>>> True
'''
cmt = ins.commentPost(id post instagram)
print(cmt) # => bool : True or False
'''
cmt = ins.commentPost(72636374624757344)
print(cmt)
>>> True
'''
Reply Comment Post - Reply Comment by ID POST
cmt = ins.commentPost(id post instagram, id cmt)
print(cmt) # => bool : True or False
'''
cmt = ins.commentPost(72636374624757344, 548236722)
print(cmt)
>>> True
'''
up_avt = ins.up_avt(path image)
print(up_avt) # => bool : True or False
'''
up_avt = ins.up_avt("C:/user/.../img/avt.jpg")
print(up_avt)
>>> True
'''
up_post = ins.up_load_post(path image, *caption)
print(up_post) # => bool : True or False
'''
up_post = ins.up_load_post("C:/user/.../img/avt.jpg", "String Caption)
print(up_post)
>>> True
'''