master
Aevann1 2021-08-14 23:57:48 +02:00
parent d5986097cb
commit 51fa1d60f8
1 changed files with 3 additions and 2 deletions

View File

@ -605,8 +605,9 @@ def submit_post(v):
else: embed = f"https://youtube.com/embed/{yt_id}"
elif "instagram.com" in domain:
try: embed = requests.get("https://graph.facebook.com/v9.0/instagram_oembed", params={"url":url,"access_token":environ.get("FACEBOOK_TOKEN","").strip(),"omitscript":'true'}, headers={"User-Agent": app.config["UserAgent"]}).json()["html"]
except: embed = None
pembed = requests.get("https://graph.facebook.com/v9.0/instagram_oembed", params={"url":url,"access_token":environ.get("FACEBOOK_TOKEN","").strip(),"omitscript":'true'}, headers={"User-Agent": app.config["UserAgent"]}).json()
try: embed = pembed["html"]
except: print(pembed)
elif app.config['SERVER_NAME'] in domain and "/post/" in url:
id = url.split("/post/")[1]