Forum Home
Press F1
 
Thread ID: 140752 2015-12-09 12:05:00 Help needed wiuth a script apsattv (7406) Press F1
Post ID Timestamp Content User
1412526 2015-12-09 12:05:00 I'm trying to workout how to take this working live stream from ABC Australia and put it into a batch file so that each time it is run it will fetch the fresh token from

iview.abc.net.au

under "tokenhd" replace that in the URL after hdnea=

Valid format shown as below

livestreamer --http-header "X-Forwarded-For=101.175.18.124" "hds://abctvlivehds-lh.akamaihd.net l=/*~hmac=efb0611272d1c233612ec9c17e4c0b6f180d0ec476c 1de86de1a8ca54375572f pvswf=http://iview.abc.net.au/assets/swf/cineramaWrapper_Acc_018.swf?version=0.2" best
apsattv (7406)
1412527 2015-12-09 18:33:00 Blimmin heck it's been donkey years since I played with batch files, so sorry I can't help. But I thought I'd comment cos I doubt the format shown can be valid, cos theres spaces in the code which, to the best of my knowledge makes it invalid.

Valid format shown as below

livestreamer*--http-header "X-Forwarded-For=101.175.18.124"*"hds://abctvlivehds-lh.akamaihd.net l=/*~hmac=efb0611272d1c233612ec9c17e4c0b6f180d0ec476c 1de86de1a8ca54375572f pvswf=http://iview.abc.net.au/assets/swf/cineramaWrapper_Acc_018.swf?version=0.2" best
Greg (193)
1412528 2015-12-10 00:34:00 It is valid and works. I have the OZ channel 7 working fine..
Install livestreamer you will see it works
apsattv (7406)
1412529 2015-12-10 00:54:00 Are we working in Windows? in a batch file, possible? but you are better with a non native actual xml parser, as you rely on a certain structure or correctness, but hopefully this site keeps it clean.

I don't have time to explain, but you would possibly download the xml file, not sure if it can be parsed online, you would then work with "findstr" to locate the token you need.

Look up how you can use findstr to parse xml and you will find solutions.

Cheers,

KK
Kame (312)
1412530 2015-12-10 04:28:00 How about I just upload what I made already.

mega.nz

you can look it over
apsattv (7406)
1412531 2015-12-13 03:12:00 How are you getting on with this script? I'm no help, but I'm looking forward to the completed version. Will you be able to include the Ch9 mux of stations in it? Thanks Thunderflash (17394)
1412532 2015-12-13 04:03:00 Nothing as yet apsattv (7406)
1412533 2015-12-13 07:47:00 Nothing as yet

Cheers
Thunderflash (17394)
1412534 2015-12-16 00:58:00 Sorry apsattv,

I am really busy but have looked at your script, it would be nice if it was reliant on just one file which I will get around to but to speed up the process I will use two files, a batch file that will receive the token required using windows script hosting, my language of choice would be javascript but vbscript would work too. To be honest, everything could be done through windows script hosting, as batch is very limited.

I will just outline my method incase you can maybe whip something up before I get round to it. I have very little time around this season.

In your batch file, it'll have a call (cscript) that will run the javascript file and store the needed string you require in a variable that you can use however you like.

Inside the javascript file it will load the XML of that link and return the string you require. You will probably use Msxml2 DOMDocument, load the link, parse the string out using DOM methods to get the element and the child's value and return it back to your script.

Well, thats the basics of what you could do, or if I do find time, I'll post the script but my method will be combining batch and javascript in the same file.

Hopefully this gives you a better means to solving your problem, if using just windows scripting host (far more powerful) then you should consider just using that, it works similar to batch and can be seen as its successor.

Cheers,

KK
Kame (312)
1412535 2015-12-16 07:37:00 Whatever way that works, and is easy to add to is fine by me. I know very little about such things other than what I had worked out already.
It is only the abc stream that needs the extra procedure.
apsattv (7406)
1 2