May 242010

4OD Channel 4 television, on demand, for the UK

So 4OD has a great collection of TV series that you can watch back to back. After watching about five episodes of peep show I found the adverts repetitive and annoying and decided to have a look at removing them. A brief search on the net and I found Steve Larsen had found a method. His instructions state that by redirecting three hosts to your loopback the adverts will not be played. I did this and for some quick tests I found it to work.

My setup, following instructions

I set my router’s parental control to redirect the following URL s to

I did this in the hope that I would not have to reconfigure the hosts file on the various computers around my house.


I found that on machines that had viewed 4OD then adverts did not play but on machines that have never been to 4OD they hung while attempting to play and showed nothing but a blank screen.


To investigate what was going on I disabled the redirect on my router and cookies and caching on a browser and ran up WireShark and captured the packets from a successful viewing of 4OD.

  1. I used Jamie Does as a test.
  2. The first packet of interest is this request to channel 4.
  3. In the xml response there is a node “adverts” with a “targetingUri” child that looks interesting.
  4. The next packet of interest is this request
  5. Finally this request,x60,x61,x80,x81,x90,x91,x92,x93
  6. The response contains a load of rtml urls interceded with remarks with clipping times.

Removing adverts solution, personal use.

So seeing as just looping back to localhost ends up with a hang if there is no cache of the final request then it will need to generate my own response using some php and some url re-writing on my local apache and php web server.

  1. Set in hosts file to be
  2. Setup url rewriting on local web server in .htaccess
    RewriteRule ^crossdomain.xml$ /tv.php?cd=1 [L]
    RewriteRule ^RealMedia\/ads\/adstream_sx\.ads /tv.php [L]
  3. Generate a php page to service requests.
    if (isset($_GET['cd'])) {
    echo '<?xml version="1.0"?>'.PHP_EOL;
    echo '<!DOCTYPE cross-domain-policy SYSTEM "">'.PHP_EOL;
    echo ' <cross-domain-policy>'.PHP_EOL;
    echo ' <allow-access-from domain="*" />'.PHP_EOL;
    echo '</cross-domain-policy>';
    } else {
    echo PHP_EOL;

In the above requests for the crossdomain.xml are served normally however the rtmp links are not generated at all, these rtmp links are the locations of adverts to be played, non specified, non  played.

An example of the crossdomain.xml
An example of the null advert file

Removing adverts solution, personal network.

  1. Same as above except step 1 is not to alter hosts file but to setup a redirect to my server on my routers parental control. So. REDIRECT MyServerName

Removing adverts solution, solution for everyone.

I have enabled a static ip server I had admin rights over to provide the fake information required. One can add a host entry (c:\windows\system32\drivers\etc\hosts – launch notepad with admin rights) for

to point at

in the end it should look like something like this:

# Copyright (c) 1993-2006 Microsoft Corp.
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
# For example:
# # source server
# # x client host localhost

Once done, open a command and tye nbtstat -R and ipconfig /flushdns or just reboot and yay no more ads.


  5 Responses to “Watch 4OD and skip Adverts”

  1. Ingenious! 4OD in our house is now ad free.
    Although I seem to have broken mythweb in the process…..

  2. I have enabled a static ip server I have admin rights over to provide the fake information required. One can add a host entry for

    to point at

  3. Thanks Chris! That is just great, looking forward to hearing more in this direction!

  4. You Sir are a star. Thanks for sharing

  5. I’ve just done the modification to my hosts file but the ads still play on 4OD. I’m using firefox 13 with noscript and i’ve added to the whitelist. Maybe C4 no longer uses to serve the ads or does you xml file no longer exist?

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>