Bypassing a corporate Web filter when using the command line
March 10, 2014 3 Comments
or ‘How to bypass a corporate Web filter and download YouTube videos via the command line’
One of the offices where I work uses a Web filter to block access to certain sites, such as YouTube. However, sometimes it is necessary to view blocked Web sites for work purposes. For example, these days a lot of companies or individuals post product reviews on YouTube that are useful for work purposes. In such cases I have used Tor to access the blocked sites in a Web browser such as Firefox, Chrome, Konqueror etc. See my post How to install and use Tor for anonymous browsing or to access country-restricted content from another country for details of how to set up and use Tor with a Web browser.
But sometimes I need to access blocked Web sites from the command line. For example, today I needed to download a YouTube video for work purposes, and I wanted to use youtube-dl to do it. The solution was simple…
First I launched
polipo as explained in the above-mentioned post on Tor, then I launched another Konsole/Terminal window and entered the commands shown below:
As you can see above, the corporate Web filter blocked
youtube-dl from downloading the video.
So I informed the shell session about the local HTTP proxy (
polipo) running on my laptop, by assigning and exporting the environment variable
http_proxy using the following syntax:
which in my case meant the following (refer to my article on Tor):
and then I was able to download the video from YouTube despite the corporate Web filter: