fix the other reddti redirection

master
Aevann 2024-06-16 21:27:08 +03:00
parent f87e6a48e1
commit 6025d3994f
1 changed files with 2 additions and 2 deletions

View File

@ -39,9 +39,9 @@ def subreddit(subreddit, v):
@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400)
@auth_desired
def reddit_post(subreddit, v, path):
post_id = path.rsplit("/", 1)[0].replace('/', '')
reddit = v.reddit if v else "old.reddit.com"
return redirect(f'https://{reddit}/{post_id}')
id = path.split("/")[0]
return redirect(f'https://{reddit}/{id}')
@app.get("/marseys")