Use this button to donate in Pounds Sterling (£)

Use this button to donate in US dollars ($)

If you find the site useful, please consider a donation to help cover its running costs.
Thank you


Welcome! Log In Create A New Profile View user locations Top Users Recent Messages

Advanced

Downloading BBC iPlayer using RTMPdump

Posted by Ed 
Calendar Events for the Next Seven Days
Fri (08/29) Sat (08/30) Sun (08/31) Mon (09/01) Tue (09/02) Wed (09/03) Thu (09/04)
Detective - b01
10:00AM Ed Reardon's Weekend
09:30AM Stop Messing About! - a02
Detective - b02
09:00AM The Eric Morecambe and Ernie Wise Show - c01
02:15PM Baldi - d03
02:30PM A Touch of Frost
09:30AM The Navy Lark - a03
12:00AM Old Harry's Game - f05
12:00AM The Maltby Collection - a06
09:00AM Parsley Sidings - b05
 
07:00PM Space Force - 4
   
09:00AM The Goon Show - h07
09:00AM The Burkiss Way - c07
 
         
09:30AM I'm Sorry I'll Read That Again - b02
 
         
06:00PM Choice Grenfell - 2
 
Empty
Ed
Downloading BBC iPlayer using RTMPdump
September 15, 2010 20:53
How to use RTMPdump.exe with the BBC iPlayer for radio -

I use RTMPdump v2.1d (running Windows 98):
[rtmpdump.mplayerhq.hu]

One general point, first. The -o (output) option is chosen by you, the user. You can call the output file whatever you like. If you leave it as the default that I've chosen, do re-name the file to something more useful as soon as you've finished downloading it! Otherwise, the next file you download will overwrite (delete) it!

The colours of the text are only to help you understand what I've done. Don't expect a batch file (a plain text Notepad file with the extension .bat instead of .txt) to contain anything except black-and-white text!

To use this type of Batch file, you may need extra initial DOS memory. So right-click on the .BAT file and select 'Create Shortcut'. Then right-click on the shortcut (a .PIF file), select 'Properties', and on the Memory tab in the 'Initial environment' box select at least 1024 KB of memory, or preferably select 4096; then click on 'Apply'. Then double-click that shortcut PIF in order to run the Batch file.

These are FLV files (an aac encoded audio file, wrapped in an MP4 audio container, all contained in an FLV wrapper). FLV files can be played using GOM Player: [www.filehippo.com]


A. For the highest quality MP4 Audio (MP4 or M4A) file

Use the following command line -

rtmpdump --protocol 0 --host bbcmedia.fcod.llnwd.net -a path?as=data&av=data&te=data&mp=data&et=data&fmta-token=data -y mp4:URL/filename.mp4 -o file_mp4.flv


The parts comprising the -a (or --app) element must be incorporated in it in the order shown above, as the sequence in which its parts are received by the RTMP server is critical.

The authentication strings (et= and fmta-token=) contain session information, so will change on each fresh connection made to the server (which in practice typically means they will expire if a new session is begun, not literally on every attempt to resume a connection), but the other elements will not usually vary from session to session.

In the examples, below, you need to alter the et= string and the fmta-token= string in every session. And you also need to alter the mp= and the identifier= strings, but only once for each radio programme (those latter two stay the same for that particular radio show all week).


B. For an MP3 file

Use this command line -

rtmpdump --protocol 0 --host bbcmedia.edgefcs.net -a ondemand?auth=data&aifp=data&slist=data -y mp3:URL/filename -o file_mp3.flv


As before, the parts comprising the -a (or --app) element must be incorporated in it in the order shown above, as the sequence in which its parts are received by the RTMP server is critical.

The authentication string (auth=) contains session information, so will change on each fresh connection made to the server (typically, if a new session is begun, e.g. the computer is restarted, not literally on every attempt to resume a connection). The other elements will not usually vary from session to session.

In the examples, below, you need to alter the auth= string in every session. And you also need to alter the slist= and the identifier= strings, but only once for each radio programme (those latter two stay the same for that particular radio show all week).


Note - The above describes the simplified form, whereby the stream is first saved to the user's hard disk, to be played back thereafter in a media player capable of playing an FLV encoded file (H.263 or H.264 encoding), such as GOM Player. If it's desired, instead, to play the stream directly from the RTMP server, I don't know how to do that.


The Radio iPlayer in practice

Here are two examples, from the BBC's Radio iPlayer. Both of these are for an on-demand ('Listen Again') file. These examples can't be used with a Live stream.

(NB: In principle these would be similar with a TV show, but in practice TV is rather more complicated because there can be up to six bitstreams to deal with at each step. Also, a 50 minute TV show will result in a download of up to 800MB as compared with 30MB for a 30 minute radio show.)

First, get the URL of the page that plays the radio show you want from this page -

http://www.bbc.co.uk/radio7/programmes/schedules

