Ed999
04-03-2011, 09:12 AM
RADIO 4 EXTRA from 2nd April 2011 -
BBC Radio 7 was abolished on 1st April, and replaced by Radio 4 Extra. In consequence, this is the new BATCH file for downloading .FLV files (MP4 Audio in FLV) from the Radio 4 Extra iPlayer, using RTMPdump.exe version 2.1d (for Windows 98) or 2.2d (for Windows XP).
First, 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
Second, 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 download is carried out by the following Batch (.BAT) file -
:: 1. Settings which do NOT change -
SET server=bbcmedia.fcod.llnwd.net
SET application=a1414/e3
SET as=adobe-hmac-sha256
SET av=1
SET te=connect
:: 2. Settings from Media Selector page -
SET et=1301836044
SET fmta-token=f9db339767bf11e400ce4de3ae4f74467f20181c8c67 ede1bd968bf33ce12a5bSET identifier=RBN2_radio_4_extra_-_sunday_0330_b00c79c2_2011_04_03_03_59_44.mp4
SET mp=radio4extra/secure_auth/RBN2_radio_4_extra_-_sunday_0330_b00c79c2_2011_04_03_03_59_44.mp4,radi o4extra/secure_auth/modem/RBN2_radio_4_extra_-_sunday_0330_b00c79c2_2011_04_03_04_00_12.mp4
Note:
The 'Identifier' string to use in the SET command (above) is the Filename only, not the entire Path.
:: Command line -
:: NB: In Windows 98, this must be run from a .PIF shortcut file with an Initial Environment of 1024 KB or greater.
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 "mp4:radio4extra/secure_auth/%identifier%" -o out_mp4a.flv
Notes:
1. If no port is specified, the download will still work!
2. The -p switch is NOT essential, the download will still work if it's omitted!
3. The -f switch is NOT essential, the download will still work if it's omitted!
4. The -W switch is NOT essential, the download will still work if it's omitted!
5. The -p, -f and -W switches are all derived from the iPlayer's Console page, which *plays* the stream aloud, so they are not needed if the stream is NOT being played. [NB: Even a completely *wrong* -p, -f or -W switch will NOT break the download!]
6. The entire -r switch after the colon can be omitted, as all its functions are contained in the -a switch.
7. The entire -r switch before the colon can be replaced by --protocol & --host switches.
8. The order of the authString elements in the -a switch can NOT be altered; the download fails if those elements are included in an out-of-order sequence.
9. The mp= switch must contain both of the secure_auth links: dial-up AND broadband; select the active one in the -y switch. [NB: Even though the dial-up URL (48Kbps) is not selected in the -y switch, it MUST be correct in the -a switch or the download fails!]
10. Sometimes the only way to get a connection is to remove the "modem" (i.e. dial-up) secure_auth alternative URL from both the -r switch and the -a switch.
11. By replacing the strings et= and fmta-token= in -r and in -a with current versions (obtained by refreshing the Media Selector page), it is possible to get an earlier version of the file than the default version, e.g. the 8am instead of the 7pm, if you have the URL address of the earlier version for the -a and -y switches.
12. From 2 April 2011, it is NOT possible to resume a partially completed download (the --resume switch no longer works).
13. To close a failed download faster (the default timeout is 120 secs) add: --timeout 10
14. "Handshake type mismatch": a WARNING is not an ERROR. A type 6 request can validly get 6, 8 or 9 in the reply (other values would probably indicate an actual problem).
placebo
04-04-2011, 11:37 AM
excellent post, congrats. to the benefit of boardies.
question:
www.bbc.co.uk., would your instructions apply more or less equally well to their iplayer TV, or is "everything" very much different when it comes to tv (in contrast to radio)?
Ed999
04-07-2011, 02:43 AM
The BBC iPlayer uses similar techniques for all streams that it serves, regardless of whether the show is tv or radio.
One important common factor is that all its Flash streams use RTMP, never RTMPE. Another is that all its Flash streams are either Akamai or Limelight.
All its Akamai streams use basically the same format, and all its Limelight streams also use a common format; so once you know what these two basic formats are, you can fairly easily cope with almost any iPlayer flash stream.
The tv streams look superficially more daunting, simply because there are many more streams. Radio - like all audio - has only one choice, between mono or stereo. But tv can be served up as 4:3 or 16:9, etc, and can use a bewildering range of video bitrates, depending on how low definition a picture you want to watch.
BBC Radio -
Playlist page:
http://www.bbc.co.uk/iplayer/playlist/00000000
To open the Playlist page you need the 8-digit ID number (PID) from the iPlayer webpage!
[NB: That 8-digit number is in the URL (the page address) of the page that plays the show]
Media Selector page:
http://www.bbc.co.uk/mediaselector/4/mtis/stream/00000000
To open the Media Selector page you need the 8-digit Identifier from the Playlist page!
[NB: You need the Identifier from the section marked: 128Kbps aac]
MP4 (Limelight server) : MP4A (AAC) in FLV, 128 Kbps -
File is: AAC+LC - 44,100 - 128 kbps - Stereo - 16bit
Uses only six switches:
-r : rtmp address (protocol + server + port + application + authString)
-a : application (application + authString) [duplicated from -r]
-y : Identifier (mp4 plaYpath) [duplicated from authString]
-p : Page address (iPlayer console page) [NB: Non-essential]
-f : Flash version installed [NB: Non-essential]
-W : sWf player address [NB: Non-essential]
Details from Console page -
Examples:
set page=http://www.bbc.co.uk/iplayer/console/________
set swf=http://www.bbc.co.uk/emp/9player.swf?revision=18269_21576
Details from Media Selector page -
Examples:
1. Details that never change
set protocol=rtmp
set server=bbcmedia.fcod.llnwd.net
set port=1935
set application=a1414/e3
2. Contents of authString (as, av & te never change)
set as=adobe-hmac-sha256
set av=1
set te=connect
set mp=bbc7/secure_auth/modem/_________________.mp4,bbc7/secure_auth/___________________.mp4
set et=__________
set fmta-token=____________________________________________ ____________________
3. The Playpath (mp4 URL)
set identifier=mp4:bbc7/secure_auth/RBN2_bbc7_-_________________________________________.mp4
Command -
rtmpdump -r "%protocol%://%server%:%port%/%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%" -f "WIN 9,0,280,0" -W "%swf%" -p "%page%" -y "%identifier%" -o output.flv
Notes:
1. If no port is specified, the download will still work!
2. The -p switch is NOT essential, the download will still work if it's omitted!
3. The -f switch is NOT essential, the download will still work if it's omitted!
4. The -W switch is NOT essential, the download will still work if it's omitted!
5. The -p, -f and -W switches are all derived from the iPlayer's Console page, which plays the stream aloud, so they are not needed where the stream is being downloaded instead of played. [NB: Even a completely *wrong* -p, -f or -W switch will NOT break the download!]
6. The entire -r switch after the : can be omitted, as all its functions are contained in the -a switch.
7. The entire -r switch before the : can be replaced by --protocol & --host switches.
8. The order of the authString elements in the -a switch can NOT be altered; the download fails if those elements are included in an out-of-order sequence.
9. The mp= switch must contain both of the secure_auth links: dial-up AND broadband; select the active one in the -y switch. [NB: Even though the dial-up URL (48Kbps) is not selected in the -y switch, it MUST be correct in the -a switch or the download fails!]
10. Sometimes the only way to get a connection is to remove the "modem" (i.e. dial-up) secure_auth alternative URL from both the -r switch and the -a switch.
11. By replacing the strings et= and fmta-token= in -r and in -a with current versions (obtained by refreshing the Media Selector page), it is possible to get an earlier version of the file than the default version, e.g. the 8am instead of the 7pm, if you have the URL address of the earlier version for the -a and -y switches.
12. To resume a partially completed download add: --resume [NB: Unfortunately, this useful option does NOT work with all the current iPlayer streams.]
To resume faster (the default timeout is 120 seconds) add: --timeout 10
13. Handshake type mismatch: a WARNING is not an ERROR. A type 6 request can validly get 6, 8 or 9 in the reply. Other values would probably indicate an actual problem.
This is the bare bones Command:
rtmpdump --protocol 0 --host %server% -a %application%?as=%as%&av=%av%&te=%te%&mp=%mp%&et=%et%&fmta-token=%fmta-token% -y %identifier% -o output_mp4.flv
Notes:
1. Contains only details from the Media Selector page.
2. In Win9x must be run from a PIF with Initial Environment of 1024 KB.
MP4 (Limelight server) : MP4A (AAC) in FLV, 96 kbps [Modem alternative] -
File is: AAC+SBR - 44,100 - 96 kbps - Stereo - 16bit
Details from Media Selector page -
1. Details that never change
set server=bbcmedia.fcod.llnwd.net
set application=a1414/e3
2. Contents of authString (as, av & te never change)
set as=adobe-hmac-sha256
set av=1
set te=connect
set mp=bbc7/secure_auth/modem/_________________.mp4,bbc7/secure_auth/___________________.mp4
set et=__________
set fmta-token=____________________________________________ ____________________
3. The Playpath (mp4 URL) (Modem version)
set identifier=mp4:bbc7/secure_auth/modem/RBN2_bbc7_-___________________________________.mp4
rtmpdump --protocol 0 --host %server% -a %application%?as=%as%&av=%av%&te=%te%&mp=%mp%&et=%et%&fmta-token=%fmta-token% -y %identifier% -o output_aac_128kbps_modem_mp4.flv
MP3 (Akamai server) : MP3 in FLV, 128 Kbps -
Details from Media Selector page -
1. Details that never change
set server=cp48188.edgefcs.net
2. Contents of authString (aifp never changes)
set auth=_____________________________________________ _________________
set aifp=v001
set slist=secure/bbc7/RBN2_bbc7_________________________________________ ____
3. The Playpath (mp3 URL)
set identifier=mp3:secure/bbc7/RBN2_bbc7_________________________________________ ____
This is the bare bones Command:
rtmpdump --protocol 0 --host %server% -a ondemand?auth=%auth%&aifp=%aifp%&slist=%slist% -y %identifier% -o output_mp3.flv
Notes:
1. Contains only details from the Media Selector page.
2. In Win9x must be run from a PIF with Initial Environment of 1024 KB.
Live stream (Akamai server) : MP4A (AAC) in FLV -
Details from Media Selector page -
http://www.bbc.co.uk/mediaselector/4/mtis/stream/bbc_7
1. Details that never change
set server=cp60691.live.edgefcs.net
set identifier=Radio_7_UK@s6464
2. Details from authString
set auth=_____________________________________________ _________________
set slist==_________________________
This is the bare bones Command:
rtmpdump --live --protocol 0 --host %server% -a live?auth=%auth%&aifp=v001&slist=%slist% -y %identifier%?auth=%auth%&aifp=v001&slist=%slist% -o output_live_mp4.flv
Notes:
1. Contains only details from the Media Selector page.
2. In Win9x must be run from a PIF with Initial Environment of 1024 KB.
Ed999
04-07-2011, 02:44 AM
Archive TV (Akamai server) -
In the case of archive TV shows (non-iPlayer shows, available more or less permanently on the BBC website, such as educational and scientific shows), build this command -
1. In the HTML code of the BBC webpage which plays the file, find the URL address of the Playlist (which is always an .XML file). Here’s an example of what to look for:
http://www.bbc.co.uk/archive/xml/76/20.xml
2. Open that Playlist page, which contains the SERVER and IDENTIFIER data. Construct the following URL (on a single line) and use it to open the Media Selector page :
http://www.bbc.co.uk/mediaselector/4/gtis/stream/?server=[SERVER]&identifier=[IDENTIFIER]
Example:
http://www.bbc.co.uk/mediaselector/4/gtis/stream/?server=cp47317.edgefcs.net&identifier=archive/white/OAT_BBC_7620
3. Look at the Media Selector page, containing the APPLICATION (always 'ondemand') and the TOKEN data. Construct the following URL, and use it to download the file :
rtmpdump -r "rtmp://[SERVER]:1935/ondemand?_fcs_vhost=[SERVER]&auth=[AUTH]&aifp=v001&slist=[SLIST]" --tcUrl "rtmp://[SERVER]:1935/ondemand?_fcs_vhost=[SERVER]&auth=[AUTH]&aifp=v001&slist=[SLIST]" --app "ondemand?_fcs_vhost=[SERVER]&auth=[AUTH]&aifp=v001&slist=[SLIST]" --auth "[AUTH]" -W "http://www.bbc.co.uk/emp/9player.swf?revision=18182_20020" -o output.flv
Example:
From Playlist page -
set server=cp47317.edgefcs.net
set identifier=archive/white/OAT_BBC_7620
From TOKEN section of Media Selector page -
set auth=daEbGdzdtcqdXaZbmdDdBcdcBdzd6cjd2aA-bmKWSH-bWG-DqqGJpCqOBoFpzL
set slist=archive/white/OAT_BBC_7620
rtmpdump -r "rtmp://%server%:1935/ondemand?_fcs_vhost=%server%&auth=%auth%&aifp=v001&slist=%slist%" --tcUrl "rtmp://%server%:1935/ondemand?_fcs_vhost=%server%&auth=%auth%&aifp=v001&slist=%slist%" --app "ondemand?_fcs_vhost=%server%&auth=%auth%&aifp=v001&slist=%slist%" --auth "auth=%auth%&aifp=v001&slist=%slist%" -W "http://www.bbc.co.uk/emp/9player.swf?revision=18182_20020" -o output.flv
Note:
1. The slist element is normally identical to the identifier element.
This is the bare bones Command -
rtmpdump --protocol 0 --host %server% -a ondemand?_fcs_vhost=%server%&auth=%auth%&aifp=v001&slist=%slist% -y %identifier% -o output.flv
Notes:
1. In Win9x must be run from a PIF with Initial Environment of 1024 KB.
2. Make sure there are NO spaces in the -a string, especially not before &slist=%slist%
TV :
For regular tv shows, available through the iPlayer -
Available servers: Akamai, Limelight
Available streams:
396 kbps (a.k.a. 400), 480 kbps,
796 kbps (a.k.a. 800), 1500 kbps
Bitrate: 396 (Limelight) = 400 x 224 px
Bitrate: 480 (Limelight) = 640 x 360 px
Smallest Picture Size -
Bitrate=396 kbps (Using: Limelight)
Size: 400 x 224 px (Ratio = 1.79)
Best(?) Picture Size -
Bitrate=480 kbps (Using: Limelight)
Size: 640 x 360 px (Ratio = 1.77)
1. LIMELIGHT -
SET PATH=%path%;"C:\RTMPdump"
Settings which do NOT change -
SET server=bbcmedia.fcod.llnwd.net
SET application=a1414/e3
SET as=adobe-hmac-sha256
SET av=1
SET te=connect
Settings from Media Selector page -
Example:
SET mp=iplayerstream/secure_auth/800kbps/MP/b00x1vjs_1293464942.mp4,iplayerstream/secure_auth/480kbps/MP/b00x1vjs_1293465199.mp4,iplayerstream/secure_auth/400kbps/b00x1vjs_1293465197.mp4,iplayerstream/secure_auth/1500kbps/MP/b00x1vjs_1293465202.mp4
SET et=1293612957
SET fmta-token=8c87aca066f4d6dc137e13f190e1a5336ef692a3a089 d3e7f7b7792c4ebc2ee9
SET identifier=mp4:iplayerstream/secure_auth/480kbps/MP/b00x1vjs_1293465199.mp4
This is the bare bones Command -
rtmpdump --protocol 0 --host %server% -a %application%?as=%as%&av=%av%&te=%te%&mp=%mp%&et=%et%&fmta-token=%fmta-token% -y "%identifier%" -o output_Limelight.flv
2. AKAMAI -
SET PATH=%path%;"C:\RTMPdump"
Settings which do NOT change -
SET application=ondemand
SET aifp=v001
Settings from Media Selector page -
Example:
SET server=cp41752.edgefcs.net
SET auth=daEcLcea4cTdNc5dRcdavdrd8a4azbscDdw-bngUce-bWG-IppDGpBqODuHqyF
SET slist=secure/800kbps/amicoa31-00028261-dance_morecambewisexmas_singinginrain_Flash9_Med_v 1_0.mp4;secure/1500kbps/amicoa31-00028261-dance_morecambewisexmas_singinginrain_Flash9_Hi_v1 _0.mp4;public/unsecure/1500kbps/amicoa31-00028261-dance_morecambewisexmas_singinginrain_Flash9_Hi_v1 _0.mp4;public/unsecure/amicoa31-00028261-dance_morecambewisexmas_singinginrain_Flash8_v1_1; public/unsecure/800kbps/amicoa31-00028261-dance_morecambewisexmas_singinginrain_Flash9_Med_v 1_0.mp4
SET identifier=secure/800kbps/amicoa31-00028261-dance_morecambewisexmas_singinginrain_Flash9_Med_v 1_0.mp4
This is the bare bones Command -
rtmpdump --protocol 0 --host %server% -a %application%?auth=%auth%&aifp=%aifp%&slist=%slist% -y "%identifier%" -o output_Akamai.flv
Make sure there are NO spaces in the -a string, especially not in &slist=%slist%
Sometimes the identifier must be dealt with as follows, moving part of the identifier string [the path] into the -y switch [leaving only the filename in the SET instruction]:-
SET identifier=amicoa31-00028261-dance_morecambewisexmas_singinginrain_Flash9_Med_v 1_0.mp4
-y "secure/800kbps/%identifier%"
vBulletin® , Copyright ©2000-2025, Jelsoft Enterprises Ltd.