Hello, tell me please. When a valid request, the server gives 200 response. Data mid, ig_pr, ig_vw - static. When the script is executed, 200 answers crash, but when I change the login to the wrong one, I still get 200 answers

LOGIN = "" PASSWORD = "" session = requests.Session() url = 'https://www.instagram.com/' def parce(session, url): page = requests.get(url) result = re.search('"csrf_token": "(.+?)"', page.text) if result and len(result.group(1)) > 0: return result.group(1) else: print("unlucky") def authLogin(LOGIN, PASSWORD, session, url): token = parce(session, url) payload = ("username=%s&password=%s") % (LOGIN, PASSWORD) headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Cookie': 'mid=VlcPHwAEAAEhgGWvu15J8g0GCsRK; ig_pr=1; ig_vw=1920; s_network=; csrftoken={0}'.format(token)} page = session.post(url, data=payload, headers=headers, allow_redirects=False) authLogin(LOGIN, PASSWORD, session, url) 
  • So maybe it always gives 200, analyze what comes in the data - FeroxTL
  • with invalid data, the server returns 302 - mastermind1337
  • Does Instagram have an API like? - m9_psy
  • Yes, but it is interesting to write that way - mastermind1337

0