Audio/video stream recording forums

Attention Visitor:
You may have to register or log in before you can post:
  • Click the register link to sign up.
  • Registered members please fill in the form below and click the "Log in" button.
To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Audio/video stream recording forums > Streaming media recording forum > rtmpdump
Register FAQ Members List Calendar Mark Forums Read

Reply Post New Thread
 
Thread Tools Display Modes
  #1  
Old 08-19-2011, 03:57 AM
Ed999 Ed999 is offline
Senior Member
 
Join Date: Feb 2009
Posts: 115
Ed999 is on a distinguished road
Default

RTMPDump v2.1d and BBC iPlayer


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.

Note : I am including an attachment containing all three of these batch files, plus some other files that I find useful. You'll just need to extract the .zip file to an empty directory and add your preferred version of RTMPDump.exe and RTMPsrv.exe (use v2.1d or later).



Run #1 - Preliminary Matters + Start RTMPSRV.bat

Code:
@echo off
SET PID=00000000

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

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

:: Open the Playlist page (to obtain Identifier) -
%open% http://www.bbc.co.uk/iplayer/playlist/%PID%

:: 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" http://www.bbc.co.uk/mediaselector/4/mtis/stream/00000000>> 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" "http://www.bbc.co.uk/iplayer/console/%PID%">> "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

Code:
@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

Code:
@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"
)
Attached Files
File Type: zip Recording_iPlayer.zip (19.9 KB, 0 views)
Reply With Quote
  #2  
Old 02-17-2012, 03:32 PM
Ed999 Ed999 is offline
Senior Member
 
Join Date: Feb 2009
Posts: 115
Ed999 is on a distinguished road
Default

Parse a BBC iPlayer MediaSelector XML file using Javascript


