You are not logged in.

#1 2023-01-10 03:04:31

lzer0
Member
Registered: 2022-05-17
Posts: 8

Help blocking Youtube Videos, but allow Youtube Music through?

For productivity reasons I have blocked Youtube videos so I can access Youtube itself for stuff like uploading my own videos and editing them, replying to comments and managing my channel overall, but I can't watch any videos except those I upload on my own channel.
I'd like to be able to access the music in music.youtube.com to listen music but for this to work I would need to unblock googlevideo.com which is not what I want because I want videos to be blocked while still being able to access to music, so I can download them with applications like JDownloader and yt-dlp. So blocking googlevideo.com blocks every video that is not from my own channel, but that also prevents me from using music.youtube.com at all.

Is there some way to setup something with dnsmasq or a proxy to allow traffic to youtube? but only for a specific (audio) filetype, for example allow the mp3/m4a/ogg which are audio files so I can listen/download them while also blocking access to any other thing that is a video container (mp4/mkv/ogv)

Offline

#2 2023-01-10 08:54:17

seth
Member
Registered: 2012-09-03
Posts: 51,045

Re: Help blocking Youtube Videos, but allow Youtube Music through?

That would require https://en.wikipedia.org/wiki/Deep_packet_inspection against https.
The owner module allows iptables to block certain user/groups and by extension (through sgid) processes, but  that's an all or nothing approach (ie. only yt-dlp can access googlevideo.com, but it can get everything (audio, video)

You could also simply unblock googlevideo, use youtube-dl to pre-fetch a playlist for the day, block googlevideo and listen to the playlist locally.

Online

Board footer

Powered by FluxBB