How to stop YouTube sucking (Windows guide)

win-broken

My first blog post in three years has been a crazy ride. It blew up all over the web, and I’m humbled. A big thanks to everyone from HackerNews, Reddit, and most recently YouTube. Really glad this helped a lot of you guys.

The biggest question I’ve had so far is “how can I get this to work on Windiows?”, and I am back to answer that. I’ve written a guide how to block the CDN IP ranges from the command prompt on Windows, so it should work on all versions (Windows 7, Windows XP, and others). That said, I run a Mac as my primary computer and I welcome any feedback from the Windows gurus out there.

Just like yesterday’s post, you will have blazingly fast Youtube streaming (and Twitch.tv) by running a few commands to reject certain IP addresses. Also, remember that this will cause the stream to take 1-2 seconds to start because of the IP block handling, but then you are greeted with a silky smooth, ultra fast experience.

Enough talking. Here’s what you need to do:

  1. Click the Start button, type “cmd”, and right click the icon to ‘Run As Administrator’ (Screenshot 1)
  2. You will likely see a UAC prompt, hit “Yes” (Screenshot 2)
  3. The command prompt window will open, this is where you will type in the commands to set your firewall rules (Screenshot 3)
  4. Enter the following command and hit Enter. If it works, you should see a big “OK”.

netsh advfirewall firewall add rule name="MITCHRIBARYTUBE" dir=in action=block remoteip=173.194.55.0/24,206.111.0.0/16 enable=yes

Rules can be easily removed too. Just get back into the command prompt in the same way and run this command, hit Enter again:

netsh advfirewall firewall delete rule name="MITCHRIBARYTUBE"

Did this trick work for you? Let me know in the comments below, Windows users!

EDIT (Feb 27, 2013): I’ve updated the blog with a new add rule command that’s lets you use one line instead of two. Thanks to Darren for the tip!

How to stop TWC ISPs sucking at Youtube

slow-funny

I’ve had TWC for over a year and have been frustrated at the shockingly crap Youtube performance. I never had issues with other web browsing, downloads, or Netflix, so I simply shrugged it off and continued with life. A few days ago I came across this video and some discussions on Reddit which prompted me to explore further.

A few terminal commands later to reject certain IP addresses and I was back to blazingly fast Youtube streaming (and Twitch.tv). Doing this will cause the stream to take 1-2 seconds to start because of the IP rejection handling, but then you are greeted with a silky smooth, ultra fast experience.

Open up your terminal and run these commands (you will be prompted for the admin password):

sudo ipfw add reject src-ip 173.194.55.0/24 in
sudo ipfw add reject src-ip 206.111.0.0/16 in

You can check the rules were added by using this command:

sudo ipfw list

Need to delete these rules? No problem, just run the ‘sudo ipfw list’ command again. Next to each rule is a reference number, so take the number of the rule you want to delete and replace the ‘X’ in this command with that number:

sudo ipfw delete X

Why do these commands create a better streaming experience? TWC is throttling downloads from servers (CDN) that host cached videos. By rejecting these IP address ranges you will force the video to be served to you directly. This harnesses the full download speed of your internet connection. Other people can dive into the complexity much better than I ever could, but that’s the overall theme.

If you’re not using a Mac, here’s some tips to make this work:

  • Linux – instead of ipfw use iptables command
  • Windows – check out this guide
  • Multiple computers – configure the IP blocks via your router.

Did this trick work for you? Let me know in the comments below.

EDIT (Feb 25, 2013): After some great discussion on HN, I wanted to address that before posting I did test a number of ISPs, and also I read various on message boards, that complained about speed, appeared to be overwhelmingly TWC. That’s not ideal proof, but this was just intended to be a share of a personal quick fix. I’ve modified the title to reflect that is not specific to TWC. Enjoy the hack!