This is a method for downloading an iPlayer file using a MediaSelector url (e.g. obtained from http://www.bbc.co.uk/radio/aod/avail...adio4extra.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 an iTunes format file.


Note - I have only been able to test this method using Internet Explorer 8, on a borrowed laptop running Windows 7.


Code:
<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")[i].attributes.getNamedItem("bitrate").nodeValue  ;
   encoding = xmlDoc.getElementsByTagName("media")[i].attributes.getNamedItem("encoding").nodeValue ;

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

      fh.WriteLine( ':: Media tag #' + [i] );
      fh.WriteLine( '' );
      fh.WriteLine( 'SET rtmpdump=C:\\Program Files\\rtmpdump\\rtmpdump.exe' );
      fh.WriteLine( '' );
      fh.WriteLine( 'SET server=' +
         xmlDoc.getElementsByTagName("media")[i].firstChild.attributes.getNamedItem("server").nodeValue );
      fh.WriteLine( '' );
      fh.WriteLine( 'SET application=' +
         xmlDoc.getElementsByTagName("media")[i].firstChild.attributes.getNamedItem("application").nodeValue );
      fh.WriteLine( '' );
      fh.WriteLine( 'SET identifier=' +
         xmlDoc.getElementsByTagName("media")[i].firstChild.attributes.getNamedItem("identifier").nodeValue );
      fh.WriteLine( '' );
      var str1=xmlDoc.getElementsByTagName("media")[i].firstChild.attributes.getNamedItem("authString").nodeValue ;
      fh.WriteLine( 'SET authString=' + str1.replace(/&/g,"^&") );
      fh.WriteLine( '' );
      var str2=xmlDoc.getElementsByTagName("media")[i].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>
Reply With Quote
  #3  
Old 02-18-2012, 10:45 AM
Ed999 Ed999 is offline
Senior Member
 
Join Date: Feb 2009
Posts: 115
Ed999 is on a distinguished road
Default

Parse a BBC iPlayer MediaSelector XML file using Javascript


This is a Batch file which performs the same function as the .HTM file in my post of yesterday (above).

Code:
@ECHO OFF

::  *** MediaSelector ID  ***

::  Final 8 Characters
    SET ID=b01by95r

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


::  *** Create a HTM file ***

ECHO ^<html^>   >> %temp%\temp.htm
ECHO ^<head^>   >> %temp%\temp.htm
ECHO.  >> %temp%\temp.htm
ECHO ^<title^>Parse XML File^</title^> >> %temp%\temp.htm
ECHO.   
ECHO ^<!-- Downloading from a BBC iPlayer page --^> >> %temp%\temp.htm
ECHO ^<!-- This parses the elements in a MediaSelector xml page --^>  >> %temp%\temp.htm
ECHO.   >> %temp%\temp.htm
ECHO ^<SCRIPT^>   >> %temp%\temp.htm
ECHO.  >> %temp%\temp.htm
ECHO // Target XML file's URL address [MediaSelector URL]  >> %temp%\temp.htm
ECHO var url = "http://www.bbc.co.uk/mediaselector/4/mtis/stream/%ID%" ;  >> %temp%\temp.htm
ECHO.   >> %temp%\temp.htm
ECHO var xmlDoc; >> %temp%\temp.htm
ECHO. >> %temp%\temp.htm
ECHO window.open('','_self');  >> %temp%\temp.htm
ECHO.  >> %temp%\temp.htm
ECHO function loadxml()  >> %temp%\temp.htm
ECHO { >> %temp%\temp.htm
ECHO    xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); >> %temp%\temp.htm
ECHO    xmlDoc.async = false;  >> %temp%\temp.htm
ECHO    xmlDoc.onreadystatechange = readXML;  >> %temp%\temp.htm
ECHO    xmlDoc.load(url);  >> %temp%\temp.htm
ECHO } >> %temp%\temp.htm
ECHO.  >> %temp%\temp.htm
ECHO function readXML() >> %temp%\temp.htm
ECHO { >> %temp%\temp.htm
ECHO    if(xmlDoc.readyState == 4) {    >> %temp%\temp.htm
ECHO    // This function is called on statechange >> %temp%\temp.htm
ECHO    // When the state reaches 4 this function reads the xml document  >> %temp%\temp.htm
ECHO.  >> %temp%\temp.htm
ECHO    // Create a Text File   >> %temp%\temp.htm
ECHO.  >> %temp%\temp.htm
ECHO    var fso = new ActiveXObject("Scripting.FileSystemObject");  >> %temp%\temp.htm
ECHO    var fh = fso.CreateTextFile("C:\\Users\\dg\\AppData\\Local\\Temp\\MediaSelector.bat", true);  >> %temp%\temp.htm
ECHO.   >> %temp%\temp.htm
ECHO    for(i=0; i^<xmlDoc.getElementsByTagName("media").length; i++) {   >> %temp%\temp.htm
ECHO.  >> %temp%\temp.htm
ECHO    bitrate  = xmlDoc.getElementsByTagName("media")[i].attributes.getNamedItem("bitrate").nodeValue  ;  >> %temp%\temp.htm
ECHO    encoding = xmlDoc.getElementsByTagName("media")[i].attributes.getNamedItem("encoding").nodeValue ;  >> %temp%\temp.htm
ECHO.  >> %temp%\temp.htm
ECHO       if ( bitrate==128 ^&^& encoding=="aac" ){   >> %temp%\temp.htm
ECHO.   >> %temp%\temp.htm
ECHO       fh.WriteLine( '@echo off' );    >> %temp%\temp.htm
ECHO       fh.WriteLine( ':: Media tag #' + [i] );                                                                       >> %temp%\temp.htm
ECHO       fh.WriteLine( '' );  >> %temp%\temp.htm
ECHO       fh.WriteLine( 'SET rtmpdump=C:\\Data\\General\\iPlayer\\- Recording iPlayer\\rtmpdump.exe' );  >> %temp%\temp.htm
ECHO       fh.WriteLine( '' );  >> %temp%\temp.htm
ECHO       fh.WriteLine( 'SET server=' +                                                                                 >> %temp%\temp.htm
ECHO          xmlDoc.getElementsByTagName("media")[i].firstChild.attributes.getNamedItem("server").nodeValue );          >> %temp%\temp.htm
ECHO       fh.WriteLine( '' );                                                                                           >> %temp%\temp.htm
ECHO       fh.WriteLine( 'SET application=' +                                                                            >> %temp%\temp.htm
ECHO          xmlDoc.getElementsByTagName("media")[i].firstChild.attributes.getNamedItem("application").nodeValue );     >> %temp%\temp.htm
ECHO       fh.WriteLine( '' );                                                                                           >> %temp%\temp.htm
ECHO       fh.WriteLine( 'SET identifier=' +                                                                             >> %temp%\temp.htm
ECHO          xmlDoc.getElementsByTagName("media")[i].firstChild.attributes.getNamedItem("identifier").nodeValue );      >> %temp%\temp.htm
ECHO       fh.WriteLine( '' );                                                                                           >> %temp%\temp.htm

ECHO       var str1=xmlDoc.getElementsByTagName("media")[i].firstChild.attributes.getNamedItem("authString").nodeValue ; >> %temp%\temp.htm
ECHO       fh.WriteLine( 'SET authString=' + str1.replace(/^&/g,"^&") );                                                 >> %temp%\temp.htm
ECHO              fh.WriteLine( '' );                                                                                    >> %temp%\temp.htm
ECHO       var str2=xmlDoc.getElementsByTagName("media")[i].firstChild.attributes.getNamedItem("identifier").nodeValue ; >> %temp%\temp.htm
ECHO       fh.WriteLine( '"%%rtmpdump%%" --protocol 0 --host "%%server%%" -a "%%application%%?%%authString%%" ' +        >> %temp%\temp.htm
ECHO                     '-y "%%identifier%%" -o ' + str2.slice(28,999) );                                               >> %temp%\temp.htm
ECHO.                                                                                                                    >> %temp%\temp.htm
ECHO       }                                                                                                             >> %temp%\temp.htm
ECHO    }                                                                                                                >> %temp%\temp.htm
ECHO.                                                                                                                    >> %temp%\temp.htm
ECHO    fh.Close();                                                                                                      >> %temp%\temp.htm
ECHO.                                                                                                                    >> %temp%\temp.htm
ECHO    }                                                                                                                >> %temp%\temp.htm
ECHO }                                                                                                                   >> %temp%\temp.htm
ECHO.                                                                                                                    >> %temp%\temp.htm
ECHO ^</SCRIPT^>                                                                                                         >> %temp%\temp.htm
ECHO.                                                                                                                    >> %temp%\temp.htm
ECHO ^</head^>                                                                                                           >> %temp%\temp.htm
ECHO ^<body onload="loadxml();window.close()"^> ^</body^>                                                                >> %temp%\temp.htm
ECHO ^</html^>                                                                                                           >> %temp%\temp.htm


::  *** Run HTM file in Internet Explorer ***
"C:\Program Files (x86)\Internet Explorer\IEXPLORE.EXE" %temp%\temp.htm

::  *** Run MediaSelector.bat ***
CALL %temp%\MediaSelector.bat
Reply With Quote
  #4  
Old 03-15-2012, 01:34 PM
Ed999 Ed999 is offline
Senior Member
 
Join Date: Feb 2009
Posts: 115
Ed999 is on a distinguished road
Default

Download from BBC iPlayer - TV Show - Javascript method


This is a method for downloading an iPlayer TV stream using its MediaSelector url.

Just like a radio show, a tv show/stream has its own unique 8-digit ID number, which is contained in the MediaSelector URL for that stream. It is displayed - amongst other places - on the Playlist xml page associated with the particular stream. That 8-digit ID (identifier) can be used in the javascript code set out below.

See my other posts, above, for further details of the MediaSelector ID and how to find it.

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

All you need do is change the 8-digit ID number highlighted in red for the actual MediaSelector 8-digit ID of the tv show you want to download.

If you alter the sections highlighted in blue, you can download instead a stream running at a different bitrate. Details of the available bitrates for each tv show are given in that show's MediaSelector page. Each tv show is offered by the BBC in half a dozen different bitrates, from 184 kbps to 1500 kbps.

