jonathanjordan21 commited on
Commit
3ff42f0
·
verified ·
1 Parent(s): c347662

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -185,7 +185,9 @@ async def ig_post_detail_api(post_id: Optional[str] = None, url: Optional[str] =
185
  }
186
  variables_json = json.dumps(variables, separators=(',', ':'))
187
  url = f"https://www.instagram.com/graphql/query/?query_hash={query_hash}&variables={variables_json}"
188
- res = requests.get(url).json()["data"]["shortcut_media"]
 
 
189
 
190
 
191
  if res.get("edge_media_preview_like"):
 
185
  }
186
  variables_json = json.dumps(variables, separators=(',', ':'))
187
  url = f"https://www.instagram.com/graphql/query/?query_hash={query_hash}&variables={variables_json}"
188
+ res = requests.get(url, headers={"user-agent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Googlebot/2.1; +http://www.google.com/bot.html) Chrome/W.X.Y.Z Safari/537.36"}).json()
189
+ print(res)
190
+ res = res["data"]["shortcut_media"]
191
 
192
 
193
  if res.get("edge_media_preview_like"):