From b261aa00a50bbbf2ad867dc14c14ebe8c4970325 Mon Sep 17 00:00:00 2001 From: Arya Kiran Date: Mon, 13 Nov 2023 22:42:25 +0530 Subject: [PATCH] improved pipedproxy for inv --- privfrontends/templates/Caddyfile.j2 | 23 +++++++++++++---------- privfrontends/templates/eu/misc.Caddyfile | 23 +++++++++++++---------- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/privfrontends/templates/Caddyfile.j2 b/privfrontends/templates/Caddyfile.j2 index ea259e9..b89d971 100644 --- a/privfrontends/templates/Caddyfile.j2 +++ b/privfrontends/templates/Caddyfile.j2 @@ -106,20 +106,23 @@ teddit.{{ server_prefix }}.projectsegfau.lt teddit.projectsegfau.lt t.psf.lt t.{ } inv.{{ server_prefix }}.projectsegfau.lt i.{{ server_prefix }}.psf.lt { reverse_proxy :7573 - @playback { + @pipedproxy { path /videoplayback path /videoplayback/* + path /vi/* + path /ggpht/* } - header @playback { - Access-Control-Allow-Origin "*" + handle @pipedproxy { + reverse_proxy :6970 { + header_up Host "pipedproxy.{{server_prefix}}.projectsegfau.lt" + } + @jpgRedirect path_regexp maxres2 /vi/(.+)/maxres.jpg + @thumbnailRedirect path /ggpht/* + uri @thumbnailRedirect strip_prefix /ggpht + rewrite @thumbnailRedirect ?host=yt3.ggpht.com + uri @jpgRedirect replace /maxres.jpg /maxres2.jpg + rewrite /vi/* ?host=i.ytimg.com } - @jpgRedirect path_regexp maxres2 /vi/(.+)/maxres.jpg - @thumbnailRedirect path_regexp ggpht /ggpht/(.+) - redir @jpgRedirect /vi/{re.maxres2.1}/maxres2.jpg - redir @thumbnailRedirect https://pipedproxy.{{server_prefix}}.projectsegfau.lt/{re.ggpht.1}?host=yt3.ggpht.com - redir /vi/* https://pipedproxy.{{server_prefix}}.projectsegfau.lt{uri}?host=i.ytimg.com - redir /videoplayback/* https://pipedproxy.{{server_prefix}}.projectsegfau.lt{uri} - redir /videoplayback https://pipedproxy.{{server_prefix}}.projectsegfau.lt{uri} header { # disable FLoC tracking Permissions-Policy "accelerometer=(), ambient-light-sensor=(), autoplay=(), battery=(), camera=(), clipboard-read=(), display-capture=(), document-domain=(), encrypted-media=(), fullscreen=(), geolocation=(), gyroscope=(), hid=(), idle-detection=(), interest-cohort=(), magnetometer=(), microphone=(), midi=(), payment=(), picture-in-picture=(), screen-wake-lock=(), serial=(), usb=(), sync-xhr=(), xr-spatial-tracking=()"; diff --git a/privfrontends/templates/eu/misc.Caddyfile b/privfrontends/templates/eu/misc.Caddyfile index 6d4a840..4ca7058 100644 --- a/privfrontends/templates/eu/misc.Caddyfile +++ b/privfrontends/templates/eu/misc.Caddyfile @@ -4,20 +4,23 @@ sl.projectsegfau.lt sl.psf.lt { } inv.bp.projectsegfau.lt, i.bp.psf.lt, invidious.projectsegfau.lt, inv.projectsegfau.lt, i.psf.lt { reverse_proxy localhost:7573 - @playback { + @pipedproxy { path /videoplayback path /videoplayback/* + path /vi/* + path /ggpht/* } - header @playback { - Access-Control-Allow-Origin "*" + handle @pipedproxy { + reverse_proxy :6970 { + header_up Host "pipedproxy.{{server_prefix}}.projectsegfau.lt" + } + @jpgRedirect path_regexp maxres2 /vi/(.+)/maxres.jpg + @thumbnailRedirect path /ggpht/* + uri @thumbnailRedirect strip_prefix /ggpht + rewrite @thumbnailRedirect ?host=yt3.ggpht.com + uri @jpgRedirect replace /maxres.jpg /maxres2.jpg + rewrite /vi/* ?host=i.ytimg.com } - @jpgRedirect path_regexp maxres2 /vi/(.+)/maxres.jpg - @thumbnailRedirect path_regexp ggpht /ggpht/(.+) - redir @jpgRedirect /vi/{re.maxres2.1}/maxres2.jpg - redir @thumbnailRedirect https://proxy.piped.projectsegfau.lt/{re.ggpht.1}?host=yt3.ggpht.com - redir /vi/* https://proxy.piped.projectsegfau.lt{uri}?host=i.ytimg.com - redir /videoplayback/* https://proxy.piped.projectsegfau.lt{uri} - redir /videoplayback https://proxy.piped.projectsegfau.lt{uri} header { # disable FLoC tracking Permissions-Policy "accelerometer=(), ambient-light-sensor=(), autoplay=(), battery=(), camera=(), clipboard-read=(), display-capture=(), document-domain=(), encrypted-media=(), fullscreen=(), geolocation=(), gyroscope=(), hid=(), idle-detection=(), interest-cohort=(), magnetometer=(), microphone=(), midi=(), payment=(), picture-in-picture=(), screen-wake-lock=(), serial=(), usb=(), sync-xhr=(), xr-spatial-tracking=()";