You can also choose either a LIMELIGHT server or an AKAMAI server for some bitrates. There is not much difference in video or audio quality between the two types, at any given bitrate; but there may be a difference in file size.

If you open the .HTML file in Internet Explorer 8 or 9, and allow the javascript to run, it will create a .bat batch file at C:\MediaSelector.bat containing the download command. You then run that batch file to do the actual download. The tv show will, by default, download into your C:\ root directory.

You must copy the program RTMPDUMP.EXE into the folder "C:\Program Files\rtmpdump" in order for this method to succeed.



Quote:
<html>
<head>
<title>Parse XML file in Internet Explorer</title>

<SCRIPT language="javascript">

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

window.open('','_self'); // This prevents the browser window prompting before closing

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

function readXML(){
if ( xmlDoc.readyState==4 ) {

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

var a = xmlDoc.getElementsByTagName("media");
for (i=0;i<a.length;i++) {
element1 = a[i].attributes.getNamedItem("kind").nodeValue; // create array

if ( element1=="video" ) {

// Element "bitrate" only exists WITHIN element "video"
element2 = a[i].attributes.getNamedItem("bitrate").nodeValue; // create array
if ( element2==796 ) {

var b = a[i].childNodes;
for (j=0;j<b.length;j++) {

element3 = b[j].attributes.getNamedItem("supplier").nodeValue;
if ( element3=="limelight" ) {


// Write elements in selected Child tag to file
fh.WriteLine( '@echo off' );
fh.WriteLine( ':: Media tag #' + [i] + ', Child tag #' + [j] );
fh.WriteLine( '' );
fh.WriteLine( 'SET rtmpdump=C:\\Program Files\\rtmpdump\\rtmpdump.exe' );
fh.WriteLine( '' );
fh.WriteLine( 'SET server=' + b[j].attributes.getNamedItem("server").nodeValue );
fh.WriteLine( '' );
fh.WriteLine( 'SET application=' + b[j].attributes.getNamedItem("application").nodeValue );
fh.WriteLine( '' );
fh.WriteLine( 'SET identifier=' + b[j].attributes.getNamedItem("identifier").nodeValue );
fh.WriteLine( '' );
var str1 = b[j].attributes.getNamedItem("authString").nodeValue ;
fh.WriteLine( 'SET authString=' + str1.replace(/&/g,"^&") );
fh.WriteLine( '' );
fh.WriteLine( ':: *** Command Line : TV : 796 kbps ***' );
var str2 = b[j].attributes.getNamedItem("identifier").nodeValue ;
var str3 = str2.split("/");
fh.WriteLine( '"%rtmpdump%" --protocol 0 --host "%server%" -a "%application%?%authString%" ' +
'-y "%identifier%" -o "'+element2+'kbps '+element3+' '+str3[4]+'" --resume --timeout 15' );

}
}
}
}
}
}
}
</SCRIPT>

</head>
<body onload="loadxml();window.close();"> </body>
</html>
Reply With Quote
  #5  
Old 03-15-2012, 06:05 PM
chap chap is offline
Senior Member
 
Join Date: Feb 2011
Location: Ukraine
Posts: 1,165
chap is on a distinguished road
Default

Re: Download from BBC iPlayer - TV Show - Javascript method


Quote:
This is a method for downloading an iPlayer TV stream using its MediaSelector url.
thanks works fine
Reply With Quote
  #6  
Old 03-16-2012, 07:54 AM
bat999 bat999 is offline
Senior Member
 
Join Date: Apr 2011
Location: UK
Posts: 131
bat999 is on a distinguished road
Default

Re: Download from BBC iPlayer - TV Show - Javascript method


Quote:
Originally Posted by chap View Post
thanks works fine
Are you guys using this longwinded method for a particular reason?
RTMPDump v2.1d
Reply With Quote
  #7  
Old 01-31-2013, 06:48 AM
chanc chanc is offline
Senior Member
 
