This commit is contained in:
Aevann1 2021-08-13 03:26:44 +02:00
parent 48b6b7ad28
commit 1d5da292dd

View file

@ -617,11 +617,12 @@ def submit_post(v):
elif app.config['SERVER_NAME'] in domain: elif app.config['SERVER_NAME'] in domain:
try: try:
matches = re.match(re.compile(f"^.*{domain}/post/+\w+/(\w+)(/\w+/(\w+))?"), url) if "/?context=" in url:
post_id = matches.group(1) id = url.split("/?context=")[0].split("/")[1]
comment_id = matches.group(3) embed = f"https://{app.config['SERVER_NAME']}/embed/comment/{id}"
if comment_id: embed = f"https://{app.config['SERVER_NAME']}/embed/comment/{comment_id}" elif "/post/" in url:
else: embed = f"https://{app.config['SERVER_NAME']}/embed/post/{post_id}" id = url.split("/post/")[1].split("/")[0]
embed = f"https://{app.config['SERVER_NAME']}/embed/post/{id}"
except: embed = None except: embed = None
else: embed = None else: embed = None