ABC’s iView on XBMC.. update 1

A plugin for ABC iView on XBMC has been released. See this page for progress of ABC iView on XBMC.

I’ve done a little bit of work since my last post on this, and a couple of people have asked for my stuff. Here goes.

Firstly, you can use RTMPdump to download the iView stream on your Linux box. You’ll need to download rtmpdump 1.4 and compile it yourself. It should just take a ‘make’ as long as you have all the requirements.

When iView starts, it first requests an XML config file, from the URL

<?xml version="1.0" encoding="utf-8"?>
<param name="authenticate_path"   value="" />
<param name="media_path"          value="flash/playback/_definst_/" />
<param name="media_path_mp4"      value="flash:mp4/playback/_definst_/" />
<param name="server_streaming"    value="rtmp://" />
<param name="server_speedtest"    value="rtmp://" />
<param name="xml_help"            value="iview_help.xml" />
<param name="xml_channels"        value="iview_channels.xml" />
<param name="xml_series"          value="" />
<param name="xml_thumbnails"      value="" />
<param name="xml_classifications" value="" />
<param name="xml_feature"         value="" />
<param name="xml_feature_home"    value="" />
<param name="server_time"         value="" />
<param name="thumbs_path"         value="" />
<param name="base_url"            value="" />
<param name="channel_id_arts"     value="2260366" />
<param name="channel_id_news"     value="2186765" />
<param name="channel_id_docs"     value="2176127" />
<param name="channel_id_shop"     value="2186639" />
<param name="channel_id_catchup"  value="2172737" />
<param name="channel_id_kazam"    value="2288241" />
<param name="channel_id_faves"    value="2478452" />
<param name="channels_main"       value="catchup,news,docs,arts,shop" />
<param name="channels_kids"       value="kazam,faves" />

From this file, you can find out which other XML files you need for the channels and program descriptions. Firstly though, you need a special token, which is like an authorisation string. It’s done by doing a HTTP GET on the authenticate_path, which will return something like:

<?xml version="1.0" encoding="utf-8"?>
<iview xmlns:xsi="" xmlns:xsd="" xmlns="">
<desc>iiNet Limited</desc>
<server />
<bwtest />
<text>iView is unmetered for &lt;a href="" target="_blank"&gt;iiNet&lt;/a&gt; customers.</text>

This is doing a lookup of my IP address, to ensure I’m in Australia, and pass me the token. The token has a short lifetime also, only a few minutes. You then need this token to help you build the URL to request the video stream you want.

To find the programs of a particular channel, you need to grab a URL like this:

<?xml version="1.0"?>
<rmp-content xmlns:xsi="">
<channel enabled="true" id="2172737">
<name>ABC CatchUp</name>
<description><![CDATA[Recent best of ABC1 & ABC2 TV]]></description>
<image id="258433" order="1">
<title><![CDATA[ABC Catchup Background 09]]></title>
<version id="1071615">
<image id="257912" order="2">
<title><![CDATA[ABC Catchup background 06]]></title>
<version id="1068909">
<program-title id="352699" promo="false" order="9">
<title><![CDATA[Catalyst Series 10 Episode 8]]></title>
<synopsis><![CDATA[Malaria jumps the gap from monkey to man; could bubbles be a solution to the hard hit  mining industry? And see how a horse trainer applies his skill to the training of elephants, with remarkable success.]]></synopsis>
<publish-date>03/04/2009 12:00:00</publish-date>
<expire-date>17/04/2009 00:00:00</expire-date>
<transmission-date>02/04/2009 00:00:00</transmission-date>
<website>Go to website</website>
<category>Science and Technology</category>
<video-asset id="1619127" order="0">
<program-title id="....">
...more programs...

I’ve shortened the output of the ‘Catch Up’ channel here. This is what you’re likely to see when you get the channel XML file. As you can see, this is describing an episode of Catalyst, and I’ve marked the URL in bold.

TOKEN=`curl -q | grep token | sed 's/<token>//g' | sed 's/\&amp;/\&/g' | sed 's,</token>,,g' | sed 's/ //g'`; ./rtmpdump --rtmp "rtmp://" --auth "auth=${TOKEN}" -t "rtmp://${TOKEN}" -o test.flv

This horrible command is getting the token, and stripping out all unncessesary characters, and then passing it onto rtmpdump. You might have also noticed in the command above, I have four slashes in the RTMP url. This is to work around some assumptions that rtmpdump makes about the path. I had made a patch, but in rtmpdump 1.4, you can just use 4 slashes to make it work.

Most of this data came from doing Wireshark packet traces while working with the flash-based iView interface. Also important to note that the programs have an expiry date also. If the command above returns a ‘stream not found’ message, you’ll probably need a newer episode.

In the next post, I’ll be posting the code for the XBMC plugin.

Posted in Geek by Andy Botting at April 15th, 2009.

10 Responses to “ABC’s iView on XBMC.. update 1”

  1. Jonathan says:

    Looks great! Can’t wait to try it out!

  2. Simon says:

    Hey that XMBC plugin looks complicated but at least with your information I can study it better, I look forward to the next instalments of yor post…

  3. taj says:

    Hmm doesn’t seem to work any more.

  4. taj says:

    Woops, actually it still does work; thanks for this, I got an ep that wasn’t listed on iView site itself but was in XML 🙂

  5. Ben Davey says:

    It seems (from where i live, anyway) that this has changed somewhat; I was able to get an ep through the following commands on rtmpdump 1.5 though:

    TOKEN=`curl -q | grep token | sed ‘s///g’ | sed ‘s/\&/\&/g’ | sed ‘s,,,g’ | sed ‘s/ //g’`; ./rtmpdump_x86 –rtmp “rtmp://” –app “ondemand?auth=${TOKEN}” –playpath “/catch_up/storyindia_09_01_06” –auth “auth=${TOKEN}” -t “rtmp://${TOKEN}” -o test.flv

  6. Jabawok says:

    You’re a genius! Worked a treat!

    I used wireshark along with the real iview flash player to grab the playpath and details I needed (in my case it was flash/playback/_definst_/news/swanspeech_090512.flv ) then used the one-liner above to download the video (with rtmpdump binary in current directory)

  7. taj says:

    After some experimentation, I’ve been able to come up with a (windows) batch script that automates the process of getting the authcode such that all you need to do is input the url (and output name) and it will get it. You get the url from the channel xml files. Relies solely on wget and rtmpdump which is pretty good…

  8. […] to become much harder to get RTMPdump for downloading copies of ABC’s iView files, which I previously posted about. This might also have interesting consequences for XBMC and Boxee which both include […]

  9. Reynold says:

    Brilliant bit of detective work !
    The xml calls seem to change on a regular basis.
    Just start a hack for Mythtv base on your stuff


  10. Defunk says:

    Nice work, I have been looking for something like that for quite some time! I can’t wait to try this!

Leave a Reply

× nine = 36