import json
import requests
headers = {
'User-Agent': 'user agent buraay gelecek',
'Accept': '*/*',
'Accept-Language': 'tr-TR,tr;q=0.8,en-US;q=0.5,en;q=0.3',
'Accept-Encoding': 'gzip, deflate, br',
'X-CSRFToken': 'csrf tokenininz buraya',
'X-Instagram-AJAX': '',
'X-IG-App-ID': '',
'X-ASBD-ID': '',
'X-IG-WWW-Claim': '',
'Content-Type': 'application/x-www-form-urlencoded',
'X-Requested-With': 'XMLHttpRequest',
'Origin': 'https://www.instagram.com',
'DNT': '1',
'Connection': 'keep-alive',
'Referer': 'https://www.instagram.com/accounts/login/',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'same-origin',
}
data = {
'enc_password': '#PWD_INSTAGRAM_BROWSER:0:0:şifre buraya gelecek',
'optIntoOneTap': 'true',
'queryParams': '{}',
'trustedDeviceRecords': '{}',
'username': 'kullanıcı adı buraya gelecek',
}
# Create a session object to manage the session and cookies
session = requests.Session()
# Make the POST request using the session object
response = session.post('https://www.instagram.com/api/v1/web/accounts/login/ajax/', headers=headers, data=data)
# Get the JSON response from the server
girilen = response.json()
# Print the response
print(girilen)
# Save the cookies to a 'cookies.json' file
with open('cookies.json', 'w') as cookies_file:
json.dump(session.cookies.get_dict(), cookies_file)
al = session.cookies.get_dict()
csrf = al['csrftoken']
mids = al['mid']
iddid = al['ig_did']
print(csrf + " Csrf Token")
print(mids + "Mid Bilgisi")
print(iddid + "ig Did bilgisi") Python Requests ile İnstagram Giriş Yapma ve Çerezleri Kaydetme
0
●342
- 28-07-2023, 22:24:16Bu kod ile hesabınızı giriş yapıp json formatında hesabınızın çerezini kaydeder kaydedilen çerezlerle işlem ypabilirsiniz böylelikle hesaplarınız daha güvenli bir şekilde yönetebilirsiniz