Update to the newest MFP version, including the Vixcloud PR

This commit is contained in:
UrloMythus
2025-05-12 19:40:35 +02:00
parent 323ca2d1b6
commit 2501ff4fd6
41 changed files with 61 additions and 37 deletions

View File

@@ -330,15 +330,25 @@ def encode_mediaflow_proxy_url(
# Handle encryption if needed
if encryption_handler:
encrypted_token = encryption_handler.encrypt_data(query_params, expiration, ip)
# Build the URL with token in path
path_parts = [base_url, f"_token_{encrypted_token}"]
# Parse the base URL to get its components
parsed_url = parse.urlparse(base_url)
# Insert the token at the beginning of the path
new_path = f"/_token_{encrypted_token}{parsed_url.path}"
# Reconstruct the URL with the token at the beginning of the path
url_parts = list(parsed_url)
url_parts[2] = new_path # Update the path component
# Build the URL
url = parse.urlunparse(url_parts)
# Add filename at the end if provided
if filename:
path_parts.append(parse.quote(filename))
return "/".join(path_parts)
url = f"{url}/{parse.quote(filename)}"
return url
else:
# No encryption, use regular query parameters
url = base_url