I'm looking to develop a program that can detect network packets related to specific YouTube channels and block them from my device. For instance, if I search for a certain channel, I want the program to identify and prevent any data packets associated with that channel from reaching my device. I realize this might not be the most efficient method for restricting access, but I'm curious about the steps I need to take, the systems involved, and any relevant code that might help me achieve this. Any guidance or advice would be greatly appreciated!
3 Answers
You're diving into some tricky territory! Typically, what you're describing sounds a bit like a man-in-the-middle technique, but be warned: most modern browsers and apps, including YouTube, will spot and block such attempts to tamper with connections.
Unfortunately, your filtering idea hits a brick wall due to network encryption. You can certainly block access to youtube.com from a specific device using your router's settings. However, blocking videos from a particular creator at the network level is complex because each video's URL is unique. You might end up needing a list of all their videos, which isn't practical. A browser extension that hides content from certain channels could work too, showing blank placeholders instead. However, keep in mind that users can easily disable extensions, so if you're trying to stop someone from engaging in bad habits, this might not be very effective. Plus, they'd always have the option to use their phone instead.
Is there a way to bypass the encryption? Why or why not?
Also, if I'm aiming to block all short-form content on YouTube instead of specific channel videos, do they share a common identifier that I could use to block those?
As the previous user mentioned, browsers reject tampered requests. A more feasible solution might involve using a Greasemonkey script to modify the request after it reaches your browser and before you interact with it.
Okay, how would I go about doing that? Can you explain how it works?

Is there any way to get around that detection?