Second, open the Playlist page (replace the 8 zero's with the 8 digit ID number from the URL of the page that plays the radio show in question):-

http://www.bbc.co.uk/iplayer/playlist/00000000

Third, open the Media Selector page (replace the 8 zero's with the 8 digit Identifier from the Playlist page), as the Media Selector page contains all the information needed below:-

http://www.bbc.co.uk/mediaselector/4/mtis/stream/00000000

To resume an interrupted download, add the option --resume to the command.


A. The highest quality on-demand stream: AAC in MP4A in FLV -

In the Media Selector page, find the section marked bitrate="128" and encoding="aac". All the details come from that section.

This is the contents of my .BAT batch file (you will change all the BLUE text) -

SET mp=bbc7/secure_auth/modem/RBN2_bbc7_-_wednesday_1300_b006v244_2010_08_25_13_00_33.mp4,bbc7/secure_auth/RBN2_bbc7_-_wednesday_1300_b006v244_2010_08_25_13_00_06.mp4

SET et=1282760597

SET fmta-token=7d9c1938f53e65d3a30a0d9e313a917d580ec0055ecfa5b9d45bb35dc1aa7593

SET identifier=mp4:bbc7/secure_auth/RBN2_bbc7_-_wednesday_1300_b006v244_2010_08_25_13_00_33.mp4

rtmpdump --protocol 0 --host bbcmedia.fcod.llnwd.net -a a1414/e3?as=adobe-hmac-sha256&av=1&te=connect&mp=%mp%&et=%et%&fmta-token=%fmta-token% -y %identifier% -o output_mp4a.flv

Note - Batch files are explained at http://www.computerhope.com/batch.htm


B. The MP3 on-demand stream: MP3 in FLV -

In the Media Selector page, find the section marked bitrate="128" and encoding="mp3". All the details come from that section.

This is the contents of my .BAT batch file (you will change all the BLUE text) -

set server=cp48188.edgefcs.net
set auth=daEdwabaccObnascHdZbCb4d7cxcRanc5bf-bmI9Jl-bWG-DnmDCpwoIBvGqzD
set aifp=v001
set slist=secure/bbc7/RBN2_bbc7_-_saturday_1000_b005yg5q_2010_09_11_12_36_00
set identifier=mp3:secure/bbc7/RBN2_bbc7_-_saturday_1000_b005yg5q_2010_09_11_12_36_00

rtmpdump --protocol 0 --host %server% -a ondemand?auth=%auth%&aifp=%aifp%&slist=%slist% -y %identifier% -o output_mp3.flv


C. The MP4 live stream: AAC in MP4 in FLV -

For the live stream, you only need the Media Selector page.

To open the Media Selector page you use a special name for the radio station, instead of using the 8-digit ID number (because, unlike the individual radio programmes, the station name always stays the same). The station names are:-

bbc_radio_one
bbc_radio_two
bbc_radio_three
bbc_radio_fourfm
bbc_radio_five_live
bbc_6music
bbc_7

This is the Media Selector page's URL address (you replace the BLUE text with the station name, then paste the result into the Address line of your browser) -

http://www.bbc.co.uk/mediaselector/4/mtis/stream/xxxxxxxxxxxxxxx


When the Media Selector page opens, find the section marked bitrate="128" and encoding="aac". All the details come from that section.

This is the contents of my .BAT batch file (you will change all the BLUE text) -

set server=cp60691.live.edgefcs.net
set auth=daEdzb5dMd4bHdzdea4abdBcibXdbaQcud0-bmNFCF-bWG-GosGIqCoIEsHrwI
set slist=Radio_7_UK_Low@s7081;Radio_7_UK@s6464
set identifier=Radio_7_UK@s6464

rtmpdump --live --protocol 0 --host %server% -a live?auth=%auth%&aifp=v001&slist=%slist% --playpath %identifier%?auth=%auth%&aifp=v001&slist=%slist% -o live_mp4.flv

The above example is for Radio 7. For that station, the server is always cp60691.live.edgefcs.net and the identifier is always Radio_7_UK@s6464 so only the auth= and slist= items need to be changed. (If you want to record a different station, say Radio 4, then all four of the set instructions will be different.)



Edited 9 time(s). Last edit at 09/25/2010 14:42 by Ed.
Re: Downloading BBC iPlayer using RTMPdump
September 15, 2010 22:16
avatar
Good work there, Ed!

I haven't checked this lot - I can't - but it looks as though you've done your homework.

On that basis, I've made it a Sticky (it should stay at the top of the posts in the "Downloading Programmes (Hypothetically)" phorum) as although you're on 98, this lot should work for Windows variants.

Are you aware of Phil Lewis' get_iplayer? Just google for it. He pulled it some time ago because of his opposition to the Beeb's ethos, and I pulled some stuff over here in accordance with his sentiments, although he didn't ask me to.

It's still around - again, Google is your friend - as is (as you know) rtmpdump, even though this was the subject of a DMCA take-down request from Adobe that completely backfired.

However, get_iplayer still works (brilliantly!) if you use rtmpdump instead of the forked flvstreamer. I've had this working on Windows, although I'm now Linuxy.

I've been musing on this topic for some time - as in whether to go public or not. You may just have kicked me into action.

Cheers, K

[EDIT] PS: If you have a mo then do a search - as in the North East area of where you're reading this - for get_iplayer
The get_iplayer helper is no more - for the moment...
[/EDIT]



Edited 2 time(s). Last edit at 09/15/2010 22:27 by Kronalias.
Ed
Re: Downloading BBC iPlayer using RTMPdump
September 25, 2010 15:18
I'm very much aware of get_iplayer. I had a lively e-mail correspondence with Phil, as I tried to provide perspectives on it from a Windows user's point-of-view. It was developed for Linux, so always presented problems for Windows users. Phil thought it was truly cross-platform, and I didn't have the heart to point out why it really wasn't.

As a Perl script, get_iplayer was especially complicated for average Windows users - generally turning out to be their first encounter with Perl. And as Phil often complained to me, his script just didn't run properly on the standard Windows variants of Perl. Eventually it was possible to run it on ActivePerl instead, but the dependence on Perl was always a drawback (because trying to install Perl for the first time further complicated an already difficult situation).

It gradually became impossible for Phil to maintain get_iplayer for Windows 98, and on Windows the program slowly morphed into an XP-only program. Then Phil abandoned development, and it's now maintained by a different developer, who also hasn't been able to cure the problems that restrict it to WinXP and later.

It still works on Windows 98 in a limited way. Actually, I suppose it works "as advertised", since it was originally touted only as a solution for downloading the iphone mp3 stream, and it still does do that. But under Win98 it no longer works at all with rtmpdump, so I migrated my efforts onto rtmpdump instead.

All the solutions I've posted in this thread are rtmpdump solutions (for the latest version that runs on Win98, namely rtmpdump v2.1d). Flvstreamer only works on Windows XP, not under Win98. But rtmpdump works fine on Win98. For anyone running WinXP, rtmpdump v2.2 is also available (but this, too, doesn't run on Win98).

I decided to take a crack at a "bare bones" solution using rtmpdump - which culminated in the solutions I've posted here: two options for every Listen Again show (i.e. a choice of mp3 or mp4 audio), and an mp4 option for the Live stream. Actually, the Live stream has two options as well, since you can optionally save either the high quality 128 kbps stream or the low quality 48 kbps stream, depending which of the alternatives in the slist= item you put in the identifier= item.

I hope it's an easier solution. It's just a single Windows executable program (rtmpdump.exe), with no need to install ActivePerl for Windows, and no need to keep downloading new versions of the get_iplayer script (which Phil updated about twice a week).


Note -

There is yet another stream revealled by the Media Selector page for each radio show, and for the Live stream: a wma stream (actually an mms: stream) running at 96 kbps. This can be downloaded without needing get_iplayer or rtmpdump, as it's wma (and so not a Flash rtmp stream at all).

This wma stream can be downloaded using a traditional GUI program for Win98, called SDP Multimedia v2.0.0 -

Windows 9x version: [www.3113.com]

Or get the Windows XP version (only runs on WinXP and later): http://sdp.ppona.com



Edited 2 time(s). Last edit at 09/25/2010 15:28 by Ed.
Re: Downloading BBC iPlayer using RTMPdump
September 25, 2010 19:26
avatar
Hi Ed

I've just uploaded the old get_iplayer helper for Windows, as I'm pretty sure Phil won't mind now.

It's here:
http://beebotron.org/helper_get_iplayer.php

I have no idea whether this still works (it was made for XP), but it may be worth a try for you.

You prolly know that I've gone Linux (not because I'm one of those people who say 'Linux is better than Windows' or vice versa - it's just that Linux had a killer app - MythTV - that converted me) so if you want this changed for Windows we'll have to work together.

Lemme know how you get on!

Cheers, K
Re: Downloading BBC iPlayer using RTMPdump
October 04, 2010 16:09
Just a quick note to highlight that the UK HTTP proxy docoja.com that Kronalias had used with his standard helper page seems to be doing some strange things with beeb pages at the moment - and when used with get_iplayer it seems to persistently fail to retrieve the bbc.co.uk pages required to allow get_iplayer to do its work (automating the manual steps Ed has been describing above)

This will in no way impact online-from-within-the-UK users, but is something to take note of for everybody else!
Ed
Re: Downloading BBC iPlayer using RTMPdump
October 07, 2010 07:41
Play a Radio stream while downloading it

Here's my solution for playing a live stream whilst rtmpdump is saving it to disk, or for playing an on-demand stream whilst rtmpdump is downloading it, using Windows 98.

Note - The following solution will work for ANY download of a radio or television show (even non-BBC shows), using ANY download method (not just rtmpdump). Even if you use an automated downloader such as get_iplayer or iplayer_dl the following procedure will play the file while it's still downloading - a godsend for live streams!)

This uses the program FFPLAY.EXE (which is included in standard distributions of ffmpeg). You run it in a seperate (i.e. second) DOS window at the same time that rtmpdump is downloading the rtmp stream in a DOS window.

Here's a version of ffmpeg which will run under Windows 98 (SVN-r16573) (13 Jan 2009): http://ffmpeg.arrozcru.org/builds/shared/ffmpeg-r16537-gpl-shared-win32.tar.bz2

(Note: The latest ffmpeg version which runs on Win9x is release r21874)

An important point is that the batch file must be in the same folder (directory) into which rtmpdump is saving the rtmp stream.

Another important point is that both RTMPDUMP and FFPLAY must be set to use .FLV as the file type, because the batch file (see below) sets FFPLAY to play any file with that file type in the current directory.


1. Playing a Radio show while downloading it

This is the content of my successful batch (.BAT) file for a radio show (using the option -vn to specify no video, as this is a radio stream) -

:: Syntax
:: ffplay [options] 'input_file'

:: Play radio stream while it's downloading

"C:\Program Files\ffmpeg\ffplay.exe" -vn *.flv

(Note: This works for both a Live stream and an On-demand stream)


Here's an alternative command line -

Play a Radio stream as it Downloads: With Buffer, No Display

"C:\Program Files\ffmpeg\ffplay.exe" -vn -nodisp -bufsize 4096 *.flv


2. Playing a TV show while downloading it

I then tried this procedure on a television stream, successfully. I was astonished at how the crappy performance of Flash Player on Windows 98 was magically replaced by a perfect video stream. The TV stream (an on-demand tv show) played perfectly, with no hesitating or dropped frames.

I used only one trick! I didn't start the show playing in FFPLAY until rtmpdump had been downloading the show for 15 seconds, thus building-in a 15 second buffer.

Note: I had set rtmpdump to save the TV show as a file with the extension .mp4 on this occasion. If you save a show as a .flv file, remember to alter the command line (below) from *.mp4 to *.flv instead.

It was a revelation, using the following command line in the above batch file instead of the radio command -

Play on-demand TV show with 4MB Buffer

"C:\Program Files\ffmpeg\ffplay.exe" -bufsize 4096 *.mp4



Edited 2 time(s). Last edit at 10/07/2010 07:49 by Ed.
Ed
Re: Downloading BBC iPlayer using RTMPdump
April 03, 2011 17:18
Radio 4 Extra

Radio 7 was abolished on 1 April 2011. A revised radio service is provided by Radio 4 Extra. The change from Radio 7 to Radio 4 Extra has resulted in a modification of the BATCH (.BAT) file for downloading a Listen Again iplayer file. The revised .BAT file is as follows (the colours merely highlight this example, and are not part of the .BAT file).


Firstly, this is how to locate the Media Selector file -

1.Open the Playlist page (replace the 8 zero's with the 8-digit number in the URL of the BBC page that plays the iPlayer show):

http://www.bbc.co.uk/iplayer/playlist/00000000

2. Open the Media Selector page (replace the 8 zero's with the 8 digit Identifier contained in the Playlist page):

http://www.bbc.co.uk/mediaselector/4/mtis/stream/00000000


The revised .BAT file, which must be completed with details from the Media Selector page for the radio show in question (copy and paste the four relevent parts of the Media Selector page, to complete the four SET instructions) -

SET mp=
SET et=
SET fmta-token=
SET identifier=


rtmpdump -r "rtmp://bbcmedia.fcod.llnwd.net:1935/a1414/e3?as=adobe-hmac-sha256&av=1&te=connect&mp=%mp%&et=%et%&fmta-token=%fmta-token%" -a "a1414/e3?as=adobe-hmac-sha256&av=1&te=connect&mp=%mp%&et=%et%&fmta-token=%fmta-token%" -y "mp4:radio4extra/secure_auth/%identifier%" -o output_mp4a.flv

It is the text highlighted here in red which has changed. The four SET instructions are unchanged from the Radio 7 days.


Here's an example. When you're finished, the completed SET commands in the .BAT file should look like similar to this -

SET mp=radio4extra/secure_auth/RBN2_radio_4_extra_-_sunday_0330_b00c79c2_2011_04_03_03_59_44.mp4,radio4extra/secure_auth/modem/ RBN2_radio_4_extra_-_sunday_0330_b00c79c2_2011_04_03_04_00_12.mp4
SET et=1301836044
SET fmta-token=f9db339767bf11e400ce4de3ae4f74467f20181c8c67ede1bd968bf33ce12a5b
SET identifier=RBN2_radio_4_extra_-_sunday_0330_b00c79c2_2011_04_03_03_59_44.mp4



Note: The part of the 'Identifier' string to include in the SET instruction is only the filename, as in the example above, not the entire Path.



Edited 4 time(s). Last edit at 04/03/2011 17:29 by Ed.
Ed
Re: Downloading BBC iPlayer using RTMPdump
April 05, 2011 07:25
I prefer the user-friendliness of Windows 98.

If your system can stand it [needs a minimum of Windows XP Service Pack 3], a useful GUI front-end for RTMPDUMP is RTMPexplorer. The latter has two advantages -

- No need to search for the host/server address
- No need to edit the HOSTS file

Installation notes:
- Copy rtmpsrv.exe to the same folder as rtmpexplorer.exe
- Copy rtmpdump.exe to the same folder as rtmpexplorer.exe

Usage:
- Start rtmpExplorer.
- Type the URL address of the iPlayer page that plays the radio programme into rtmpExplorer, instead of typing it into your normal browser.
- Click the 'Go' button in rtmpExplorer.
- The download may sometimes appear to keep restarting, but actually this seems to be an automatic RESUME function that adds to the partially downloaded file rather than overwriting it.

System Requirements:
Microsoft's .net Framework 4 (requires WinXP SP3, Vista SP2, or Windows 7, with a 1 GHz processor and 512 MB RAM).

Download link:
[rapidshare.com]
Ed
Re: Downloading BBC iPlayer using RTMPdump
July 13, 2011 20:42
On 12 July 2011, the BBC made changes to their iPlayer service for the BBC Radio 'listen again' streams.

The new server is: bbcodspdns.fcod.llnwd.net

The new application is: a5999/e1


The new batch file you'll need to write is thus -


:: Settings which do NOT change -
SET server=bbcodspdns.fcod.llnwd.net
SET application=a5999/e1
SET as=adobe-hmac-sha256
SET av=1
SET te=connect

:: Settings from Media Selector page -
SET et=
SET fmta-token=
SET identifier=
SET mp=

rtmpdump -r "rtmp://%server%:1935/%application%?as=%as%&av=%av%&te=%te%&mp=%mp%&et=%et%&fmta-token=%fmta-token%" -a "%application%?as=%as%&av=%av%&te=%te%&mp=%mp%&et=%et%&fmta-token=%fmta-token%" -y "%identifier%" -o output.flv
Re: Downloading BBC iPlayer using RTMPdump
August 01, 2011 21:33
avatar
Can someone please walk me through the process of how to do this? I am not sure where to start. I have installed RTMPdump, now what?

With both Radio Downloader and Net Transfer not working for me I am running out of options--the reason for which I am still on dial up. And please don't tell me to upgrade to high speed, that is not an option.

Thanks for any help.
Re: Downloading BBC iPlayer using RTMPdump
August 03, 2011 07:52
avatar
This has gone through so many changes since the switchover, Mars, I'm at a loss. Kronalias might be able to help when he gets a chance. He has his hands full at the moment though, so it may be awhile.

I use Total Recorder Pro so I can listen and record streams through that now. It's $30, but I don't know if you're looking to spend any money at the moment. They do have a free trial though (for the regular Recorder) so you can see if you like it or not. Other than that I'm of no help I'm afraid. sad smiley
Re: Downloading BBC iPlayer using RTMPdump
August 03, 2011 19:36
avatar
Oh Jan, I am on dial up, so your suggestion is not a solution unfortunately. I have Freecorder and Audacity so I am covered on the recording streaming audio side. I spend more time cutting out the silent gaps than listening to the shows themselves. I think the change on 7/28 did something to access to the audio streams (both Radio Player and WMA streams for me) and locked me out essentially. When I changed ISPs I was able to download again, but there are hiccups this morning. I think I will try WMA again to see if that's more stable than Radio Player.

Good thing the first month on this new ISP is free for a month so I can keep my AOL for another month any way.
Re: Downloading BBC iPlayer using RTMPdump
August 03, 2011 19:47
avatar
My ADSL has been up and down like Yo-yo, all afternoon. There has been a race between the red arrow and me logging into Beebotron.I came off rather ignominiously - as Lonnie Donegan put it.

. Ivor



The original and real cat with the swishy tail.
Accept no imitations.
Re: Downloading BBC iPlayer using RTMPdump
August 03, 2011 22:11
avatar
Net Transport slowed to a mere trickle noon time (here) so it might have been traffic problem. But it looks like the streaming speed has improved since. Using both RD and Net Transport today because things had been rather unstable connection wise. Still can't understand the IP address rejected by the BBC site though.
Re: Downloading BBC iPlayer using RTMPdump
August 04, 2011 00:38
avatar
I've had some difficult today as well. For awhile there I couldn't connect to any BBC streams and the websites were pretty iffy too. It seems better now, though a bit slower than usual. Even the Phorum is loading slower today.

(By the by, Mars, my TRP has a setting that takes care of the gaps automatically, so I don't even know they existed. Love that feature. )
Re: Downloading BBC iPlayer using RTMPdump
August 04, 2011 01:19
avatar
The first thing I downloaded with RD this afternoon is the Proms program. I suspect it's the entire show rather than just 50 minutes. The BBC lists the programs as 2 50 minute episodes, but this is probably both episodes like they did with Doctor Who last year.
Re: Downloading BBC iPlayer using RTMPdump
August 04, 2011 03:10
avatar
Mine seems to be moving a little better at the moment, thank goodness. Glad you got something at least, Mars. smiling smiley
Re: Downloading BBC iPlayer using RTMPdump
August 04, 2011 03:38
avatar
I hadn't quite got to the DTs stage of withdrawal yet, but I wanted to have a complete set of Cabin Pressure at the very least.

The Proms download started at 2:30 and it's still going at 7:34 so I don't know if the traffic is just slow or if this is more than two hours of music.

I looked ahead on what's coming up on the Proms and they have an interesting program on the music of Spaghetti Westerns. I don't think it will be the usual orchestral set up nor will it be like the major Sondheim or Rodgers and Hammerstein Proms from last year.
PAW
Re: Downloading BBC iPlayer using RTMPdump
August 04, 2011 16:05
avatar
If the Proms you're talking about are the Horrible Histories, then the files are:

part 1 - 2 hours 30 & 137mb, it has the first part of the prom (just over an hour), then the Twenty Minutes programme in the interval, then the second part of the prom (just over an hour), and about 15 minutes of the next programme.

part 2 is 1 hour 35 & 87mb, it has the last 10 minutes of Twenty Minutes, then part two of the prom, then about 30 minutes of the next programme.

So don't bother getting the second file.
Re: Downloading BBC iPlayer using RTMPdump
August 04, 2011 18:03
avatar
That's what I thought. Thanks Paul.
Re: Downloading BBC iPlayer using RTMPdump
August 04, 2011 20:22
avatar
Janaru Wrote:
-------------------------------------------------------
> I've had some difficult today as well. For awhile
> there I couldn't connect to any BBC streams and
> the websites were pretty iffy too. It seems better
> now, though a bit slower than usual. Even the
> Phorum is loading slower today.
>
> (By the by, Mars, my TRP has a setting that takes
> care of the gaps automatically, so I don't even
> know they existed. Love that feature. )

I think we can safely say the slow down is due to the time of day. It's lunch time here on the left coast and coffee break time on the east coast. Today is slow as well. But all that has probably to do with the free fall Wall Street is taking today. People are checking to see if there's anything left of their investments.
Re: Downloading BBC iPlayer using RTMPdump
August 04, 2011 22:43
avatar
Very likely, Mars.
Ed
Re: Downloading BBC iPlayer using RTMPdump
August 09, 2011 09:17
lifeonmarsfan Wrote:
-------------------------------------------------------
> Can someone please walk me through the process of
> how to do this? I am not sure where to start. I
> have installed RTMPdump, now what?


BBC iPlayer for Radio - Revised RTMPDump batch file

First, get the URL of the page that plays the radio show you want, from this page -

http://www.bbc.co.uk/radio4extra/programmes/schedules


Second, open the Playlist page with the following command (replace the 8 zero's with the 8 digit ID number from the URL of the page that plays the radio show):-

http://www.bbc.co.uk/iplayer/playlist/00000000


Third, open the Media Selector page with the following command (replace the 8 zero's with the 8 digit Identifier from the Playlist page):-

http://www.bbc.co.uk/mediaselector/4/mtis/stream/00000000

Note - This is the Media Selector page, which contains all the information needed below.


The on-demand stream: AAC in MP4A in FLV

In the Media Selector page, find the section marked bitrate="128" and encoding="aac". All the details needed below come from that section.

1. Write a batch file using Notepad.exe (i.e. copy and paste the blue text below into an empty text file, save it using Notepad, then rename the file 4EXTRA.BAT).

Note - The file must be named 4EXTRA.BAT not 4EXTRA.BAT.TXT

Note - Batch files are explained at http://www.computerhope.com/batch.htm

2. Complete the settings et= and fmta-token= and identifier= and mp= with the settings in the Media Selector page.

Note - The text in the rest of the batch file always remains the same. Only these four settings need altering. Don't change anything else.

3. Put the batch file in the same folder/directory as RTMPDUMP.EXE v2.1d

4. Double-click the batch file, with a live internet connection open.

Note - It will stream at the maximum speed for your connection. If you use dial-up, you might need to resume the download if it stops. Just add --resume to the end of the command, after -o output.flv


:: Settings which do NOT change -
SET server=bbcodspdns.fcod.llnwd.net
SET application=a5999/e1
SET as=adobe-hmac-sha256
SET av=1
SET te=connect

:: Settings from Media Selector page -
SET et=
SET fmta-token=
SET identifier=
SET mp=

rtmpdump -r "rtmp://bbcodspdns.fcod.llnwd.net:1935/a5999/e1?as=adobe-hmac-sha256&av=1&te=connect&mp=%mp%&et=%et%&fmta-token=%fmta-token%" -a "a5999/e1?as=adobe-hmac-sha256&av=1&te=connect&mp=%mp%&et=%et%&fmta-token=%fmta-token%" -y "%identifier%" -o output.flv



To resume an interrupted download, add the option --resume to the command.


Example

This is an example of the contents of a .BAT batch file.

The GREEN text has been added from the Media Selector page, obtained above (from the section of the Media Selector page marked bitrate="128" and encoding="aac").

Use a copy-and-paste operation to copy text from the Media Selector page into your .BAT batch file.


:: Settings which do NOT change -
SET server=bbcodspdns.fcod.llnwd.net
SET application=a5999/e1
SET as=adobe-hmac-sha256
SET av=1
SET te=connect


:: Settings from Media Selector page -

SET mp=radio4extra/secure_auth/modem/RBN2_radio_4_extra_-_monday_ 0230_b0028jz6_2011_07_18_03_51_39.mp4, radio4extra/secure_auth/ RBN2_radio_4_extra_-_monday_0230_b0028jz6_2011_07_18_03_45_17.mp4

SET et=1310975824

SET fmta-token=ad86f56eb16052f9214234a3fbfbfa0c2e09e0ffcfa33fc7a122d3814012b9c1

SET identifier=mp4:radio4extra/secure_auth/RBN2_radio_4_extra_-_monday_0230_b0028jz6_2011_07_18_03_45_17.mp4


rtmpdump -r "rtmp://bbcodspdns.fcod.llnwd.net:1935/a5999/e1?as=adobe-hmac-sha256&av=1&te=connect&mp=%mp%&et=%et%&fmta-token=%fmta-token%" -a "a5999/e1?as=adobe-hmac-sha256&av=1&te=connect&mp=%mp%&et=%et%&fmta-token=%fmta-token%" -y "%identifier%" -o output.flv





Other Solutions

RTMPDump v2.2d solutions -
http://stream-recorder.com/forum/rtmpdump-v2-2d-command-exit-code-1-t6663.html

RTMPE streams and RTMPDump v2.4 -
http://stream-recorder.com/forum/showthread.php?p=31422#post31422

RTMPDump general solutions -
http://streemeboxvcr.yuku.com/topic/2238

Solutions involving Get_iPlayer / RTMPDump / MP3 streams / WMA streams -
http://myweb.tiscali.co.uk/bridip/clitheroe/iplayer.htm



Edited 4 time(s). Last edit at 08/09/2011 10:02 by Ed.
Re: Downloading BBC iPlayer using RTMPdump
August 09, 2011 18:46
avatar
Thanks Ed, this is a gift. Your help is much appreciated.
Ed
Re: Downloading BBC iPlayer using RTMPdump
August 19, 2011 10:44
These are the three batch files I use for downloading 'Listen Again' radio shows from the BBC iPlayer, for station Radio 4 Extra (formerly Radio 7), using RTMPDump.exe and RTMPsrv.exe v2.1d :


Note : The only edit needed each time is in line 2 of the first file, replacing the 8 zero's with the 8 digit PID - Programme ID - from the URL address of the iPlayer page that plays the radio show you want.

Note : I set up these files on a test laptop that was running Windows 7. The HOSTS directory address on your computer may be different in earlier versions of Windows.



Run #1 - Preliminary Matters + Start RTMPSRV.bat

@echo off
SET PID=00000000

:: ======================================================== ::

cls
SET open="C:\Program Files (x86)\Internet Explorer\IEXPLORE.EXE"

:: Open the Playlist page (to obtain Identifier) -
%open% [www.bbc.co.uk]%

:: Create a URL for the MediaSelector page (to inject Identifier in) -
echo @echo off>> MediaSelector.bat
echo. >> MediaSelector.bat
echo "C:\Program Files (x86)\Internet Explorer\IEXPLORE.EXE" [www.bbc.co.uk]; MediaSelector.bat
echo. >> MediaSelector.bat
echo cls>> MediaSelector.bat
C:\WINDOWS\NOTEPAD.EXE MediaSelector.bat

:: ======================================================== ::

rem  *** Create "Run #2" Link ***

IF EXIST Run#2*.PIF DEL Run#2*.PIF
IF EXIST "Run #2.url" DEL "Run #2.url"
IF EXIST "Run #2 - Play iPlayer.url" DEL "Run #2 - Play iPlayer.url"

echo @ECHO OFF>> "Run #2.bat"
echo "C:\Program Files (x86)\Internet Explorer\iexplore.exe" "[www.bbc.co.uk]; "Run #2.bat"
echo CLS>> "Run #2.bat"

:: ================================================================= ::

rem  *** Create "Photos" Links ***

echo @ECHO OFF>> Photos.bat
echo.>> Photos.bat
echo SET open="C:\Program Files (x86)\Internet Explorer\iexplore.exe">> Photos.bat
echo SET url=http://node2.bbcimg.co.uk/iplayer/images/episode>> Photos.bat
echo.>> Photos.bat
echo %%open%% %%url%%/%PID%_150_84.jpg>>  Photos.bat
echo %%open%% %%url%%/%PID%_178_100.jpg>> Photos.bat
echo %%open%% %%url%%/%PID%_261_147.jpg>> Photos.bat
echo %%open%% %%url%%/%PID%_303_170.jpg>> Photos.bat
echo %%open%% %%url%%/%PID%_512_288.jpg>> Photos.bat
echo %%open%% %%url%%/%PID%_528_297.jpg>> Photos.bat
echo %%open%% %%url%%/%PID%_640_360.jpg>> Photos.bat
echo.>> Photos.bat
echo CLS>> Photos.bat
echo.>> Photos.bat
echo.>> Photos.bat

:: ================================================================= ::

rem  *** Edit the HOSTS file ***

IF EXIST C:\WINDOWS\SYSTEM32\DRIVERS\ETC\NOHOSTS REN C:\WINDOWS\SYSTEM32\DRIVERS\ETC\NOHOSTS HOSTS

rem  Replace line 1 with this:
rem  127.0.0.1   bbcmedia.fcod.llnwd.net

IF EXIST C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS_XX ECHO.
IF EXIST C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS_XX ECHO HOSTS_XX already exists: Aborting!
IF EXIST C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS_XX PAUSE
IF EXIST C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS_XX GOTO END

C:\WINDOWS\SYSTEM32\ATTRIB.EXE -R -S -H C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS
REN C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS HOSTS_XX
:: Next line: Setting prior to 1pm on 12 July '10
:: echo 127.0.0.1  bbcmedia.fcod.llnwd.net> C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS
:: Next line: Setting FROM 1pm on 12 July '10 onwards
echo 127.0.0.1  bbcodspdns.fcod.llnwd.net> C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS
C:\WINDOWS\SYSTEM32\ATTRIB.EXE +R +H C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS

cls

:: ================================================================= ::

rem  *** Start RTMPSRV ***

:: Start RTMPSRV.EXE and pipe the URLs it displays to a .BAT file
:: to be used with RTMPDUMP to download the iPlayer file

"C:\Users\dg\Desktop\General\iPlayer\- Recording iPlayer\rtmpsrv.exe" > RTMPdump_run.bat


:END
cls




Run #3 - Run RTMPdump_run.bat

@echo off

rem  *** Edit the HOSTS file ***

rem  Wait 8 Seconds
echo.
echo Wait 8 Seconds ...
echo.
@CHOICE /T 8 /C yn /D y > NUL

cls

rem  Restore the normal line 1:
rem  127.0.0.1   localhost

C:\WINDOWS\SYSTEM32\ATTRIB.EXE -R -S -H C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS
IF EXIST C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS_XX DEL C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS
IF EXIST C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS_XX REN C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS_XX HOSTS
C:\WINDOWS\SYSTEM32\ATTRIB.EXE +R +H C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS

:: ================================================================= ::

rem  *** Run RTMPDUMP ***
CALL RTMPdump_run.bat

rem  *** Rename the downloaded file ***
:: REN *.MP4 *.flv

rem  *** Save the Download command ***
COPY "Notes.txt"+"RTMPdump_run.bat" "Notes_New.txt"
echo. >> "Notes_New.txt"
DEL "Notes.txt"
REN "Notes_New.txt" "Notes.txt"

rem  *** Save the SWFINFO file ***
COPY "Notes.txt"+".swfinfo" "Notes_New.txt"
echo. >> "Notes_New.txt"
echo. >> "Notes_New.txt"
DEL "Notes.txt"
REN "Notes_New.txt" "Notes.txt"

rem  *** Open MediaSelector page ***
IF EXIST MediaSelector.bat CALL MediaSelector.bat

rem  *** Tidy Up ***
IF EXIST *.swfinfo DEL *.swfinfo
IF EXIST RTMPdump_run.bat DEL RTMPdump_run.bat
IF EXIST MediaSelector.bat DEL MediaSelector.bat
IF EXIST Run#2*.PIF DEL Run#2*.PIF
IF EXIST "Run #2.BAT" DEL "Run #2.BAT"

:: ================================================================= ::

:: Delete BBC Cookies
DEL C:\Users\dg\AppData\Roaming\Microsoft\Windows\Cookies\dg@bbc.*[*].txt
DEL C:\Users\dg\AppData\Roaming\Microsoft\Windows\Cookies\dg@bbc.co[*].txt
DEL C:\Users\dg\AppData\Roaming\Microsoft\Windows\Cookies\dg@www.bbc.co[*].txt
DEL C:\Users\dg\AppData\Roaming\Microsoft\Windows\Cookies\dg@cookie.radioplayer.co[*].txt
DEL C:\Users\dg\AppData\Roaming\Microsoft\Windows\Cookies\dg@static.radioplayer.co[*].txt

:: ================================================================= ::

cls




Run #4 - Rename FLV file.bat

@echo off

rem  *** Rename the downloaded file ***
IF EXIST *.MP4 REN *.MP4 *.flv

setlocal enabledelayedexpansion

for %%j in (RBN2_radio_4_*.flv) do (
set filename=%%~nj
set filename=!filename:RBN2_radio_4_-_=!
set filename=!filename:RBN2_radio_4_extra_-_=!
set filename=!filename:monday=Mon!
set filename=!filename:tuesday=Tue!
set filename=!filename:wednesday=Wed!
set filename=!filename:thursday=Thu!
set filename=!filename:friday=Fri!
set filename=!filename:saturday=Sat!
set filename=!filename:sunday=Sun!
set filename=!filename:_b00= [b00!
set filename=!filename:_b01= [b01!
set filename=!filename:_2011_01_=] 2011-01-!
set filename=!filename:_2011_02_=] 2011-02-!
set filename=!filename:_2011_03_=] 2011-03-!
set filename=!filename:_2011_04_=] 2011-04-!
set filename=!filename:_2011_05_=] 2011-05-!
set filename=!filename:_2011_06_=] 2011-06-!
set filename=!filename:_2011_07_=] 2011-07-!
set filename=!filename:_2011_08_=] 2011-08-!
set filename=!filename:_2011_09_=] 2011-09-!
set filename=!filename:_2011_10_=] 2011-10-!
set filename=!filename:_2011_11_=] 2011-11-!
set filename=!filename:_2011_12_=] 2011-12-!
set filename=!filename:~0,-9%!
set filename=!filename:_= !
if not "!filename!"=="%%~nj" ren "%%j" "!filename!%%~xj"
)
Ed
Manual Downloader
January 07, 2012 11:56
Now here is a .BAT (batch) file for downloading an RTMP stream (i.e. a radio show) from the radio iplayer.

