About get_iplayer
This tool allows you to download or stream any iPlayer programme from the BBC in H.264 (Quicktime/mp4) format, any radio programmes in MP3 or RealAudio format (optionally converted to wav or mp3) and all podcasts in MP3/AAC format. It even downloads the subtitles where available.
A major new feature adds PVR-like capabilities (like Sky+ / TiVo); You can save lists of programme searches which are automatically downloaded when they become available.
The H.264 feeds from the BBC are higher quality than in the Flash iplayer (normal quality) or the Wii. See the beebhack wiki for a comparison. They are intended for the Apple iPhone and are consequently made difficult to download for any other OS. The same goes for the iPhone MP3 radio streams.
Myself and a few others worked out how to work around these problems and now have tools which essentially simulate an iPhone as far as the BBC web servers are concerned.
get_iplayer, does the downloading, indexing and searching of the iPlayer TV/Radio programmes and podcasts available. It can even stream them while downloading them to mplayer or xine, etc. It does not circumvent any digital rights management security (see the BBC’s website on how to do that with the Windows-only DRM content they provide).
Uses
The script is intended for use for playing back iPlayer content on devices that cannot support adobe flash/air, systems which run entirely on open-source software (i.e. no Adobe flash/air), downloading content for mobile devices that have no access to broadband/wi-fi or running on devices that have such limited memory that running a browser with a flash player or AIR is not possible (or not permitted). For me this would be an Xbox running Xebian Linux with Freevo. It only has 64Mb of memory and struggles enormously with Adobe flash (Adobe doesn’t permit you run flash player or AIR on a games console either). Of course, to keep the BBC’s content providers’ wishes, you should keep the downloaded content for no longer than it would be available on the BBC iPlayer web site, not attempt to obtain it from outside of the UK and not redistribute it. If you want to get higher quality TV programmes from the BBC then this is not the tool for you. You would be better off getting a DVB-T tuner card or a DTV PVR.
Features
- Downloading H.264 video, and MP3 (or RealAudio) audio streams and podcasts from BBC iplayer site
- PVR functionality allows predefined searches to be downloaded from a scheduler such as cron or Windows scheduler
- Rewrites the movie file on-the-fly so that it can be streamed before being fully downloaded
- Resume downloads of partially downloaded video, radio and podcast files
- Stream iPlayer or podcast content via mplayer or xine while downloading it
- Allow multiple programmes to be downloaded in one command
- Indexing of all available (i.e. listed) podcasts and iPlayer Radio/TV programs
- Script update capability
- Caching of Programme Indices
- Creation of basic html and xml index files
- HTTP Proxy support
- Search on programme name, episode, description, channel or category
- Limit search by programmes made available after a specific number of hours
Supported Platforms
It has been tested under Linux (Fedora 6/7/8/9/10, Centos/RHEL 5, Ubuntu, Xebian, Debian, OLPC, ArchLinux), MacOS X and Windows (Cygwin or Activestate perl)
Using get_iplayer
See the instructions and examples here
Downloading get_iplayer
See here
Installing get_iplayer
See the installation instructions here
Contact
You can send me bug reports in the comments below or email them to me at iplayer (at sign) linuxcentre.net
@Phil, regarding the lower quality, i was referring to tv shows yeah.
I thought the H.264 format was the beebs’ “high quality” output, if so, what’s the low quality output? I currently see around 750 programmes returned, but would have thought there would be more available (but in lower quality).
As for a GUI, I think i’m personally gonna knock up a quick web-page on a dedicated server for it which simply calls the script with some snazzy ajax call-backs, etc. Obviously restricted for my own personal use.
@Robsco,
The vast majority of iplayer progs become available in H.264/iPhone format. I think there are very few exceptions to this. Although sometimes there is some lag on when they become available.
Thanks for that Phil, I gave it a try and in v1.03 --pid no longer download the index-
Have good holiday!
hi phil,
i’ve enjoyed using get_player, but for a month now i’ve been experiencing a problem. every attempt to download a file is eventually met with
WARNING: Bad file download, deleting cookie
WARNING: Retrying download for ‘Have I Got A Bit More News For You - Episode 9′
INFO: Attempting to Download: Have I Got A Bit More News For You - Episode 9
ERROR: Failed to get programme ID from iplayer site
INFO: Programme is reported as ready for download
INFO: Checking existence of Original version
Can’t call method “scheme” on an undefined value at /usr/share/perl5/HTTP/Cookies.pm line 44.
and such like. can you help? i’ve tried remedies suggested above (flush, rm cookies directory) but so far no joy.
many thanks,
philb
@philb. linuxcentre.net then I’ll take a close look.
One immediate thought comes to mind, can get_iplayer actually write to your prefs directory (~/.get_iplayer). Also what plaform/OS and get_iplayer version are you using? You might want to try the latest version by running ‘get_iplayer -u’ Could you do me a favour and email me the console output when you run with the --verbose and --debug options specified? Please email them to me at: iplayer
Brilliant! This would be good as a Firefox plugin.
@Steve,
Indeed - probably would be quite easy using Javascript / XUL.
Hi. Great script. Why is all the output to stderr and none to stdout?
@abe,
That is not the case if -stdout is used - then the movie data goes to stdout. If the messages went to stdout then streaming would not work. I intend to make it more intelligent soon and use stdout for messages where appropriate.
Hello.
Hopefully a quick question. I run a cron job each night to sniff for programmes to download, and I create an html file so I can open my browser and see exactly what’s available to watch. The trouble is, I see all the progs (including CBBC and CBeebies).
Running this command:
perl /home/john/bbc_iplayer.pl --exclude-category child --exclude-channel CBeebies
Gives me the results I need - however, when I tag the --html on the end, the list seems to revert back to the ‘full’ listing i.e. the Cbeebies stuff.
Is this an RTFM problem or does the --html always output all the progs available to download?
@John Goodwin,
No not an RTFM problem! - it’s just that I never thought of having it behave like that. Good idea. Update to v1.07 and it will do what you desire
@abe,
stdout is now used for message output…
I have read everything above very diligently before posting this seemingly stupid question, but I couldn’f find anything that answered my question. If I missed or misunderstood something, please accept my apologies.
Here goes, quite simply I want to send the listing of the available programmes (i.e. the output of the simple “get_iplayer” command, to a file so that I can see everything as opposed to the truncated list Vista’s command line box (seems to truncate before 230 or so) gives me. I have tried the usual DOS pipe command (get_iplayer >c:/Users/Marc…..) but that doesn’t work. I have tried the Vista Clip command but nothing appears on the clipboard.
I realise this should be a really simple thing to achieve but I, as you can tell, no expert!
If anyone can help me that would be great.
Thanks
Marc
Phil Lewis, you are indeed a gentleman and a scholar. Please find attached a virtual beer, and I wish you all the best for 2009.
Keep up the excellent work and thanks for a wonderful script.
Cheers - JG
I have a cheapo-nasty media player (Archos) that will not play mp4 files. I am interested in version 1.08 where you state in the change log that an AVI is created for a Normal Quality Flash file.
Is there any way of forcing AVI to always be created (even when High Quality RTMP is used)? I am tired of manually doing this
Hi,
I’m looking for http://www.bbc.co.uk/iplayer/episode/b008prpk/Womans_Hour_22_01_2008/ with your script but using the term “woman’s” other episodes show up but not that one.
I just wanted to report it in case it is a bug.
Cheers
Jon
Totally brilliant program! Im now trying to get a script to run in cron:
cd /home/steve/iplayer
get_iplayer --type=radio --channel=’BBC 7′ --get ‘pattern’
get_iplayer --type=radio --channel=’BBC Radio 3′ --get ‘puccini’
get_iplayer --type=radio --channel=’BBC World Service’ --get ‘Digital Planet’
the script is executable, and runs from a double-click or command line, but I cant get it to run in Cron, any ideas? Im on Ubuntu Dapper.
@Andrew,
Your media player is not cheapo nasty! A friend of mine uses that configuration and he uses the following command option to transcode for the Archos:
get_iplayer -get 123 --command ‘mencoder -ovc lavc -lavcopts vcodec=mpeg4 -oac lavc -lavcopts abitrate=128 -o <filename>.mp4 <filename> -quiet &’
This then automatically transcodes the successfully downloaded video files to mp4 rather than h264 which the archos cannot cope with at that resolution. This is probably suboptimal and you may want to experiment with the mencoder options.
@Steve Thompson,
You would be better off running in pvr mode. See http://linuxcentre.net/getiplayer/documentation/ seciotn regarding ‘PVR usage examples’. That way you don’t need to add a new cron entry for each programme. (btw: the reason it doesn’t work for you is because you need to ditch the ‘cd’ and just call get_iplayer as /home/steve/iplayer/get_iplayer).
Hmm I tried this in pvr mode:
get_iplayer --pvr-add=\’pattern recognition\’ --type=radio --output=/home/steve/iplayer/ channel=\’bbc 7\’
Its a william Gibson Scifi story on BBC 7
nothing doing…
What am I doing wrong?
Steve
@Steve Thompson,
Did you forget the ‘--’ before the channel option? It is best to test using the search options without the --pvr-add option first - then when you get the matches you desire, add them back in. BTW: That command will end up downloading all of BBC 7’s content - don’t forget the final search pattern!
@Jon,
Seems to be there and downloadable to me. It has just become available in the last 3 hours - sometimes there is a lag in the BBC….
The --rtmp option for downloading seems to work, but the .flv file won’t play or convert. (On Ubuntu 8.10). I used the --raw option to save the .flv file. mplayer file.flv produces lots of messages:



[flv @ 0x8837aa8]Unsupported video codec (7)
… and then finishes with:
Opening audio decoder: [dmo] Win32/DMO decoders
IMediaObject ERROR: 0×88dfa1b input format not accepted (0×80040205 : -2147220987)
ERROR: Could not open required DirectShow codec wmspdmod.dll.
ADecoder preinit failed
ADecoder init failed
Opening audio decoder: [dshow] Win32/DirectShow decoders
Win32 LoadLibrary failed to load: wmavds32.ax, /usr/lib/win32/wmavds32.ax, /usr/local/lib/win32/wmavds32.ax
Warning: DS_Filter() could not open DirectShow DLL. (DLL=wmavds32.ax, r=0xa492be2)
ERROR: Could not open required DirectShow codec wmavds32.ax.
ADecoder preinit failed
ADecoder init failed
Cannot find codec for audio format 0xA.
Read DOCS/HTML/en/codecs.html!
Audio: no sound
Video: no video
I have medibuntu installed (and the w32codecs), and the /usr/lib/win32 directory does contain wmspdmod.dll
Have google’d, but not found anything that helps so far.
Any suggestions?
Thanks
@Marc Nield,
If you use the latest version (1.06 or above) of get_iplayer, the DOS pipe you used should work. It originally sent to output to stderr, now it sends it all to stdout. If you used the windows automated installer version you will not have the latest version unfortunately yet until a newer one is contributed. If this is the case then, at least in XP, you are able to set the cmd box properties to set the scrollback to many more lines whic willh help. Or you could append --html=’listing.html’ and use a web browser to read the resulting listing.html file.
Thanks for the quick reply Phil (and again for the great script).
You supplied the answer:
get_iplayer -get 123 --command ‘mencoder -ovc lavc -lavcopts vcodec=mpeg4 -oac lavc -lavcopts abitrate=128 -o .mp4 -quiet &’
If I saved this in the .get_iplayer/options file (using --save) would this effect downloads that were mp3’s? Obviously I only require movies to be re-encoded.
PS. I guess we will have to agree to disagree on the Archos - my experience is they are bug-ridden and you have to pay extra for every little add-on (for instance you cannot play .mpg by default you have to pay extra, you can’t play .aac by default it costs you again!).
Hey just downloaded the program, and I managed to get to the iplayer file I wanted to download, it seems to have worked but only for 3 minutes of the 3 hour show. I tried again with another episode one wouldnt work at all and another only did 1 minute.
I was trying to get Greg James show from radio 1 using the code
get_iplayer --get 10425 (failed)
get_iplayer --get 10426 (3 minutes)
get_iplayer --get 10427 (failed)
get_iplayer --get 10428 (1 Minute)
Any idea where I\’m going wrong?
Thanks very much
Don’t worry! I’ve got it now

Hmm still no good, whats the switch to search for \’Pattern recognition\’? is it still get?
get_iplayer --pvr-add=\’pattern recognition\’ --type=radio --output=/home/steve/iplayer/ --channel=\’bbc 7\’ --category=\’pattern recognition\’
Is this right?
This is the contents of Pattern Recognition PVR
category pattern recognition
output /home/steve/iplayer/
type radio
channel bbc 7
search0 ‘Pattern Recognition’
looks ok to me?
@Steve Thompson,
That looks about right except there is no current category on iplayer called ‘pattern recognition’ - I’m guessing that this is an example. The contents of the pvr file seem to suggest that you’ve added another term in the cmdline: ‘Pattern Recognition’.
There is no option/switch for the search term - just add it on the end of the cmdline.
Remember to run ‘/path/to/get_iplayer --pvr’ regularly from the crontab… I would strongly suggest you read the tutorial example at http://linuxcentre.net/dont-want-to-miss-that-programme-on-iplayer-over-christmas/ if you haven’t already.
@Andrew,
Yes you are right - that would possibly cause probs with non-video downloads. Maybe you could kludge this by using <dir>/<fileprefix>.mov instead of <filename> - this way mencoder will just quit because it will not find any mp3 files… You could alternatively write a small shell script which get_iplayer calls using --command to selectively transcode based on the file extension.
@David Smith,
Seems that Ubuntu Hardy Heron’s ffmpeg is too old to support flv/h264 de/re-muxing. See the comment and workaround in the comment from ‘Bigarules’ at:
http://linuxcentre.net/get_iplayer-gets-high-quality-flash-bbc-iplayer-rtmp-downloading-capability/#comments
As pointed out by the rtmpdump author, flv is a really lousy container format and although newer versions of mplayer can play it, it really should be ‘re-containered’ into mp4.
@Phil
Thank you for the quick reply - yes, that seems to do the trick nicely
Thank you for an excellent utility!
Thanks Phil, I too can see it now.
I decided on the external script route and came up with this:
#!/bin/bash -e
FILENAME=$1
if [ $FILENAME != \"*.mov\" -a $FILENAME != \"*.wmv\" -a $FILENAME != \"*.mp4\" ]; then
echo && echo \"Processing: $FILENAME\" && echo /usr/bin/mencoder \"$FILENAME\" -o \"$FILENAME.avi\" -vf softskip,harddup -oac mp3lame -lameopts abr:br=128 -quiet -ovc xvid -xvidencopts bitrate=1000:me_quality=6:vhq=3:threads=2:max_bframes=2:bvhq=\
1:nopacked:quant_type=h263:noqpel:nogmc:trellis:nointerlacing:\
chroma_me:chroma_opt:hq_ac:nolumi_mask:rc_reaction_delay_factor=0:rc_averaging_\
period=100:closed_gop:autoaspect && rm \"$FILENAME\";
fi
It can probably be improved as I\’m not the greatest coder in the world!
For those that might be following this I now run get_iplayer with this extra parameter:
--command ‘bash .get_iplayer/encode \"<dir>/<fileprefix>.<ext>\"’
where .get_iplayer/encode is the location of the above script.
It seems to mostly work
Seems like any program with the ‘Guidance’ flag fails to download. Going on the web site and playing the same program pops up a question to agree to the parental guidance flag. Subsequent runs of any other ‘Guideance’ rated programs play ok which means it sets a cookie in my browser. Can you add an option for this please ? The cookie is called BBCPGstat
Hi Mitch, Several users have reported this in the past but I’ve never been able to even see any first hand evidence of this problem to be able to test it. Can you provide me with an example or two so I can investigate together with the command options you are using when this causes a problem? Thanks!
% get_iplayer ‘Most Annoying’
Matches:
300: Most Annoying Couples We Love to Hate - 24/12/2008, ‘BBC Three’, Entertainment,TV, default
301: Most Annoying People: 2008 - Part 2, ‘BBC Three’, Entertainment,Guidance,TV, default
302: Most Annoying People: 2008 - Part 1, ‘BBC Three’, Entertainment,Guidance,TV, default
INFO: 3 Matching Programmes
Pick the last one for example with the Guidance flag on..
% get_iplayer --get 301 -v
Current options:
get = 1
output = /data/movies/BBC
verbose = 1
INFO: Search args: ‘301′
Matches:
301: Most Annoying People: 2008 - Part 2, ‘BBC Three’, Entertainment,Guidance,TV, default
INFO: 1 Matching Programmes
INFO: Programme not in download history
INFO: Attempting to Download: Most Annoying People: 2008 - Part 2
INFO: iPlayer metadata URL = http://www.bbc.co.uk/iplayer/playlist/b00g9293
INFO: Version: default, VersionPid: b00h1pt3
INFO: Checking existence of default version
INFO: Version = default
INFO: media stream download URL = http://www.bbc.co.uk/mediaselector/3/auth/iplayer_streaming_http_mp4/b00h1pt3?938278
ERROR: Programme is not yet ready for download
ERROR: No Stage 2 URL
However, now go on the iplayer web site and i can play this episode just fine.
You can only really do that test using an iPhone - the web page version is always made available before the iPhone version which get_iplayer automatically uses. If I add the guidance cookie into the iPhone request it still is unavailable. A few progs never make it to the iPhone format but some take a few days. Thanks for the feedback and examples though!
Ok thanks. Seems this only still happens on programs with Guidance rated progs. Thanks for quick response..
I disagree - ‘Blood Sweat and T-Shirts’ has exactly the same ‘adult’ guidance and is fully available. ‘BBC Weather - 02/01/2009′ is not available yet but has no guidance rating. And they were just some random tests I just did.
Just tried to download the last episode of Pattern Recognition on BBC 7, and nothing downloaded! its on the website, did a test of book at bedtime & thats ok?
Whats up? feed problem?
Steve
It’ll most probably be made available eventually - the iPhone feeds (which get_iplayer uses) always seem to lag the flash/rtmp website ones by up to a few days.
Tried this morning to download a show off BBC World Service - “The story of Braille” my main machine runs Ubuntu Dapper & it fell over trying to convert the real audio to mp3, is there a fix for dapper? it worked fine on my Gutsy laptop.
Yes, sorry - I inadvertently broke lame transcoding to mp3. Please use last night’s latest release v1.10.
Hi Phil
In the latest get_iplayer v1.11 there’s note saying “Add user meta-data to iPhone/h.264 downloaded video (hopefully helps with iTunes)”.
Can you elaborate on this please as I couldn’t find anything in the help file or online instructions.
Many thanks for this great script.
Cheers
James
Hi James,
get_iplayer now automatically inserts some programme metadata such as author, name, description etc into video downloaded using the default iPhone method. It may or may not work in iTunes - it only in alpha stage. Let me know if you get any metadata show up…
Cool. It works.
However there are some extra characters in there.
ie.
& at the end of Name
^ at the end of artist
% at the end of Album
$ at the end of comments.
This was on :-
INFO: Attempting to Download: Charlie and Lola: Series 2 - This is Actually My Party
It’s for my son, honest
OK, Thanks for that - it was a field length bug. The fix will be in 1.12 once released. BTW: Were they the only bits of metadata available?
1.12 is released…
Okay, I downloaded get_iplayer, I assume successfully. Pardon my extreme ignorance, but what is supposed to happen. I glick on the get_iplayer icon and I get a white on black list with C:\Program Files\get_iplayer> at the end. I type in the different commands but I always get “___ is not recognized as an internal of external command.” What do I do?
Pages
Categories
Recent Comments
Archives
Links
Don't Click!
© Linuxcentre * WordPress * LoseMyMind * Feed