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
  #11  
Old 12-26-2012, 07:05 AM
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


Here is a revised script for downloading the Akamai live tv streams from the BBC.

This is a modified version of the batch file script posted above in this thread, modified to take account of recent changes on the BBC website.

Copy-and-paste the code into a plain text file called (for example) BBCtv_Live_Akamai.bat


Code:
@echo off

::  *** Select Channel ***            [ MediaSelector ID ]

    SET ID=bbc_one_london
::  SET ID=bbc_two_england
::  SET ID=bbc_three
::  SET ID=bbc_four


::  *** Select Bitrate ***            [ MediaSelector Bitrate ]

::  SET bitrate=56
::  SET bitrate=176
::  SET bitrate=396
::  SET bitrate=480
    SET bitrate=796
::  SET bitrate=1500


::  *** Select Supplier ***           [ MediaSelector Supplier ]           !! This script ONLY works for an AKAMAI server !!

    SET supplier=akamai


::  *** Media Selector pages ***

::  http://www.bbc.co.uk/mediaselector/4/mtis/stream/bbc_one_london
::  http://www.bbc.co.uk/mediaselector/4/mtis/stream/bbc_two_england
::  http://www.bbc.co.uk/mediaselector/4/mtis/stream/bbc_three
::  http://www.bbc.co.uk/mediaselector/4/mtis/stream/bbc_four



::  *** Port ***
    SET port=1935

::  *** RTMPDump v2.4 (RTMPDump v2.1d doesn't work) ***
    SET rtmpdump=C:\\Program Files (x86)\\rtmpdump\\rtmpdump.exe

::  *** SWF File ***
    SET swf=http://www.bbc.co.uk/emp/releases/iplayer/revisions/617463_618125_4/617463_618125_4_emp.swf

::  *** File Name ***
    SET currDate=%date:/=-%
    SET currTime=%time::=-%

::  *** Safety Tests ***
    IF EXIST "%temp%\*.bat" DEL "%temp%\*.bat"
    IF EXIST "%temp%\*.htm" DEL "%temp%\*.htm"



::  *** Create a HTML file : AKAMAI ***

ECHO ^<html^>                                                                                             >> %temp%\temp.htm
ECHO ^<head^>                                                                                             >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO ^<title^>Parse BBC iPlayer XML File - Javascript Method^</title^>                                    >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
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'); // This prevents the browser window prompting before closing                >> %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    var fso = new ActiveXObject("Scripting.FileSystemObject");                                        >> %temp%\temp.htm
ECHO    var fh = fso.CreateTextFile("C:\\MediaSelector.bat",true);   >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO    // LEVEL 1 TAGS  [Primary tags]                                                                   >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO    // Specify the Level 1 tag to loop through                                                        >> %temp%\temp.htm
ECHO    var a = xmlDoc.getElementsByTagName("media");                                                     >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO    // Loop instruction                                                                               >> %temp%\temp.htm
ECHO    for (i=0;i^<a.length;i++) {                                                                       >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO        // Specify a target element within the Level 1 tag                                            >> %temp%\temp.htm
ECHO        // Specified element must exist in ALL the Level 1 tags                                       >> %temp%\temp.htm
ECHO        element1 = a[i].attributes.getNamedItem("kind").nodeValue; // create array          [Line 50] >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO        // Conditional Filter                                                                         >> %temp%\temp.htm
ECHO        // Pass only those tags that contain video data                                               >> %temp%\temp.htm
ECHO        if ( element1=="video" ) {                                                                    >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO        // Test value of chosen element within this IF condition                                      >> %temp%\temp.htm
ECHO        // alert( "Video = " + element1 );                                                            >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
/Continued below...
Reply With Quote
  #12  
Old 12-26-2012, 07:08 AM
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 -- Continued


/Continued...

Code:
ECHO            // Conditional Filter [Bitrate]                                                           >> %temp%\temp.htm
ECHO            // Pass only the tag that contains the desired bitrate                                    >> %temp%\temp.htm
ECHO            element2 = a[i].attributes.getNamedItem("bitrate").nodeValue; // create array             >> %temp%\temp.htm
ECHO            if ( element2==%bitrate% ) {                                                              >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO            // NOTE: The element "bitrate" can't be used as the primary filter at line 50,            >> %temp%\temp.htm
ECHO            //       because it's an element that does NOT exist in all primary level tags            >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO            // Test value of chosen element within this IF condition                                  >> %temp%\temp.htm
ECHO            // alert( "Bitrate = " + element2 );                                                      >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO    // LEVEL 2 TAGS  [Child tags]                                                                     >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO    // Loop through each Child tag                                                                    >> %temp%\temp.htm
ECHO    var b = a[i].childNodes;                                                                          >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO    // Loop instruction                                                                               >> %temp%\temp.htm
ECHO    for (j=0;j^<b.length;j++) {                                                                       >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO        // Specify a target element within the Child tag                                              >> %temp%\temp.htm
ECHO        // Specified element must exist in ALL the Child tags                                         >> %temp%\temp.htm
ECHO        element3 = b[j].attributes.getNamedItem("supplier").nodeValue; // create array                >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO        // Conditional Filter [Supplier]                                                              >> %temp%\temp.htm
ECHO        // Pass only the Child tag that contains the desired supplier                                 >> %temp%\temp.htm
ECHO        if ( element3=="%supplier%" ) {                                                               >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO        // Test value of chosen element within this IF condition                                      >> %temp%\temp.htm
ECHO        // alert( "Supplier = " + element3 );                                                         >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO        // Write elements in selected Child tag to file                                               >> %temp%\temp.htm
ECHO        fh.WriteLine( '@echo off' );                                                                  >> %temp%\temp.htm
ECHO        fh.WriteLine( ':: Media tag #' + [i] + ', Child tag #' + [j] );                               >> %temp%\temp.htm
ECHO        fh.WriteLine( '' );                                                                           >> %temp%\temp.htm
ECHO        fh.WriteLine( 'SET rtmpdump=%rtmpdump%' );                                                    >> %temp%\temp.htm
ECHO        fh.WriteLine( '' );                                                                           >> %temp%\temp.htm
ECHO        fh.WriteLine( 'SET protocol='    + b[j].attributes.getNamedItem("protocol").nodeValue    );   >> %temp%\temp.htm
ECHO        fh.WriteLine( '' );                                                                           >> %temp%\temp.htm
ECHO        fh.WriteLine( 'SET server='      + b[j].attributes.getNamedItem("server").nodeValue      );   >> %temp%\temp.htm
ECHO        fh.WriteLine( '' );                                                                           >> %temp%\temp.htm
ECHO        fh.WriteLine( 'SET application=' + b[j].attributes.getNamedItem("application").nodeValue );   >> %temp%\temp.htm
ECHO        fh.WriteLine( '' );                                                                           >> %temp%\temp.htm
ECHO        fh.WriteLine( 'SET identifier='  + b[j].attributes.getNamedItem("identifier").nodeValue  );   >> %temp%\temp.htm
ECHO        fh.WriteLine( '' );                                                                           >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO        var str1=b[j].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.                                                                                                     >> %temp%\temp.htm

::          NOTES: 1. The symbol & must be carat-escaped using REPLACE (character to replace, replacement character).
::                 2. A carat (symbol ^) must preceed & in the first argument; g [global] means replace ALL instances.
::                 3. In second argument no escaping is needed: use of double quotes forces the symbols to be read literally

ECHO        fh.WriteLine( '::  *** Command Line : TV : AKAMAI : %bitrate% kbps ***' );                    >> %temp%\temp.htm
ECHO        fh.WriteLine( '"%%rtmpdump%%" --live --verbose '                                        +     >> %temp%\temp.htm
ECHO                      '-r "%%protocol%%://%%server%%:%port%/%%application%%?%%authString%%" '   +     >> %temp%\temp.htm
ECHO                      '-a "%%application%%?%%authString%%" -y "%%identifier%%?%%authString%%" ' +     >> %temp%\temp.htm
ECHO                      '-f "WIN 11,1,102,63" -W "%swf%" '                                        +     >> %temp%\temp.htm
ECHO                      '-o "Live %ID% ['+element2+'kbps] ['+element3+'] %currDate% %currTime%.flv" '); >> %temp%\temp.htm

::          NOTES: 1. The symbol % must be doubled in a Batch file (in contrast to a Command Line).

ECHO.                                                                                                     >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO        }   }         // Close Level 2                                                                >> %temp%\temp.htm
ECHO        }   }   }     // Close Level 1                                                                >> %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 "C:\MediaSelector.bat"

pause
Reply With Quote
  #13  
Old 12-26-2012, 07:22 AM
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 -- Limelight Stream


The following code is the contents of a .bat batch file for downloading a BBC tv live stream from a LIMELIGHT server.

Copy-and-paste the code into a file called (for example) BBCtv_Live_Limelight.bat

Code:
@echo off

::  *** MediaSelector ID ***
    SET ID=bbc_one_london
::  SET ID=bbc_two_england
::  SET ID=bbc_three
::  SET ID=bbc_four

::  *** Stream Bitrate ***
::  SET bitrate=56
::  SET bitrate=176
::  SET bitrate=396
::  SET bitrate=480
    SET bitrate=796
::  SET bitrate=1500

::  *** Supplier ***
    SET supplier=limelight


::  *** Port ***
    SET port=1935

::  *** RTMPDump v2.4 (RTMPDump v2.1d doesn't work) ***
    SET rtmpdump=C:\\Program Files (x86)\\rtmpdump\\rtmpdump.exe

::  *** SWF File ***
    SET swf=http://www.bbc.co.uk/emp/releases/iplayer/revisions/617463_618125_4/617463_618125_4_emp.swf

::  *** File Name ***
    SET currDate=%date:/=-%
    SET currTime=%time::=-%

::  *** Safety Tests ***
    IF EXIST "%temp%\*.bat" DEL "%temp%\*.bat"
    IF EXIST "%temp%\*.htm" DEL "%temp%\*.htm"


::  *** Create a HTML file : LIMELIGHT stream ***

ECHO ^<html^>                                                                                             >> %temp%\temp.htm
ECHO ^<head^>                                                                                             >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO ^<title^>Parse BBC iPlayer XML File - Javascript Method^</title^>                                    >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
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'); // This prevents the browser window prompting before closing                >> %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    var fso = new ActiveXObject("Scripting.FileSystemObject");                                        >> %temp%\temp.htm
ECHO    var fh  = fso.CreateTextFile("C:\\MediaSelector.bat",true);                                       >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO    // LEVEL 1 TAGS  [Primary tags]                                                                   >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO    // Specify the Level 1 tag to loop through                                                        >> %temp%\temp.htm
ECHO    var a = xmlDoc.getElementsByTagName("media");                                                     >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO    // Loop instruction                                                                               >> %temp%\temp.htm
ECHO    for (i=0;i^<a.length;i++) {                                                                       >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO        // Specify a target element within the Level 1 tag                                            >> %temp%\temp.htm
ECHO        // Specified element must exist in ALL the Level 1 tags                                       >> %temp%\temp.htm
ECHO        element1 = a[i].attributes.getNamedItem("kind").nodeValue; // create array         [Line 50]  >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO        // Conditional Filter                                                                         >> %temp%\temp.htm
ECHO        // Pass only those tags that contain video data                                               >> %temp%\temp.htm
ECHO        if ( element1=="video" ) {                                                                    >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO        // Test value of chosen element                                                               >> %temp%\temp.htm
ECHO        // alert( "Kind = " + element1 );                                                             >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO            // Conditional Filter                                                                     >> %temp%\temp.htm
ECHO            // Pass only the tag that contains the desired bitrate                                    >> %temp%\temp.htm
ECHO            element2 = a[i].attributes.getNamedItem("bitrate").nodeValue; // create array             >> %temp%\temp.htm
ECHO            if ( element2==%bitrate% ) {                                                              >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO            // NOTE: The element "bitrate" can't be used as the primary filter at line 50,            >> %temp%\temp.htm
ECHO            //       because it's an element that does NOT exist in all primary level tags            >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO            // Test value of chosen element                                                           >> %temp%\temp.htm
ECHO            // alert( "Bitrate = " + element2 );                                                      >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm

/Continued below...
Reply With Quote
  #14  
Old 12-26-2012, 07:24 AM
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 -- Continued


/ Continued...


Code:
ECHO    // LEVEL 2 TAGS  [Child tags]                                                                     >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO    // Loop through each Child tag                                                                    >> %temp%\temp.htm
ECHO    var b = a[i].childNodes;                                                                          >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO    // Loop instruction                                                                               >> %temp%\temp.htm
ECHO    for (j=0;j^<b.length;j++) {                                                                       >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO        // Specify a target element within the Child tag                                              >> %temp%\temp.htm
ECHO        // Specified element must exist in ALL the Child tags                                         >> %temp%\temp.htm
ECHO        element3 = b[j].attributes.getNamedItem("supplier").nodeValue;                                >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO        // Conditional Filter                                                                         >> %temp%\temp.htm
ECHO        // Pass only the Child tag that contains the desired supplier                                 >> %temp%\temp.htm
ECHO        if ( element3=="%supplier%" ) {                                                               >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO        // Test value of element                                                                      >> %temp%\temp.htm
ECHO        // alert( "Supplier = " + element3 );                                                         >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO        // Write elements in selected Child tag to file                                               >> %temp%\temp.htm
ECHO        fh.WriteLine( '@echo off' );                                                                  >> %temp%\temp.htm
ECHO        fh.WriteLine( ':: Media tag #' + [i] + ', Child tag #' + [j] );                               >> %temp%\temp.htm
ECHO        fh.WriteLine( '' );                                                                           >> %temp%\temp.htm
ECHO        fh.WriteLine( 'SET rtmpdump=%rtmpdump%' );                                                    >> %temp%\temp.htm
ECHO        fh.WriteLine( '' );                                                                           >> %temp%\temp.htm
ECHO        fh.WriteLine( 'SET protocol='    + b[j].attributes.getNamedItem("protocol").nodeValue    );   >> %temp%\temp.htm
ECHO        fh.WriteLine( '' );                                                                           >> %temp%\temp.htm
ECHO        fh.WriteLine( 'SET server='      + b[j].attributes.getNamedItem("server").nodeValue      );   >> %temp%\temp.htm
ECHO        fh.WriteLine( '' );                                                                           >> %temp%\temp.htm
ECHO        fh.WriteLine( 'SET application=' + b[j].attributes.getNamedItem("application").nodeValue );   >> %temp%\temp.htm
ECHO        fh.WriteLine( '' );                                                                           >> %temp%\temp.htm
ECHO        fh.WriteLine( 'SET identifier='  + b[j].attributes.getNamedItem("identifier").nodeValue  );   >> %temp%\temp.htm
ECHO        fh.WriteLine( '' );                                                                           >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO        var str1 = b[j].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.                                                                                                     >> %temp%\temp.htm

::          NOTES: 1. The symbol & must be carat-escaped using REPLACE (character to replace, replacement character).
::                 2. A carat (symbol ^) must preceed & in the first argument; g [global] means replace ALL instances.
::                 3. In second argument no escaping is needed: use of double quotes forces the symbols to be read literally

ECHO        fh.WriteLine( '::  *** Command Line : TV : LIMELIGHT : %bitrate% kbps ***' );                 >> %temp%\temp.htm
ECHO        fh.WriteLine( '"%%rtmpdump%%" --live --protocol "%%protocol%%" --host "%%server%%" '      +   >> %temp%\temp.htm
ECHO                      '--port %port% -a "%%application%%?%%authString%%&%%identifier%%" '         +   >> %temp%\temp.htm
ECHO                      '-y "%%identifier%%" '                                                      +   >> %temp%\temp.htm
ECHO                      '-o "Live %ID% ['+element2+'kbps] ['+element3+'] %currDate% %currTime%.flv" '); >> %temp%\temp.htm

::          NOTES: 1. The symbol % must be doubled in a Batch file (in contrast to a Command Line),
::                    to prevent it being expanded immediately as if it was an environment variable.

ECHO.                                                                                                     >> %temp%\temp.htm
ECHO.                                                                                                     >> %temp%\temp.htm
ECHO    }   }         // Close Child function                                                             >> %temp%\temp.htm
ECHO    }   }   }     // Close Primary function                                                           >> %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 "C:\MediaSelector.bat"
Reply With Quote
  #15  
Old 12-26-2012, 04:57 PM
svnpenn svnpenn is offline
Banned
 
Join Date: Apr 2011
Location: Dallas
Posts: 757
svnpenn is on a distinguished road
Default

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


Quote:
Originally Posted by Ed999
Here is a revised script for downloading the Akamai live tv streams from the BBC. This is a modified version of the batch file script posted above in this thread, modified to take account of recent changes on the BBC website.
Copy-and-paste the code into a plain text file called (for example) BBCtv_Live_Akamai.bat
Appreciate the effort, but most people are not going to want to copy all that crap. Just put it in a link like this.

github.com/svnpenn/a/blob/ca92/scripts/BBCtv_Live_Limelight.bat
github.com/svnpenn/a/blob/ca92/scripts/BBCtv_Live_Akamai.bat

Last edited by svnpenn : 12-27-2012 at 12:49 AM.
Reply With Quote
  #16  
Old 12-27-2012, 07:01 AM
Ed999 Ed999 is offline
Senior Member
 
Join Date: Feb 2009
Posts: 115
Ed999 is on a distinguished road
Default

Re: RTMPDump v2.1d and BBC iPlayer


Thank you, but if I had wanted to do that I could have done it myself.

My purpose in posting commented code is to explain - to people who might want to use the code - how it works, so that they can adapt it to other situations.

I anticipate that few users, if any, will want to download BBC live streams. Their on-demand streams are much more user-friendly, for example.

This code is just an illustration of how easy it can be to use a batch script to interrogate an xml file and build a download link from it. Accordingly, this code is for posting, and explaining; not necessarily for using.
Reply With Quote
  #17  
Old 12-27-2012, 08:49 AM
chap chap is offline
Senior Member
 
Join Date: Feb 2011
Location: Ukraine
Posts: 1,165
chap is on a distinguished road
Default

Re: RTMPDump v2.1d and BBC iPlayer


possible to use such a file on CBS,Hulu...?
Reply With Quote
  #18  
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
  #19  
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
  #20  
Old 03-06-2013, 07:46 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


Sorry, I live in England, so I have no means of testing solutions for using this code from outside the UK.

This code should produce the same command line for downloading the target tv show, whether it is run from inside the UK or elsewhere.

The problem will be the rtmp connection, not the command line. The BBC tests the connection, to learn whether it is being originated from an ip address in the UK. They reject a connection if it is from an ip address outside the UK.

There are various ways for you to overcome this. I can only speak in general terms, because I can't test these solutions.

Geo-spoofing is a trick which allows you, situated in a foreign country, to appear to be originating a connection from within the UK. Look up geo-spoofing or ip-spoofing on Google for details.

There is a software program called Tor which allows you to connect your computer to a node inside the UK, which acts as a relay, so that your computer appears to be co-located with the node (i.e. if the node is in the UK, then you too appear to be in the UK).

https://www.torproject.org/download/download.html.en

Also look at http://sourceforge.net/projects/tork...d?source=files

Also search 'Anonymous web proxy'. This will lead you to e.g. http://hidemyass.com/ or http://apcyberax.co.uk/iwfchecker/ or http://server14.kproxy.com/

There are in fact many software solutions, but the problem they solve is that your connection request is originating from outside the UK. There is nothing wrong with the command line built by my code - it will work, provided you can mask the fact that you are running it from a computer that is outside the UK.
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:17 PM.


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