viewtube is awesome, how can I redirect all requests from YouTube.com to myviewtub.domain? reddit / selfhosted ---------------------------------------------------------------------- dotinho · 2023-10-29 11:02 Hi all, I'm using viewtube for 3 days, and I love it. My next step is migrate all request to that service, I test the video/playlist url os the same, and I use pi-hole as my local dns server. Is possible to rewrite the domain on pi-hole? like any request to [You Tube.com/watch?v=v43DXkj5b0I](https://YouTube.com/watch?v=v43DXkj5b0I) to [mydomain.com/watch?v=v43DXkj5b0I](https://mydomain.com/watch?v=v43 DXkj5b0I) ? I was reading pi-hole docs and I can't find anything useful for this feature. ​ Thank you. ---------------------------------------------------------------------- thekrautboy · 2023-10-29 11:04 /r/Pihole? ---------------------------------------------------------------------- dotinho · 2023-10-29 11:25 Thank you. ---------------------------------------------------------------------- pentesticals · 2023-10-29 11:40 Not really, you can use DNS to point YouTube.com to an iP you control, but the problem is that you will get TLS issues. It won’t redirect the hostname, but just the IP address. You could use a custom CA and sign YouTube.com certificates, but you will likely still have problems if you use Chrome because they will be pinning certificates for Google services, and your mobile applications will also pin the certs so your mobile YouTube will stop working completely. ---------------------------------------------------------------------- leewhat · 2023-10-29 11:55 Redirector? https://addons.mozilla.org/en-US/firefox/addon/redirector/ https://github.com/iv-org/documentation/blob/master/docs/redirector.md change to viewtube format ---------------------------------------------------------------------- dotinho · 2023-10-29 12:35 Ok, I see my idea will give me too much trouble. ---------------------------------------------------------------------- dotinho · 2023-10-29 12:37 I’ll check that. ---------------------------------------------------------------------- omfgitsasalmon · 2023-10-29 13:23 I use a grease monkey / tampermonkey script to automatically redirect. So it doesn't affect others who want to use YouTube in my household. ---------------------------------------------------------------------- tubbana · 2023-10-29 13:51 Is using viewtube constant fighting with google? It breaks, gets updated and fixed, it breaks again, gets updated and fixed eventually, it breaks...? ---------------------------------------------------------------------- Electronic-Still2597 · 2023-10-29 14:14 I've been using freetube and libredirect for the last week or so and it's been pretty awesome so far. Freetube takes care of all my subscriptions and libredirect takes care of any youtube links i click on. https://freetubeapp.io/ https://libredirect.github.io/ ---------------------------------------------------------------------- rasg · 2023-10-29 14:27 i have something similar with another service. 1. local DNS to redirect requests ([officialservice.com](https://officialservice.com) \-> localservice.local) 2. localservice.local is my apache module opening all http requests and replacing the links inside the page ---------------------------------------------------------------------- LavaCreeperBOSSB · 2023-10-29 14:57 Probably wont work with PiHole ---------------------------------------------------------------------- Cirx0808 · 2023-10-29 15:08 I would set up an Nginx container to forward all request to youtube.com to your ViewTube container. Then in PiHole set the A record for youtube.com to be your Nginx container. ---------------------------------------------------------------------- utopiah · 2023-10-29 15:11 I'm using Vimperator so I made an autocmd to redirect all such content to [https://github.com/user234683/youtube- local](https://github.com/user234683/youtube-local) If you don't use Vimperator I recommend checking it or any other tool that allow you to get more control of your browser, especially if, like me, you spend most of your day in it, not on your desktop. ---------------------------------------------------------------------- krogaw · 2023-10-29 15:25 Don't forget to Import your own CA into every device or you will get ssl/tls errors. And good luck to import it into devices like a chromecast... ---------------------------------------------------------------------- dotinho · 2023-10-29 15:31 I’ll explore that, seems interesting. ---------------------------------------------------------------------- lestrenched · 2023-10-29 15:49 Hi, could you explain how you're replacing URLs in a page with Apache? I've never seen this before. Also, why Apache over something like Caddy or HAProxy? ---------------------------------------------------------------------- ProgrammerPlus · 2023-10-29 16:17 Why not use SNIProxy? ---------------------------------------------------------------------- lilolalu · 2023-10-29 16:30 No, pihole won't help you there because what you want is nothing a DNS can do, you need a proxy server to handle that. How this works depends on the proxy server you are going to use. ---------------------------------------------------------------------- stappersg · 2023-10-29 16:31 In other words: One side wants advertisement revenue, the other side does not want the advertisements. During the fight is the value of the content forgotten. ---------------------------------------------------------------------- lilolalu · 2023-10-29 16:33 .. but why don't you just use vidious and clipious as a client? They even have an Android tv Client. ---------------------------------------------------------------------- stappersg · 2023-10-29 16:41 Which _SNIProxy_ https://duckduckgo.com/?q=SNIproxy did bring at least 4 in the first page. ---------------------------------------------------------------------- JackDostoevsky · 2023-10-29 16:55 you could try doing this with CNAMEs on a locally hosted DNS server like PiHole ---------------------------------------------------------------------- reercalium2 · 2023-10-29 17:08 There's probably a browser extension. ---------------------------------------------------------------------- brody5895 · 2023-10-29 17:19 It's pretty easy to append and modify stuff like that with Caddy. Maybe you could set PiHole to point URLs for YouTube to Caddy and rewrite and redirect from there? I might be wrong but ChatGPT said it should work lol ---------------------------------------------------------------------- dotinho · 2023-10-29 17:57 Ok, I will look into that also. ---------------------------------------------------------------------- micalm · 2023-10-29 18:06 The easiest thing I can think of is hosting your own web server on both :80 and :443, pointing YT to `127.0.0.1` (or wherever your server lives) and 301 redirecting all `youtube.com/watch?v=XXX` to `yourdomain.local/watch?v=XXX`. There are plenty of guides for doing that. If you have a "bare-metal" pi-hole you could use its lighttpd, if you have another server running Apache/Nginx/Caddy/Traefik or whatever - you probably know (or can easily learn) how to do it. Cert issues can be solved with your own self-signed, but trusted cert. ---------------------------------------------------------------------- Obliterous · 2023-10-29 18:35 You could always use Tampermonkey scripts to re-write all YT url's ---------------------------------------------------------------------- Motor_Perspective674 · 2023-10-29 19:33 You can setup a local NGINX/Apache proxy on your local network and point youtube.com to it using PiHole, or your device’s hosts file. On your home network, you could use plain HTTP to talk to the proxy, or if you want end-to-end encryption you’ll need to create a local CA and issue a certificate to your proxy under the name “YouTube.com” and then add the CA certificate to the trust store of all your devices. Just know that this will only work on your home network and on devices you manage. ---------------------------------------------------------------------- Ion_GPT · 2023-10-29 19:58 I am pretty sure that there is some certificates pinning and you will have to use your own custom browser and your custom mobile app to accept the fake yt CA. ---------------------------------------------------------------------- Michaelscarn69- · 2023-10-29 20:02 What is viewtube used for? ---------------------------------------------------------------------- tmyflyte · 2023-10-29 21:33 Do you mind sharing it? ---------------------------------------------------------------------- mnopw · 2023-10-29 23:14 Youtube used HSTS so it won't be loaded over HTTP. ---------------------------------------------------------------------- ProgrammerPlus · 2023-10-30 01:27 You can check this out, it uses SNI proxy https://github.com/Seji64/SniDust ---------------------------------------------------------------------- omfgitsasalmon · 2023-10-30 02:07 Sure // ==UserScript== // @name Redirect YouTube videos to Piped // @version 1.0 // @description Redirect all YouTube Video URL to Piped // @author Maya329 // @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com // @match https://www.youtube.com/watch* // @run-at document-start // @grant none // ==/UserScript== var path = window.location.pathname + window.location.search; var pipedURL = 'https://your.url.com'; var newURL = pipedURL + path; location.replace (newURL); ---------------------------------------------------------------------- angerofmars · 2023-10-30 04:01 You can try the Privacy Redirect browser extension by Simon Brazell on Github and put your ViewTube instance domain in place of the the Invidious instance. I know ViewTube and Invidious are not the same but theoretically the domain rewrite mechanic should work similarly. I have not tested it with ViewTube so YMMV but it's working amazingly for my self-hosted Invidious instance, even embedded Youtube players in Reddit and other sites are replaced so they got nothing on me. ---------------------------------------------------------------------- impirialkirill · 2023-10-30 06:42 Read books instead of watching low quality content :D ---------------------------------------------------------------------- stappersg · 2023-10-30 07:13 Acknowledge on _appreciate content_ ---------------------------------------------------------------------- Kazer67 · 2023-10-30 09:16 I really need a sync feature for FreeTube so I can get my history / sub on multiple computers synced with the files on my NAS. ---------------------------------------------------------------------- laterral · 2023-10-30 15:08 How can the pi hole redirect? ---------------------------------------------------------------------- thekrautboy · 2023-10-30 15:09 It cannot, but OP is asking how to do this with Pihole so /r/Pihole is the right place to teach them why that doesnt work. ---------------------------------------------------------------------- thekrautboy · 2023-10-30 15:11 > What is viewtube used for? Typing exactly that into Google (i know, i know, youre allergic): > ViewTube is an alternative YouTube frontend that lets you watch, search and discover YouTube videos without ads or tracking. It's built to be mobile and desktop friendly, with dark and light themes, and a touch-friendly video player with gestures. ---------------------------------------------------------------------- Edianultra · 2023-10-30 15:53 If it’s just saved in config files you can probably rsync it to the nas and automate that for a few times a day. Not 100% sure but I’d say it’s worth exploring ---------------------------------------------------------------------- Low-Chapter5294 · 2023-10-30 16:20 It can provide a custom IP address for youtube lookups. Cert pinning will probably be a disaster though. ---------------------------------------------------------------------- laterral · 2023-10-30 18:10 😂😂 I love this reply ---------------------------------------------------------------------- Michaelscarn69- · 2023-10-31 08:34 Thank you. You are awesome