Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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()
|
|
|
|
|
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"):
|