get_iplayer for RTE?

Vangelis forthnet northmedia1 at the.forthnet.gr
Sun Feb 15 22:40:20 PST 2015


On Sun Feb 15 10:52:13 GMT 2015, CJB wrote:

> I'm trying to download this programme:
>
> http://www.rte.ie/lyricfm/the-lyric-feature/programmes/2015/0123/675253-the-lyric-feature-friday-23-january-2015/?clipid=1785754

Hello Chris :-)

Actually, I'm seeing many similarities with BBC iPlayerRadio...

1. When you click the purple "Listen" button, a new popup opens:

http://www.rte.ie/radio/utils/radioplayer/rteradioweb.html#!rii=16%3A10365453%3A0%3A%3A

2. Go to:

http://meyerweb.com/eric/tools/dencoder/

and decode the last string of previous URL:

16%3A10365453%3A0%3A%3A  => 16:10365453:0::

The pid of your show is (initial URL):
clipid=1785754

The "version PID" is the 8 character string after the first colon
inside the decoded string, i.e.
vPID=10365453
This vPID can be used to get access to stream data.

3. If you parse manually the page source of the opened popup,
you'll find a "mediaselector API" equivalent in the form of:

http://www.rte.ie/rteavgen/getplaylist/?type=web&format=jsonp&id=

which produces a JSON file with stream info, if you append your
previously found vPID:

http://www.rte.ie/rteavgen/getplaylist/?type=web&format=jsonp&id=10365453

(file is attached).

You can manually construct the rtmpdump command for download:

rtmpdump -r "rtmpe://fmsod.rte.ie:1935/" -a "rtevod" -f "WIN 16,0,0,305" -W 
"http://www.rte.ie/static/radio/radioplayer/rteradioweb_70_osmf.swf" -p 
"http://www.rte.ie/radio/utils/radioplayer/rteradioweb.html" -C O:1 -C 
O:0 -y 
"mp4:/audio/2015/0123/20150123_rtelyricfm-thelyricfeature-thelyricfe_cl10365453_10367847_261_/20150123_rtelyricfm-thelyricfeature-thelyricfe_cl10365453_10367847_261_.mp4" 
 -o "The Lyric Feature Friday 23 January 2015 - Freeborn Man.flv"

D:\RTMPDumpHelper>rtmpdump -r "rtmpe://fmsod.rte.ie:1935/" -a "rtevod" -f 
"WIN 1
6,0,0,305" -W 
"http://www.rte.ie/static/radio/radioplayer/rteradioweb_70_osmf.sw
f" -p "http://www.rte.ie/radio/utils/radioplayer/rteradioweb.html" -C O:1 -C 
O:0
 -y 
"mp4:/audio/2015/0123/20150123_rtelyricfm-thelyricfeature-thelyricfe_cl10365
453_10367847_261_/20150123_rtelyricfm-thelyricfeature-thelyricfe_cl10365453_1036
7847_261_.mp4" -o "The Lyric Feature Friday 23 January 2015 - Freeborn 
Man.flv"
RTMPDump v2.4 GIT-2014-03-02 (Compiled by KSV)
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
Connecting ...
INFO: Connected...
Starting download at: 0.000 kB
INFO: Metadata:
INFO:   duration                3630.11
INFO:   moovPosition            28494166.00
INFO:   audiocodecid            mp4a
INFO:   aacaot                  2.00
INFO:   audiosamplerate         22050.00
INFO:   audiochannels           2.00
INFO: trackinfo:
INFO:   length                  80044032.00
INFO:   timescale               22050.00
INFO: sampledescription:
INFO:   sampletype              mp4a
29124.307 kB / 3630.07 sec (99.9%)
Download complete

Remux losslessly with FFmpeg:

ffmpeg -i "foo.flv" -vn -c:a copy -bsf:a aac_adtstoasc -f ipod "foo.m4a"

End file is a HE-AACv1, 44.1kHz, ~ 64kbps,
which would be a "flashaac" radiomode.

In the JSON file there's also info for the HLS stream;
the HLS playlist URL is:

https://vodhls.rasset.ie/manifest/audio/2015/0123/20150123_rtelyricfm-thelyricfeature-thelyricfe_cl10365453_10367847_261_.m3u8

Grab with FFmpeg in one go:

ffmpeg -i 
"https://vodhls.rasset.ie/manifest/audio/2015/0123/20150123_rtelyricfm-thelyricfeature-thelyricfe_cl10365453_10367847_261_.m3u8" 
 -vn -c:a copy -bsf:a aac_adtstoasc -f ipod "The Lyric Feature Friday 23 
January 2015 - Freeborn Man.m4a"

Input #0, hls,applehttp, from 
'https://vodhls.rasset.ie/manifest/audio/2015/0123
/20150123_rtelyricfm-thelyricfeature-thelyricfe_cl10365453_10367847_261_.m3u8':
  Duration: 01:00:30.00, start: 0.700000, bitrate: N/A
  Program 0
    Metadata:
      variant_bitrate : 64000
    Stream #0:0: Audio: aac (HE-AAC) ([15][0][0][0] / 0x000F), 44100 Hz, 
stereo,
 fltp, 64 kb/s
    Metadata:
      variant_bitrate : 64000
Output #0, ipod, to 'The Lyric Feature Friday 23 January 2015 - Freeborn 
Man.m4a
':
  Metadata:
    encoder         : Lavf56.15.102
    Stream #0:0: Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, 64 kb/s
    Metadata:
      variant_bitrate : 64000
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
size=   28335kB time=01:00:30.11 bitrate=  63.9kbits/s
video:0kB audio:27826kB subtitle:0kB other streams:0kB global headers:0kB 
muxing
 overhead: 1.828455%

However, this takes much longer than the RTMPdump way.
End file would be the equivalent of a "hlsaac" radiomode!
Thumbnail at:
 http://img.rasset.ie/00074e3e-512.jpg

There you have it!
I bet somebody with (lots) of extra time and coding skills
could write a RTE.pm plugin for get_iplayer (all the
helper apps are already existing) or even a standalone
script...

Regards. 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 10365453.json.txt
URL: <http://lists.infradead.org/pipermail/get_iplayer/attachments/20150216/01d72934/attachment.txt>


More information about the get_iplayer mailing list