The details to be inserted in the sections mp= and et= and fmta-token= and identifier= are obtained from the mediaselector page for the radio show in question (in the section marked bitrate="128" encoding="aac").

The url address of the media selector page looks like this (except that the 8 zero's are replaced with an ID code unique to each radio show) -

http://www.bbc.co.uk/mediaselector/4/mtis/stream/00000000


For all Radio 4 Extra shows broadcast in the last seven days, the complete media selector url can be found at -

http://www.bbc.co.uk/radio/aod/availability/radio4extra.xml

That is a master index of all currently available 'listen again' shows for the Radio 4 Extra station.



Note : This post takes into account all changes made to BBC iPlayer in 2011.




Download.bat
::  *** Always different ***
SET mp=
SET et=
SET fmta-token=
SET identifier=

::  *** Always the same ***
SET server=bbcodspdns.fcod.llnwd.net
SET application=a5999/e1
SET as=adobe-hmac-sha256
SET av=1
SET te=connect

::  *** RTMPDump location ***
SET rtmpdump="C:\Program Files\rtmpdump\rtmpdump.exe"

::  *** Command : Radio 4 Extra ***
%rtmpdump% --protocol 0 --host "%server%" -a "%application%?as=%as%&av=%av%&te=%te%&mp=%mp%&et=%et%&fmta-token=%fmta-token%" -y "%identifier%" -o "%identifier%"



Example

Here is an example of what the 128 kbps aac stream details, in the media selector page, look like. I have highlighted in bold the key parts -

<media bitrate="128" encoding="aac" expires="2012-01-14T01:02:00+00:00" kind="audio" service="iplayer_uk_stream_aac_rtmp_concrete" type="audio/mp4">
<connection application="a5999/e1" authExpires="2012-01-07T13:45:03+00:00" authString="as=adobe-hmac-sha256&av=1&te=connect&mp=radio4extra/secure_auth/RBN2_radio_4_extra_-_saturday_0030_b0027xx1_2012_01_07_01_32_09.mp4,radio4extra/secure_auth/modem/RBN2_radio_4_extra_-_saturday_0030_b0027xx1_2012_01_07_01_34_02.mp4&et=1325945232&fmta-token=c871135ef1b90cb394894c3ef8b3ea2580ea4f711cc956547cda16deafd5af98" identifier="mp4:radio4extra/secure_auth/RBN2_radio_4_extra_-_saturday_0030_b0027xx1_2012_01_07_01_32_09.mp4" kind="limelight" priority="9" protocol="rtmp" server="bbcodspdns.fcod.llnwd.net" supplier="limelight" />
</media>



Edited 5 time(s). Last edit at 01/07/2012 12:36 by Ed.
Re: Manual Downloader
January 07, 2012 22:31
avatar
Thanks for that, Ed. smiling smiley
Ed
Parsing a BBC MediaSelector XML page with Javascript
February 17, 2012 21:03
I have now developed a method for downloading an iPlayer radio file using the MediaSelector url (e.g. obtained from http://www.bbc.co.uk/radio/aod/availability/radio4extra.xml ).

I will post the code, merely a standard HTM file actually, at the foot of this page.



Edited 1 time(s). Last edit at 02/17/2012 21:12 by Ed.
Ed
Parsing a BBC MediaSelector XML page with Javascript
February 17, 2012 21:09
This is a method for downloading an iPlayer file using a MediaSelector url (e.g. obtained from http://www.bbc.co.uk/radio/aod/availability/radio4extra.xml ).

The code, below, is the content for the file Download.htm (a file which runs Javascript).

Create an empty text file using NOTEPAD.EXE and copy-and-paste the HTML code below into it. This type of Javascript requires Internet Explorer. Run the .HTM file from your hard disk, in Internet Explorer; it won't run if you upload it to the internet.

To run it successfully, the user need only change the MediaSelector url highlighted in red (i.e. substitute the MediaSelector url of the iPlayer radio show you want to download).

The .HTM file creates a .BAT (batch) file on your Desktop. Put RTMPDUMP.EXE in the directory C:\Program Files\rtmpdump in order to run this .BAT file.

It downloads a media file with the extension .mp4 so you must alter that file's extension from .mp4 to .flv (and play it in GOM Player, or in Winamp 5.60 or later). The media file is an AAC file at 128 kbps (the highest quality used by the radio iPlayer). MP4 Audio using AAC at 128 kbps is what is commonly termed an iTunes format file.


<html>
<head>
<title>Parse XML File</title>

<!-- Downloading from a BBC iPlayer page -->
<!-- This parses the elements in a MediaSelector xml page -->


<SCRIPT>

// Target XML file's URL address [MediaSelector URL]
var url = "http://www.bbc.co.uk/mediaselector/4/mtis/stream/b01by95r" ;


var xmlDoc;

window.open('','_self');

function loadxml()
{
   xmlDoc = new ActiveXObject( "Microsoft.XMLDOM" );
   xmlDoc.async = false;
   xmlDoc.onreadystatechange = readXML;
   xmlDoc.load(url);
}


function readXML()
{
   if(xmlDoc.readyState == 4) {
   // This function is called on statechange
   // When the state reaches 4 this function reads the xml document


   // Create a Text File

   var fso = new ActiveXObject( "Scripting.FileSystemObject" );
   var fh = fso.CreateTextFile( "MediaSelector.bat", true );

   for(i=0; i<xmlDoc.getElementsByTagName( "media" ).length; i++) {

   bitrate  = xmlDoc.getElementsByTagName( "media" ).attributes.getNamedItem( "bitrate" ).nodeValue  ;
   encoding = xmlDoc.getElementsByTagName( "media" ).attributes.getNamedItem( "encoding" ).nodeValue ;

      if ( bitrate==128 && encoding=="aac" ){

      fh.WriteLine( ':: Media tag #' +  );
      fh.WriteLine( '' );
      fh.WriteLine( 'SET rtmpdump=C:\\Program Files\\rtmpdump\\rtmpdump.exe' );
      fh.WriteLine( '' );
      fh.WriteLine( 'SET server=' +
         xmlDoc.getElementsByTagName( "media" ).firstChild.attributes.getNamedItem( "server" ).nodeValue );
      fh.WriteLine( '' );
      fh.WriteLine( 'SET application=' +
         xmlDoc.getElementsByTagName( "media" ).firstChild.attributes.getNamedItem( "application" ).nodeValue );
      fh.WriteLine( '' );
      fh.WriteLine( 'SET identifier=' +
         xmlDoc.getElementsByTagName( "media" ).firstChild.attributes.getNamedItem( "identifier" ).nodeValue );
      fh.WriteLine( '' );
      var str1=xmlDoc.getElementsByTagName( "media" ).firstChild.attributes.getNamedItem( "authString" ).nodeValue ;
      fh.WriteLine( 'SET authString=' + str1.replace( /&/g,"^&" ) );
      fh.WriteLine( '' );
      var str2=xmlDoc.getElementsByTagName( "media" ).firstChild.attributes.getNamedItem( "identifier" ).nodeValue ;
      fh.WriteLine( '"%rtmpdump%" --protocol 0 --host "%server%" -a "%application%?%authString%" ' +
                    '-y "%identifier%" -o ' + str2.slice(28,999) );
      fh.WriteLine( '' );
      fh.WriteLine( 'pause' );

      }
   }

   fh.Close() ;

   }
}

</SCRIPT>

</head>
<body onload="loadxml();window.close()"> </body>
</html>



Edited 2 time(s). Last edit at 02/17/2012 21:17 by Ed.
Re: Parsing a BBC MediaSelector XML page with Javascript
February 18, 2012 17:57
avatar
I don't understand the details, Ed, but the result sounds pretty nifty! Thanks for putting it up smileys with beer
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 3
Record Number of Users: 9 on April 06, 2011
Record Number of Guests: 98 on December 05, 2012