From f5d8dfb3ea4602dd7cb50ae11948abef0d2439a9 Mon Sep 17 00:00:00 2001 From: Michael Lee <28682648+ObscureStrength@users.noreply.github.com> Date: Fri, 19 Jul 2019 10:37:21 +0800 Subject: [PATCH] Replace the existing user agent string in start.py The existing user agent results in a 405 error. The user agent used here solves that --- start.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start.py b/start.py index 4cb3cdc..1caefa3 100644 --- a/start.py +++ b/start.py @@ -18,7 +18,7 @@ def get_credential(): def fetch_news_feed(session): res = session.get("https://i.instagram.com/api/v1/feed/timeline/", headers={ - 'user-agent':"Instagram 10.3.2 (iPhone7,2; iPhone OS 9_3_3; en_US; en-US; scale=2.00; 750x1334) AppleWebKit/420+", + 'user-agent':"Mozilla/5.0 (iPhone; CPU iPhone OS 9_3_2 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13F69 Instagram 8.4.0 (iPhone7,2; iPhone OS 9_3_2; nb_NO; nb-NO; scale=2.00; 750x1334", 'cookie':'sessionid={0};'.format(session.cookies['sessionid']) }) if res.status_code != 200: