Twitch.tv is renowned for being quite a bit slower than Youtube, at least for me, and it made watching streams impossible. Youtube, although better than Twitch, still wasn’t great, barely handling 360p.
Snail – That’s all I have to offer
However, I was researching why the difference in video speed is so great, and I found a very interesting reddit post that talks about blocking two groups of IP addresses that causes a huge increase in Youtube and Twitch.tv speed. You can read it for yourself here. I just figured I would make a post of my own, as the reddit post only has links to instructions for Windows (bleh) not Linux (or Mac, however my instructions have not been tested on a Mac…don’t blame me if it your Macbook goes boom.)
How to increase Youtube and Twitch.tv speeds
It’s a pretty simple thing to do, you just have to block certain IPs from communication with your PC. While I’m not totally sure why this method works, I think it may be that we are blocking heavily-used ip-addresses and/or ones that have throttled speeds, thus causing Youtube and Twitch (and other streaming sites for that matter, I haven’t tested any others as of yet) to be faster! As for side affects, I haven’t seen any off the bat and the changes are applied immediately.
Step 1: Run the following command:
sudo iptables -A INPUT -m iprange --src-range 188.8.131.52-184.108.40.206 -j DROP
Basically what this does is tell iptables (the default Firewall for Ubuntu) to take the given range of IP address (iprange --src-range) and stop (or DROP) any packets/communication going to/from those IP addresses.
Step 2: Run the following command:
sudo iptables -A INPUT -m iprange --src-range 220.127.116.11-18.104.22.168 -j DROP
This does exactly the same thing as the previous command, except with a new set of IP addresses.
Step 3: Watch Youtube Videos in HD! The video below is a Piano Guys (Great music group) that has every possible (on Youtube that is) video resolution for watching from 144p to 4k. Good for testing increased speeds, and good for the ears as well.
That’s all there is to this trick, it’s super simple (at least for Linux users) and works great. If you are a Windows user, read this post from Study Blog.net. Disclaimer, this post was written for Windows Server 2008, so it may not apply anymore. However, please don’t bite the hand that got you good Youtube speeds, the reddit post I got this trick off of is from February of 2013. If those instructions don’t work for you, just google Block ip addresses Windows [INSERT YOUR VERSION HERE].
Remember, this is a Linux/Ubuntu-focused (and/or biased) blog; I haven’t used Windows for more than, say, ten minutes in over a month, so don’t freak out about me not having up-to-date Windows instructions.
That’s all for now. Please remember to leave a comment down below about whether or not this trick worked for you, if you’re running into any issues (errors and the like), and send this to all your friends (though not too many, it’ll stop working.)
Edit – Improved way
I was using this just fine, but it stopped working after a while, strangely enough, so I went back to the reddit post and read over it again and read another reddit post (this time from the Technology reddit) and they pointed out some other ways to do this, better than the DROP command.
First way is to use the REJECT command instead of DROP. The commands you want to run now look like this:
sudo iptables -A INPUT -m iprange --src-range 22.214.171.124-126.96.36.199 -j REJECT
sudo iptables -A INPUT -m iprange --src-range 188.8.131.52-184.108.40.206 -j REJECT
Almost identical to the old ones, except for the difference in the final word.
The second way just works for Firefox users (sorry Chrome, Midori, Safari, and all those other browser users) to use a Firefox addon, BlockSite Plus. You just download it (it’s a no-restart addon,) open up the addon’s preferences (enter about:addons in the address bar):
Firefox Addons Menu (about:addons)- Select Preferences for BlockSite Plus
And enter the IP addresses:
BlockSite Plus Preferences – Enter the IP address ranges here
This one is great for Windows/Mac users, as it will work without having to mess with commands and terminal/command line. I’m not totally sure this second method works, as I’ve already got iptables blocking those IPs, but it seemed to be accepted as a method on the reddit post.
This seems to be working right now, but if you are using Linux and use the iptables command, you will either have to set it up so that the iptable commands are run on boot up or you will have to enter them manually whenever you restart.