Join Date: Sep 2012
Posts: 115
chanc is on a distinguished road
Default

Re: Download from BBC iPlayer - TV Show - Javascript method


Quote:
Originally Posted by Ed999 View Post
This is a method for downloading an iPlayer TV stream using its MediaSelector url.
How amazing !!

I am outside the UK, and I got the iplayer code with a vpn.
After the Mediaselector has been established, I just shut down the vpn and found the download still works !

Now I am enjoying a much better download speed, thanks to the code above!!
Reply With Quote
  #8  
Old 02-14-2013, 12:40 PM
chemi chemi is offline
Junior Member
 
Join Date: Feb 2013
Posts: 1
chemi is on a distinguished road
Default

Re: RTMPDump v2.1d and BBC iPlayer


Really? Does it work from outside UK?
I am trying it from Spain and it doesn't work...

I get the Media Selector because I am using tunlr.net trick (without it, it fails at the beginning), but then rtmp:// fails. Here is the log. Any help or comment?

Code:
RTMPDump v2.4
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
DEBUG: Parsing...
DEBUG: Parsed protocol: 0
DEBUG: Parsed host    : cp96472.live.edgefcs.net
DEBUG: Parsed app     : live?auth=daEbBbpbCaQdadpdoaMdndBaGdEa0dva4dW-brhr._-bWG
-IoqEInyqFEsHrwK&aifp=v001&slist=bbc1_inlet_480@s24324;bbc1_inlet_800@s24324;bbc
1_inlet_176@s24324;bbc1_inlet_56@s24324;bbc1_inlet_1500@s24324;bbc1_inlet_396@s2
4324
DEBUG: Protocol : RTMP
DEBUG: Hostname : cp96472.live.edgefcs.net
DEBUG: Port     : 1935
DEBUG: Playpath : bbc1_inlet_800@s24324?auth=daEbBbpbCaQdadpdoaMdndBaGdEa0dva4dW
-brhr._-bWG-IoqEInyqFEsHrwK&aifp=v001&slist=bbc1_inlet_480@s24324;bbc1_inlet_800
@s24324;bbc1_inlet_176@s24324;bbc1_inlet_56@s24324;bbc1_inlet_1500@s24324;bbc1_i
nlet_396@s24324
DEBUG: tcUrl    : rtmp://cp96472.live.edgefcs.net:1935/live?auth=daEbBbpbCaQdadp
doaMdndBaGdEa0dva4dW-brhr._-bWG-IoqEInyqFEsHrwK&aifp=v001&slist=bbc1_inlet_480@s
24324;bbc1_inlet_800@s24324;bbc1_inlet_176@s24324;bbc1_inlet_56@s24324;bbc1_inle
t_1500@s24324;bbc1_inlet_396@s24324
DEBUG: swfUrl   : http://www.bbc.co.uk/emp/releases/iplayer/revisions/617463_618
125_4/617463_618125_4_emp.swf
DEBUG: app      : live?auth=daEbBbpbCaQdadpdoaMdndBaGdEa0dva4dW-brhr._-bWG-IoqEI
nyqFEsHrwK&aifp=v001&slist=bbc1_inlet_480@s24324;bbc1_inlet_800@s24324;bbc1_inle
t_176@s24324;bbc1_inlet_56@s24324;bbc1_inlet_1500@s24324;bbc1_inlet_396@s24324
DEBUG: flashVer : WIN 11,1,102,63
DEBUG: live     : yes
DEBUG: timeout  : 30 sec
DEBUG: SWFSHA256:
DEBUG: b6 74 7f 89 f9 ec 6a 60 c1 a4 b5 8b b1 18 b0 fa
DEBUG: 65 18 86 24 c2 8a 1a a3 2f 72 0f 0b 80 59 dd 7f
DEBUG: SWFSize  : 595316
DEBUG: Setting buffer time to: 36000000ms
Connecting ...
DEBUG: RTMP_Connect1, ... connected, handshaking
DEBUG: HandShake: Client type: 03
DEBUG: HandShake: Client digest offset: 53
DEBUG: HandShake: Initial client digest:
DEBUG: fc 05 f6 56 84 91 0b 14 1d 8a 1c 21 db a3 1d c1
DEBUG: a5 8d ec a6 9d bb d9 e1 d3 f4 f6 bc ab da 95 f4
DEBUG: HandShake: Type Answer   : 03
DEBUG: HandShake: Server Uptime : 407558033
DEBUG: HandShake: FMS Version   : 4.5.2.1
DEBUG: HandShake: Calculated digest key from secure key and server digest:
DEBUG: 04 96 57 47 80 65 3a e9 02 5f 6e 2e c0 2c 60 b9
DEBUG: 86 58 60 22 9e c0 5d d6 24 54 7b d7 84 62 95 97
DEBUG: HandShake: Client signature calculated:
DEBUG: 63 e0 9c cb 05 0b c4 a9 ee 10 e7 a4 32 8f ee 1f
DEBUG: bf fe 1e 59 9a ee b2 28 f5 c2 01 cc 38 1b c1 f0
DEBUG: HandShake: Server sent signature:
DEBUG: 99 93 7a b9 3d 5a 9b 30 09 d8 fa 77 0b 89 2e 0f
DEBUG: 1c 78 c7 97 ce a1 69 ef c8 46 32 32 55 80 d2 8a
DEBUG: HandShake: Digest key:
DEBUG: 4b e6 40 f4 27 2a 4f 80 d3 b2 e3 aa 48 11 d5 fc
DEBUG: 8b ab 81 22 3a b3 41 1c 63 9b d9 35 85 06 7b d0
DEBUG: HandShake: Signature calculated:
DEBUG: 99 93 7a b9 3d 5a 9b 30 09 d8 fa 77 0b 89 2e 0f
DEBUG: 1c 78 c7 97 ce a1 69 ef c8 46 32 32 55 80 d2 8a
DEBUG: HandShake: Genuine Adobe Flash Media Server
DEBUG: HandShake: Handshaking finished....
DEBUG: RTMP_Connect1, handshaked
DEBUG: Invoking connect
INFO: Connected...
DEBUG: RTMP_ClientPacket, received: invoke 134 bytes
DEBUG: (object begin)
DEBUG: Property: NULL
DEBUG: (object begin)
DEBUG: Property: <Name:              level, STRING:     error>
DEBUG: Property: <Name:               code, STRING:     NetConnection.Connect.Rejected>
DEBUG: Property: <Name:        description, STRING:     [ AccessManager.Reject ]
 : Access denied!>
DEBUG: (object end)
DEBUG: (object end)
DEBUG: HandleInvoke, server invoking <_error>
ERROR: rtmp server sent error
DEBUG: RTMP_ClientPacket, received: invoke 18 bytes
DEBUG: (object begin)
DEBUG: Property: NULL
DEBUG: (object end)
DEBUG: HandleInvoke, server invoking <close>
ERROR: rtmp server requested close
DEBUG: Closing connection.

Press any key to continue . . .
Thanks in advance,

Chemi.
Reply With Quote
  #9  
Old 08-25-2013, 05:37 PM
drbmn drbmn is offline
Member
 
Join Date: May 2012
Posts: 145
drbmn is on a distinguished road
Default

Re: Download from BBC iPlayer - TV Show - Javascript method


Quote:
Originally Posted by Ed999 View Post
This is a method for downloading an iPlayer TV stream using its MediaSelector url.

If you alter the sections highlighted in blue, you can download instead a stream running at a different bitrate. Details of the available bitrates for each tv show are given in that show's MediaSelector page. Each tv show is offered by the BBC in half a dozen different bitrates, from 184 kbps to 1500 kbps.
Hi,
There are no parts higlighted in blue, only the mediaslector in red.
What are the parts that should have been highlited in blue???
Reply With Quote
Reply Post New Thread
Tags: , , , , , , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 07:55 PM.


Powered by All-streaming-media.com; 2006-2011
vB forum hacked with Zoints add-ons