These forums are archived

See this post for further info

get_iplayer forums

Forum archived. Posting disabled.

PHP Script For get_iplayer

user-1130

Hi

What's the possiblity of someone creating a PHP script for get_iplayer?

Thanks

user-250

What do you mean? re-write it in PHP. Your question is quite vague.
There are some (old) perl to PHP converters on perlmongers, perlmonks and CPAN.
If you want something written try Fiverr.

user-1144

I've been working on a semi-basic PHP iPlayer interface thingymabob which grabs the HLS stream URLs like get_iplayer does (or did until the BBC screwed everything up today) and pipes them to the browser through a HTML5 video element propped up by HLS.js.

My code was designed to allow New Nintendo 3DS users to watch iPlayer.

I might share the source code at some point, but may I ask what you want to do this for?

In any case, however, it will need 75% rewriting at least since the BBC took down the old /programmes API. (To be honest they've been saying they'll do that for ages so fair enough, but it's still annoying...)

Sincerely,
Joshua Kelly

user-637

Hello,

I wrote a simple php code that grabs the HLS streams and saves the iPlayer programmes as .ts files. It is not very good, but it works well enough for me. It also works now that the BBC have made their changes today. If you like writing code then it may be helpful. I think that it will only work on Windoze though, it is not very clever!

I usually run this php script using the get_iplayer web pvr manager. I have this line of code in the get_iplayer options file which starts a batch file which in turn runs the php script:

Code:
command BBC_iPlayer_DL.bat <pid>

or perhaps this would work too:

Code:
command php BBC_iPlayer_DL_no_proxy.php http://www.bbc.co.uk/iplayer/episode/<pid>

Tonight I cannot run this php script directly from get_iplayer though because of the changes made by the BBC today.

The quality of video / audio can be selected by editing the (settings.ini) file. Right now I download with very high quality by setting the contents of settings.ini to: 


Code:
-audio_1=96000-video=5070000


This setting gives me VIDEO RESOLUTION=1280x720  and AUDIO="audio-96" and 50 fps.

The php script needs you to copy and paste the URL of the program that you wish to copy from the BBC iplayer website. The first argument of the command line is the url of the BBC iplayer video that you wish to save as a .ts file. 

For example, command line: 

Code:
php BBC_iPlayer_DL_no_proxy.php http://www.bbc.co.uk/iplayer/episode/b06wj608/dickensian-episode-8

Most likely this php code is not working without editing and adapting or developing it for your own use. If there are others out there that like to play with the code then this could be useful.

Thanks,

Tiiveni.

more information:

Settings for the quality of audio and video are made using the text file "./files/Settings.ini" the contents of which can be any text which must be found in the m3U8 file that is to be downloaded. The "-audio_1=" and "-video=" currently identifies the audio and video quality, this can be used to select the video / audio of the desirable quality versus filesize. 

Example:
-audio_1=96000-video=5070000


Full list of audio / video options (as of January 2016):
BANDWIDTH=169000 ,CODECS="mp4a.40.2,avc1.42C015",RESOLUTION=192x108  ,AUDIO="audio-128"-audio=128000-video=31000.m3u8

BANDWIDTH=373000 ,CODECS="mp4a.40.2,avc1.42C015",RESOLUTION=192x108  ,AUDIO="audio-320"-audio=320000-video=31000.m3u8
BANDWIDTH=59000  ,CODECS="mp4a.40.5,avc1.42C015",RESOLUTION=192x108  ,AUDIO="audio-24" -audio_1=24000-video=31000.m3u8
BANDWIDTH=84000  ,CODECS="mp4a.40.5,avc1.42C015",RESOLUTION=192x108  ,AUDIO="audio-48" -audio_1=48000-video=31000.m3u8
BANDWIDTH=135000 ,CODECS="mp4a.40.5,avc1.42C015",RESOLUTION=192x108  ,AUDIO="audio-96" -audio_1=96000-video=31000.m3u8

BANDWIDTH=227000 ,CODECS="mp4a.40.2,avc1.42C015",RESOLUTION=192x108  ,AUDIO="audio-128"-audio=128000-video=86000.m3u8

BANDWIDTH=431000 ,CODECS="mp4a.40.2,avc1.42C015",RESOLUTION=192x108  ,AUDIO="audio-320"-audio=320000-video=86000.m3u8

BANDWIDTH=117000 ,CODECS="mp4a.40.5,avc1.42C015",RESOLUTION=192x108  ,AUDIO="audio-24" -audio_1=24000-video=86000.m3u8

BANDWIDTH=143000 ,CODECS="mp4a.40.5,avc1.42C015",RESOLUTION=192x108  ,AUDIO="audio-48" -audio_1=48000-video=86000.m3u8
BANDWIDTH=193000 ,CODECS="mp4a.40.5,avc1.42C015",RESOLUTION=192x108  ,AUDIO="audio-96" -audio_1=96000-video=86000.m3u8

BANDWIDTH=302000 ,CODECS="mp4a.40.2,avc1.42C015",RESOLUTION=256x144  ,AUDIO="audio-128"-audio=128000-video=156000.m3u8

BANDWIDTH=505000 ,CODECS="mp4a.40.2,avc1.42C015",RESOLUTION=256x144  ,AUDIO="audio-320"-audio=320000-video=156000.m3u8
BANDWIDTH=191000 ,CODECS="mp4a.40.5,avc1.42C015",RESOLUTION=256x144  ,AUDIO="audio-24" -audio_1=24000-video=156000.m3u8

BANDWIDTH=217000 ,CODECS="mp4a.40.5,avc1.42C015",RESOLUTION=256x144  ,AUDIO="audio-48" -audio_1=48000-video=156000.m3u8

BANDWIDTH=268000 ,CODECS="mp4a.40.5,avc1.42C015",RESOLUTION=256x144  ,AUDIO="audio-96" -audio_1=96000-video=156000.m3u8

BANDWIDTH=434000 ,CODECS="mp4a.40.2,avc1.42C015",RESOLUTION=384x216  ,AUDIO="audio-128"-audio=128000-video=281000.m3u8
BANDWIDTH=638000 ,CODECS="mp4a.40.2,avc1.42C015",RESOLUTION=384x216  ,AUDIO="audio-320"-audio=320000-video=281000.m3u8
BANDWIDTH=324000 ,CODECS="mp4a.40.5,avc1.42C015",RESOLUTION=384x216  ,AUDIO="audio-24" -audio_1=24000-video=281000.m3u8
BANDWIDTH=349000 ,CODECS="mp4a.40.5,avc1.42C015",RESOLUTION=384x216  ,AUDIO="audio-48" -audio_1=48000-video=281000.m3u8

BANDWIDTH=400000 ,CODECS="mp4a.40.5,avc1.42C015",RESOLUTION=384x216  ,AUDIO="audio-96" -audio_1=96000-video=281000.m3u8

BANDWIDTH=598000 ,CODECS="mp4a.40.2,avc1.42C01E",RESOLUTION=448x252  ,AUDIO="audio-128"-audio=128000-video=436000.m3u8
BANDWIDTH=802000 ,CODECS="mp4a.40.2,avc1.42C01E",RESOLUTION=448x252  ,AUDIO="audio-320"-audio=320000-video=436000.m3u8
BANDWIDTH=488000 ,CODECS="mp4a.40.5,avc1.42C01E",RESOLUTION=448x252  ,AUDIO="audio-24" -audio_1=24000-video=436000.m3u8
BANDWIDTH=514000 ,CODECS="mp4a.40.5,avc1.42C01E",RESOLUTION=448x252  ,AUDIO="audio-48" -audio_1=48000-video=436000.m3u8

BANDWIDTH=564000 ,CODECS="mp4a.40.5,avc1.42C01E",RESOLUTION=448x252  ,AUDIO="audio-96" -audio_1=96000-video=436000.m3u8
BANDWIDTH=599000 ,CODECS="mp4a.40.2,avc1.4D401E",RESOLUTION=512x288  ,AUDIO="audio-128"-audio=128000-video=437000.m3u8
BANDWIDTH=803000 ,CODECS="mp4a.40.2,avc1.4D401E",RESOLUTION=512x288  ,AUDIO="audio-320"-audio=320000-video=437000.m3u8

BANDWIDTH=489000 ,CODECS="mp4a.40.5,avc1.4D401E",RESOLUTION=512x288  ,AUDIO="audio-24" -audio_1=24000-video=437000.m3u8

BANDWIDTH=515000 ,CODECS="mp4a.40.5,avc1.4D401E",RESOLUTION=512x288  ,AUDIO="audio-48" -audio_1=48000-video=437000.m3u8
BANDWIDTH=565000 ,CODECS="mp4a.40.5,avc1.4D401E",RESOLUTION=512x288  ,AUDIO="audio-96" -audio_1=96000-video=437000.m3u8
BANDWIDTH=865000 ,CODECS="mp4a.40.2,avc1.42C01E",RESOLUTION=640x360  ,AUDIO="audio-128"-audio=128000-video=688000.m3u8

BANDWIDTH=1069000,CODECS="mp4a.40.2,avc1.42C01E",RESOLUTION=640x360  ,AUDIO="audio-320"-audio=320000-video=688000.m3u8
BANDWIDTH=755000 ,CODECS="mp4a.40.5,avc1.42C01E",RESOLUTION=640x360  ,AUDIO="audio-24" -audio_1=24000-video=688000.m3u8
BANDWIDTH=781000 ,CODECS="mp4a.40.5,avc1.42C01E",RESOLUTION=640x360  ,AUDIO="audio-48" -audio_1=48000-video=688000.m3u8
BANDWIDTH=832000 ,CODECS="mp4a.40.5,avc1.42C01E",RESOLUTION=640x360  ,AUDIO="audio-96" -audio_1=96000-video=688000.m3u8
BANDWIDTH=1013000,CODECS="mp4a.40.2,avc1.4D401E",RESOLUTION=704x396  ,AUDIO="audio-128"-audio=128000-video=827000.m3u8
BANDWIDTH=1216000,CODECS="mp4a.40.2,avc1.4D401E",RESOLUTION=704x396  ,AUDIO="audio-320"-audio=320000-video=827000.m3u8
BANDWIDTH=903000 ,CODECS="mp4a.40.5,avc1.4D401E",RESOLUTION=704x396  ,AUDIO="audio-24" -audio_1=24000-video=827000.m3u8

BANDWIDTH=928000 ,CODECS="mp4a.40.5,avc1.4D401E",RESOLUTION=704x396  ,AUDIO="audio-48" -audio_1=48000-video=827000.m3u8
BANDWIDTH=979000 ,CODECS="mp4a.40.5,avc1.4D401E",RESOLUTION=704x396  ,AUDIO="audio-96" -audio_1=96000-video=827000.m3u8
BANDWIDTH=1800000,CODECS="mp4a.40.2,avc1.64001F",RESOLUTION=704x396  ,AUDIO="audio-128"-audio=128000-video=1570000.m3u8
BANDWIDTH=2004000,CODECS="mp4a.40.2,avc1.64001F",RESOLUTION=704x396  ,AUDIO="audio-320"-audio=320000-video=1570000.m3u8

BANDWIDTH=1690000,CODECS="mp4a.40.5,avc1.64001F",RESOLUTION=704x396  ,AUDIO="audio-24" -audio_1=24000-video=1570000.m3u8
BANDWIDTH=1716000,CODECS="mp4a.40.5,avc1.64001F",RESOLUTION=704x396  ,AUDIO="audio-48" -audio_1=48000-video=1570000.m3u8
BANDWIDTH=1766000,CODECS="mp4a.40.5,avc1.64001F",RESOLUTION=704x396  ,AUDIO="audio-96" -audio_1=96000-video=1570000.m3u8

BANDWIDTH=1836000,CODECS="mp4a.40.2,avc1.4D401F",RESOLUTION=960x540  ,AUDIO="audio-128"-audio=128000-video=1604000.m3u8
BANDWIDTH=2040000,CODECS="mp4a.40.2,avc1.4D401F",RESOLUTION=960x540  ,AUDIO="audio-320"-audio=320000-video=1604000.m3u8

BANDWIDTH=1726000,CODECS="mp4a.40.5,avc1.4D401F",RESOLUTION=960x540  ,AUDIO="audio-24" -audio_1=24000-video=1604000.m3u8
BANDWIDTH=1752000,CODECS="mp4a.40.5,avc1.4D401F",RESOLUTION=960x540  ,AUDIO="audio-48" -audio_1=48000-video=1604000.m3u8

BANDWIDTH=1802000,CODECS="mp4a.40.5,avc1.4D401F",RESOLUTION=960x540  ,AUDIO="audio-96" -audio_1=96000-video=1604000.m3u8
BANDWIDTH=3117000,CODECS="mp4a.40.2,avc1.64001F",RESOLUTION=960x540  ,AUDIO="audio-128"-audio=128000-video=2812000.m3u8
BANDWIDTH=3320000,CODECS="mp4a.40.2,avc1.64001F",RESOLUTION=960x540  ,AUDIO="audio-320"-audio=320000-video=2812000.m3u8

BANDWIDTH=3007000,CODECS="mp4a.40.5,avc1.64001F",RESOLUTION=960x540  ,AUDIO="audio-24" -audio_1=24000-video=2812000.m3u8

BANDWIDTH=3032000,CODECS="mp4a.40.5,avc1.64001F",RESOLUTION=960x540  ,AUDIO="audio-48" -audio_1=48000-video=2812000.m3u8

BANDWIDTH=3083000,CODECS="mp4a.40.5,avc1.64001F",RESOLUTION=960x540  ,AUDIO="audio-96" -audio_1=96000-video=2812000.m3u8
BANDWIDTH=5510000,CODECS="mp4a.40.2,avc1.640020",RESOLUTION=1280x720 ,AUDIO="audio-128"-audio=128000-video=5070000.m3u8

BANDWIDTH=5714000,CODECS="mp4a.40.2,avc1.640020",RESOLUTION=1280x720 ,AUDIO="audio-320"-audio=320000-video=5070000.m3u8
BANDWIDTH=5400000,CODECS="mp4a.40.5,avc1.640020",RESOLUTION=1280x720 ,AUDIO="audio-24" -audio_1=24000-video=5070000.m3u8
BANDWIDTH=5426000,CODECS="mp4a.40.5,avc1.640020",RESOLUTION=1280x720 ,AUDIO="audio-48" -audio_1=48000-video=5070000.m3u8
BANDWIDTH=5476000,CODECS="mp4a.40.5,avc1.640020",RESOLUTION=1280x720 ,AUDIO="audio-96" -audio_1=96000-video=5070000.m3u8
BANDWIDTH=8616000,CODECS="mp4a.40.2,avc1.640028",RESOLUTION=1920x1080,AUDIO="audio-128"-audio=128000-video=8000000.m3u8

BANDWIDTH=8820000,CODECS="mp4a.40.2,avc1.640028",RESOLUTION=1920x1080,AUDIO="audio-320"-audio=320000-video=8000000.m3u8

BANDWIDTH=8506000,CODECS="mp4a.40.5,avc1.640028",RESOLUTION=1920x1080,AUDIO="audio-24" -audio_1=24000-video=8000000.m3u8
BANDWIDTH=8531000,CODECS="mp4a.40.5,avc1.640028",RESOLUTION=1920x1080,AUDIO="audio-48" -audio_1=48000-video=8000000.m3u8
BANDWIDTH=8582000,CODECS="mp4a.40.5,avc1.640028",RESOLUTION=1920x1080,AUDIO="audio-96" -audio_1=96000-video=8000000.m3u8

BBC_iPlayer_DL.zip

These forums are archived

See this post for further info