fdfd
This commit is contained in:
parent
bd19e06055
commit
0edbf59578
1 changed files with 3 additions and 2 deletions
|
@ -603,7 +603,8 @@ def submit_post(v):
|
|||
else: return render_template("submit.html", v=v, error="ToS Violation", title=title, url=url, body=request.form.get("body", "")), 400
|
||||
|
||||
if "twitter.com" in domain:
|
||||
embed = requests.get("https://publish.twitter.com/oembed", params={"url":url, "omit_script":"t"}).json()["html"]
|
||||
try: embed = requests.get("https://publish.twitter.com/oembed", params={"url":url, "omit_script":"t"}).json()["html"]
|
||||
except: pass
|
||||
|
||||
elif "youtu" in domain:
|
||||
yt_id = re.match(re.compile("^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|shorts\/|\&v=)([^#\&\?]*).*"), url).group(2)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue