From c760104d70fd56aedfb8569504814d4155a9c70b Mon Sep 17 00:00:00 2001 From: sherl Date: Sun, 12 Oct 2025 19:10:28 +0200 Subject: [PATCH] fix: support md5 url rewriting for proxied instances depends on public_facing_url instead of perceived request url (which can, and will be different for proxied instances) --- views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/views.py b/views.py index e63ebc9..938e89b 100644 --- a/views.py +++ b/views.py @@ -99,10 +99,11 @@ def videoplaybackProxy(): return Response(json.dumps({"error": "Videoplayback request not cached or expired."}), mimetype="application/json", status=404) return redirect(ythdd_globals.general_cache["hashed_videoplayback"][params["md5"]]["original_url"]) else: - md5sum = hashlib.md5(request.url.encode("utf-8")).hexdigest() + public_url = request.url + public_url = ythdd_globals.config["general"]["public_facing_url"] + public_url[public_url.rfind("videoplayback"):] + md5sum = hashlib.md5(public_url.encode("utf-8")).hexdigest() ythdd_globals.general_cache["hashed_videoplayback"][md5sum] = {"original_url": request.url} - # reconstruct the url # first attempt: from host param host = params.get('host')