B
unknown
python
3 years ago
1.2 kB
8
Indexable
import requests
USERNAME = 'your_username'
PASSWORD = 'your_password'
# Instagram'a giriş yap
login_url = 'https://www.instagram.com/accounts/login/ajax/'
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36',
'Referer': 'https://www.instagram.com/accounts/login/',
'X-Requested-With': 'XMLHttpRequest',
'Origin': 'https://www.instagram.com',
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': '*/*',
}
data = {
'username': USERNAME,
'password': PASSWORD,
}
response = requests.post(login_url, headers=headers, data=data)
if response.json()['authenticated']:
print('Giriş başarılı!')
else:
print('Giriş başarısız!')
exit()
# Bir gönderinin beğenisini arttır
post_id = '1234567890' # Bu ID, beğenilecek gönderinin Instagram URL'sinde yer alır (örnek: https://www.instagram.com/p/<post_id>/)
like_url = f'https://www.instagram.com/web/likes/{post_id}/like/'
response = requests.post(like_url, headers=headers)
if response.status_code == 200:
print('Gönderi beğenildi!')
else:
print('Gönderi beğenilemedi!')
Editor is loading...