Đã Đóng

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])

Kĩ năng: Python, Kiến trúc phần mềm, PHP, Linux, Web Scraping

Về khách hàng:
( 35 nhận xét ) Ankara, Turkey

ID dự án: #35275013

8 freelancer chào giá trung bình$20 cho công việc này

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 Thêm

$25 USD trong 1 ngày
(39 Nhận xét)
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, - Thêm

$30 USD trong 4 ngày
(56 Nhận xét)
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 Thêm

$10 USD trong 7 ngày
(59 Nhận xét)
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 Thêm

$20 USD trong 3 ngày
(49 Nhận xét)
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 Thêm

$20 USD trong 5 ngày
(11 Nhận xét)
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 trong 7 ngày
(5 Nhận xét)
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 trong 7 ngày
(0 Nhận xét)
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 Thêm

$21 USD trong 2 ngày
(0 Nhận xét)
0.0