Ditutup

Pass 403 forbidden error for instagram automation with python

Job Description:

Hi,

I have a python code which makes automatic posts to instagram. For this code to work, I have to provide session id and csrf token.

Previously, I was using below code to get that. Now, I get 403 forbidden error. I tried many ways, including Node, Selenium, etc. but couldn't solve this problem. I am using a local proxifier by the way. I was also using a proxifier previously. I need someone who will help me to pass this problem.

def main_get_csrf_token():

link = '[login to view URL]'

login_url = '[login to view URL]'

time = int([login to view URL]().timestamp())

payload = {

'username': INSTAGRAM_USERNAME,

'enc_password': f'#PWD_INSTAGRAM_BROWSER:0:{time}:{INSTAGRAM_PASSWORD}',

'queryParams': {},

'force': 'False',

'optIntoOneTap': 'False',

'two_step_verificator': 'True',

}

login_header = {

"User-Agent": "Chrome/77.0.3865.120",

#"User-Agent": "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36",

"X-Requested-With": "XMLHttpRequest",

"Referer": "[login to view URL]",

#"x-csrftoken": csrf

}

login_response = [login to view URL](login_url, data=payload, headers=login_header)

json_data = [login to view URL]([login to view URL])

if json_data["authenticated"]:

print("login successful")

cookies = [login to view URL]

cookie_jar = cookies.get_dict()

csrf_token = cookie_jar['csrftoken']

print("csrf_token: ", csrf_token)

session_id = cookie_jar['sessionid']

print("session_id: ", session_id)

else:

print("login failed ", [login to view URL])

Kemahiran: Python, Kejuruteraan Perisian, PHP, Linux, Web Scraping

Tentang Klien:
( 35 ulasan ) Ankara, Turkey

ID Projek: #35275013

8 pekerja bebas membida secara purata $20 untuk pekerjaan ini

TomaITomov

Hello, Greetings Ferda S., Good afternoon! I am an expert web developer with skills including Linux, Web Scraping, Software Architecture, Python and PHP. "login failed " Please contact me to discuss more regarding Lagi

$25 USD dalam sehari
(39 Ulasan)
6.1
Devrits

Hey! I am skilled Python engineer with skills including Linux, PHP, Software Architecture, Web Scraping and Python. - web scraping, data mining, data extraction, data transformation, - writing scripts and utilities, - Lagi

$30 USD dalam 4 hari
(56 Ulasan)
6.7
Zied130

Hello, I examined your project description, and I confirm I can handle those tasks perfectly, as I am an expert in PHP, Python, Linux, Web Scraping, Software Architecture. I am prepared to handle projects requiring Lagi

$10 USD dalam 7 hari
(59 Ulasan)
5.3
JaibhanSinghGaur

Greetings, I have gone through your project description. I find myself as a perfect fit for this job. I am working as a Python Developer from last 2 year. Some of my expertise is in the fields: 1. Web Scraping/Web Au Lagi

$20 USD dalam 3 hari
(49 Ulasan)
4.8
konanhenry1111

⭐⭐⭐I can start now and I am confident that I can do it ⭐⭐⭐ I have 10 years of experience in this field and I have these skills (PHP, Linux, Web Scraping, Software Architectureand Python) so just check my reviews and pl Lagi

$20 USD dalam 5 hari
(11 Ulasan)
3.8
Soniyakumar

I will fix error. I have all skills required for the task. Please let me know when I can start. Regards, Anoop

$15 USD dalam 7 hari
(5 Ulasan)
3.3
AZiyodulla

I have 5+ years experience in python programming language and 3+ years experience in django, I have been mentoring cyber security in Uzbekistan for 3+ years I think I can make you work

$20 USD dalam 7 hari
(0 Ulasan)
0.0
stasmikh

Hello Mate!Greetings Ferda S., Good morning! I’ve carefully checked your requirements and really interested in this job. I’m offering best quality and highest performance at lowest price. I can complete your project Lagi

$21 USD dalam 2 hari
(0 Ulasan)
0.0