fdfd
This commit is contained in:
parent
48b6b7ad28
commit
1d5da292dd
1 changed files with 6 additions and 5 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue