View Single Post
  #46  
Old 07-16-2010, 09:23 PM
Anywho Anywho is offline
Batch File Basher
 
Join Date: Jul 2010
Posts: 204
Anywho is on a distinguished road
Default

Re: How to use iView (ABC Australia) downloaders


Quote:
Originally Posted by randybull View Post
Sorry for the sploge of code here but Im sure you will see what it does ...

if /i "%HOST%" == "Akamai" (
echo bin\rtmpdump.exe %RESUME% %RTMP_DEBUG% -r "rtmp://cp53909.edgefcs.net///flash/playback/_definst_/%SHOW_PATH%" -a ondemand?auth="%TOKEN%" -o "%SAVE_PATH%" %SWFPARAM% > "%NNN%%".bat
echo pause >> "%NNN%%".bat
D:\bin\IviewABC\ANapperiView\iView_Downloader\sync .exe -r D:
echo start %NNN%.bat %SHOW_PATH% %SAVE_PATH%
rem pause
call "cmd /c start D:\bin\IviewABC\ANapperiView\iView_Downloader\%NNN %.bat"
SET /a NNN+=1
)

Sync program courtesy of http://technet.microsoft.com/en-us/s.../bb897438.aspx
I would suggest adding the code from the Windows Batch File Downloader that gets the authentication token. echo this to your generated batch script at a point before rtmpdump gets called.

Code:
bin\wget %WGET_OPT% -O cache\auth.xml http://www2b.abc.net.au/iViewHandshaker/services/iviewhandshaker.asmx/isp

rem === reformatting auth.xml to remove namespace which hinders xml.exe to parse the elements we need
echo ^<iview^>>cache\auth_temp.xml
for /f "skip=2 tokens=*" %%a in ('type cache\auth.xml') do echo %%a>>cache\auth_temp.xml
move /y "cache\auth_temp.xml" "cache\auth.xml" >nul
rem === end reformat

if /i "%HOST%" == "Akamai" (
    for /f "usebackq tokens=*" %%a in (`bin\xml sel -T -t -m "/iview" -v token "cache\auth.xml"`) do set TOKEN=%%a
) else (
    for /f "usebackq" %%a in (`bin\xml sel -T -t -m "/iview" -v token "cache\auth.xml"`) do set TOKEN=%%a
)

del cache\auth.xml
This would then allow you to execute the batch file generated at a later time because then the authentication token is generated just before calling rtmpdump (just like in the Windows Batch-File Downloader)

Last edited by Anywho : 07-16-2010 at 09:26 PM. Reason: Forgot stuff
Reply With Quote