How to download BBC iPlayer videos and radio programmes

Abstract (Italiano): Scrivo questo articolo in inglese perché (ovviamente) la registrazione dei video della BBC interessa maggiormente le persone che parlano inglese. Se lasciate un commento, gentilmente fatelo in inglese.

Abstract (English): I’m writing this post in English because (obviously) recording BBC videos is mostly of interest for those who speak English. Also, a small note for native speakers, especially British people: I’m Italian and I’m mostly used to write using American spelling. For this reason, the post may contain mistakes or American words which may seem unusual. I’m sorry for that. If you find errors (apart from AE spelling) let me know in the comments.

Update (30 April 2017): Version 4.0 of the script is out, which is mostly rewritten from scratch and leverages youtube-dl instead of ffmpeg. I’ve updated this post accordingly.


I already wrote about downloading videos from the BBC and Hulu websites (in Italian), however it was about two years ago. Websites change and so does software, hence the suggested method of using get_flash_videos does not work anymore.

I also wrote a generic article about downloading videos from websites (in Italian, too) that contains many different use cases and examples. One of my readers asked for clarification about recording iPlayer videos, so I tried again myself. I was able to apply some of the techniques of my post, together with a couple of clever tricks to find the maximum quality.

Since the process is a bit involved, I wrote a small software which automates all the steps and tells you how to start the recording immediately. This program is actually a so called user script, i.e. a piece of software that runs directly into your browser.

This article explains how to download and install the script. Then it shows you how to use it and what you need to do to record BBC iPlayer videos. Before we start, you need to be able to trick the BBC website into thinking you are living in the UK. If you are actually living there, skip the next section.

Pretending to be in the UK

The BBC iPlayer service is officially available only in the United Kingdom. The website will check your IP address and refuse access if you are trying to watch content from another country. To fix this problem, you need to use a technique to access the site through a server in the UK.

Usually the best tool for the job is a VPN service. VPNs are used to establish secure connections to private networks over the Internet, but may also be used to avoid geographical restrictions of websites.

There are many different VPN services. Most of them are paid (although cheap), while some are free. Among the best options, you can:

  • use VPNGate by choosing a node in the UK
  • use CyberGhost with free UK servers
  • use VPNOneClick
  • get a cheap lifetime deal for a professional VPN, such as:

Please keep in mind that recently the BBC has started being more aggressive at blocking VPN providers. Always verify if your VPN provider works with the BBC (most of them have free trials available).

CyberGhost is an interesting VPN service with a convenient free tier for Android devices, Windows and OS X. Unfortunately, the free option is not officially available for the operating system everyone should be using, i.e. Linux. I plan to investigate a bit more about this severe limitation.

Luckily, I also wrote a Python script for easily using VPNGate by specifying only the desired country which works perfectly on any Linux distribution, including Ubuntu, Mint, Fedora, OpenSuse and Mageia. You can check it out here.

You may also try VPN OneClick, which lists UK among the servers. Regardless of what VPN service you choose, once it is activated, you are ready to go on and start recording videos from iPlayer.

Script installation

To run the user script in your browser, you need to install an extension that is compatible with Greasemonkey (version 3) scripts. The following are recommended:

Currently the script does not work with Greasemonkey 4 on Firefox 57 or later. Please do not use Greasemonkey 4.

After this step, you can click the following link to open the script page on Greasyfork. On the page that shows up, click on the Install this script button to complete the procedure.

Download — BBC iPlayer video download

You are now ready to start downloading.

Recording videos

The next time you open a video page on iPlayer, you’ll see that the script adds a box under it with some instructions and a command line. The following pictures shows an example with this video.

Example of the output of the script

The command line displayed in the gray box is a one-liner you can use together with youtube-dl. This is a software used to convert and record video files, which can be installed on any of the common Linux distributions such as Ubuntu. More informations are available on the official website.

Despite its name, it does not work only for YouTube, it works for many other websites as well. My script uses it because it can download DASH streams served through a MPD file easily. The program can download some BBC videos without the need of my script, however the latter:

  • works on many pages where youtube-dl doesn’t recognize the stream URL
  • provides you with converted SRT subtitles on the fly, thanks to its internal converter

Remember that you will still need ffmpeg installed on your system. Check out its official website here.

To start the download:

  • carefully copy the entire content of the gray box (and nothing else)
  • paste it into a terminal window
  • press Enter and wait until the process is over

Keep in mind that this will create a lot of temporary files, but they will get removed automatically at the end.

It is also possible to download the videos on Windows or macOS. On Windows you just need to create a new file called download.bat (with Notepad, or any other editor) in the same directory of youtube-dl.exe and copy-paste the command line into it. After that, you click the bat file and it should start downloading.

However, please note that I do not offer any assistance for Windows or macOS here on the blog. If in doubt, please use Linux, or find an expert to help you with your OS. You can find the installation instructions of youtube-dl by clicking here.

Recording radio programmes

Starting from version 3.2, the script supports radio programmes such as those provided by BBC School Radio. The process is exactly the same as recording a video, including the command line. The files are in M4A format as provided by the BBC (no conversion is performed).


The script I developed allows to automate all the necessary steps required to ensure the highest possible quality during the downloading. In particular, the script does the following:

  • find the configuration of the player for mobile phones
  • get the list of DASH manifests for different bitrates
  • look for the best available bitrate for desktop computers
  • show the command line to the user

Performing the process manually is time consuming, error-prone and tedious if done multiple times. In this way it should be much easier for those who just want to record a couple of videos to watch them with a modern TV, on the train or keep them in a personal library.

Moreover, starting from version 3.0 the script shows you a download link to the original subtitles in TTML format (which is not very widespread). In addition, it performs an automatic conversion to the commonly used SRT format for your convenience.

Happy downloading! 🙂

Did you like the article?

Writing software and tutorials like this takes time. If you found the provided information useful, and you liked the post, you may buy me a coffee by clicking on the button. 🙂 If you do so, please leave a message on the donation page telling me it’s for this script.



181 pensieri su “How to download BBC iPlayer videos and radio programmes

  1. Thank you for upgrading the script, but there still seems to be a problem, now with avconv this is what I get when paste in terminal:

    [mp4 @ 0x7f80b1805000] pts < dts in stream 0
    av_interleaved_write_frame(): Invalid argument

    Does it mean that avconv needs to be updated too ?

    Thanks again

  2. Try with the latest version of avconv or the latest version of ffmpeg (these tools can be used with the same options, you might as well rename the ffmpeg executable to avconv).

  3. Hi,
    thank you for your work.
    I would like to share this: avconv does not work for me anymore. ffmpeg does (I have renamed the ffmpeg executable to avconv), however the frame size is now 960×540. Is there any way of getting the 1280×720 one instead?
    Thank you!

  4. Herjazz, thank you for taking the time to provide me some links. There was indeed a bug in handling M3U8 streams for audio. I have updated the script to version 3.4.1.

    Please note that now the recommended tool is ffmpeg and not avconv, although they basically work in a similar way and it should be possible to use both of them.

    Maurizio, the script provides the highest available quality provided by the BBC.

  5. Tried it for Radio programme. Get this command line, and error message:

    ffmpeg -v 16 -stats -i "*p03fx2bw_59670cc8-46bb-467b-a49c-ab959fd09077.mp4*~hmac=bbe655988785c452db6642080360f4179f087ad51fe01843783d33c416f8c0d5" Stephen_Hawking_Do_Black_Holes_Have_No_Hair_The_Reith_Lectures_BBC_World_Service.mp3*p03fx2bw_59670cc8-46bb-467b-a49c-ab959fd09077.mp4*~hmac=bbe655988785c452db6642080360f4179f087ad51fe01843783d33c416f8c0d5: Invalid data found when processing input
  6. You didn’t mention it, but I assume you are talking about this program, which is working for me.

    Which ffmpeg version are you using? Did you wait a significant amount of time after loading the page? HMAC values have an expiry timestamp, hence you need to start the process within a few minutes from the page load.

  7. That’s the programme.

    Got what I think is the latest ffmpeg programme – how can I check the version number? The zip file was named: ffmpeg-78264-g9079e99.7z.

    I attempted the download via your script almost immediately after opening the iPlayer window. And I just tried again, and got a similar error after no more than a few seconds between opening the iPlayer window, and pasting and running the ffmpeg code into Terminal.

    A related video worked just fine –, so the setup seems basically to be working – just a problem with the Radio 4 episode (audio only).

    PS. I live in the UK, so don’t need to use any VPN or proxy connection.

    PPS: got the ffmpeg executable via google search which brought me to this page:
    which in turn took me to:

    I got the latest nightly build from the top link on that page.

  8. Sorry if this has posted multiple times, but it isn’t appearing in the web page after two attempts

    Your last attempt to comment contained more than one link, which triggered an automatic spam-prevention technique, sending the comment to the moderation queue. Don’t worry, I received it and now it should be visible (I merged it with the previous one). 🙂 I receive an email notification for each comment in the queue, therefore I usually unlock them quickly.

    Unfortunately the GUI of the blog is set to Italian because it’s the main language of the site and I cannot change it on a per-article basis.

    Got what I think is the latest ffmpeg programme – how can I check the version number?

    You can run ffmpeg -version, but I believe it shall be all right then.

    immediately after opening the iPlayer window


    A related video worked just fine

    Ah. 😀 Ok now, I understand that you use OS X and you get an error only on that episode. It may be that the OS X shell is treating special chars differently than Linux, although both use Bash. I would try two things:

    • replace the double quotes with single straight quotes ' and see if it works
    • if it doesn’t, download the M3U8 contents with curl, i.e. curl "[INSERT_M3U8_URL_HERE]" and show me a screenshot of your terminal (you can upload it on ImgUr and post a link here)
  9. Great Guide Thank you very much. But I am in trouble during the last step. I have copied the code on the FF prompt, clicked enter but I have found a 403 code error Acces Denied.
    May you help me?


  10. Since you appear to be located in Milan, Italy, you need to set up a VPN connection as explained in the article. Otherwise the BBC will block your attempt to access the stream.

  11. Tried replacing the double quotes with single straight quotes in the only two places I could see – round the http://… reference. Still doesn’t work. I get a similar or same error:

    ffmpeg -v 16 -stats -i "*p03fx2bw_59670cc8-46bb-467b-a49c-ab959fd09077.mp4*~hmac=c3e8b3d1d8c5bb8bc01f36fa7f323b24e0bb90bdeaa2fcddde61b411bd35eba9" Stephen_Hawking_Do_Black_Holes_Have_No_Hair_The_Reith_Lectures_BBC_World_Service.mp3

    Sorry, I don’t quite understand what the [M3U8_URL] is. Is it the just the characters between double quotes in the first line above? Have tried replacing the ffmpeg -v 16 -stats -i expression with curl, and running again, and get this:

    curl "*p03fx2bw_59670cc8-46bb-467b-a49c-ab959fd09077.mp4*~hmac=c3e8b3d1d8c5bb8bc01f36fa7f323b24e0bb90bdeaa2fcddde61b411bd35eba9" Stephen_Hawking_Do_Black_Holes_Have_No_Hair_The_Reith_Lectures_BBC_World_Service.mp3
    curl: (6) Could not resolve host: Stephen_Hawking_Do_Black_Holes_Have_No_Hair_The_Reith_Lectures_BBC_World_Service.mp3

    And if I try with only the expression between double quotes (no output file name) I get:

    curl "<em>p03fx2bw_59670cc8-46bb-467b-a49c-ab959fd09077.mp4</em>~hmac=c3e8b3d1d8c5bb8bc01f36fa7f323b24e0bb90bdeaa2fcddde61b411bd35eba9" 

    Does that help you understand what may be happening for me on the Radio 4 link attempt?

    Thanks for such a prompt earlier response. I’m sorry I didn’t fully understand the italian that presumably said something like ‘your post has been sent for moderation before posting’ , and thought that somehow my post had just got lost or not transmitted. I understand some Italian, but not much.

    I’ve done a little further experimenting. I can get other TV programmes to record, but cannot get ANY Radio 4 programmes to do so, including ones I can watch on the computer (so they aren’t out of date).

  12. Thanks for your reply. I think is something related to my VPN but really I’am surfing the web with a browser extension so:

    • I reach the bbc web site by a browser extension
    • I copy the code under the main window
    • I paste the code in the FF Prompt
    • I get the mentioned code error


  13. John,

    Is it the just the characters between double quotes in the first line above?

    Yes, that is the URL you are having trouble to record.

    Does that help you understand what may be happening for me on the Radio 4 link attempt?

    Not really. As you can see, curl does not have issues to load the contents of the M3U8 index file, hence I guess ffmpeg shouldn’t have either. That programme is still working for me. The last things you can try are:

    • revert to FFmpeg 2.8.6 (rather than the nightly)
    • try with avconv (same syntax, this one is a forked version of ffmpeg but slightly different, maybe you will need to drop the -v 16 part)

    On Ubuntu 15.04 the version is 2.7.5 and it downloads the programme just fine. In the worst case, try to use a virtual machine with Ubuntu in it.

    Emiliano, well the point is you are not hiding your connection. If you do not use a proper VPN, ffmpeg will try to record the stream from an Italian IP and it will get blocked. You are skipping one step of the process, i.e. pretending to be in the UK. Use a VPN.

  14. Some progress, but still not success.
    Tried first to use the latest released version of ffmpeg – When I first ran the script on the radio 4 broadcast of Stephen Hawking, I got this – it looks as if the output file name needs double quotes round it, which your tampermonkey script wasn’t supplying:

    ffmpeg -v 16 -stats -i "*bUnknown-5469a7dd-29a2-4d2f-89ff-8455a5fd7933_b06qjztk_1454412145081.mp4*~hmac=3a60d49146956567a59ebd3cceb691be46f09f3e096a53e9d577b407a0c178f6" ~/Documents/My Videos/Black_holes_ain_t_as_black_as_they_are_painted_Professor_Stephen_Hawking_Black_Holes_The_Reith_Lectures_BBC_Radio_4.mp3
    [NULL @ 0x7fd26a000c00] Unable to find a suitable output format for '/Users/JohnWMcC/Documents/My'
    /Users/JohnWMcC/Documents/My: Invalid argument

    So I edited the command line in Terminal to put double quotes there, and get this instead:

    ffmpeg -v 16 -stats -i "*bUnknown-5469a7dd-29a2-4d2f-89ff-8455a5fd7933_b06qjztk_1454412145081.mp4*~hmac=3a60d49146956567a59ebd3cceb691be46f09f3e096a53e9d577b407a0c178f6" "~/Documents/My Videos/Black_holes_ain_t_as_black_as_they_are_painted_Professor_Stephen_Hawking_Black_Holes_The_Reith_Lectures_BBC_Radio_4.mp3"
    ~/Documents/My Videos/Black_holes_ain_t_as_black_as_they_are_painted_Professor_Stephen_Hawking_Black_Holes_The_Reith_Lectures_BBC_Radio_4.mp3: No such file or directory

    Looked more closely at this, and realise that I had edited your Tampermonkey script in line 17 to change the output directory to ~/Documents/My Videos.

    And that with the space between My and Videos, the directory name now needs quotes around it.

    But I had forgotten that I had later changed the directory name in Finder to be just Videos, not My Videos.

    so that line 17 should now read:

    return '~/Documents/Videos/' + title.replace(/\W+/g, '_');

    So back to your script in Tampermonkey to edit in that change. With the change, the output directory and file name no longer needs quotes, and the thing now works! Hurray.

    So there was something in the nightly build of ffmpeg that didn’t work? Or something else, perhaps the time I tried to download it first, that stopped it working?

  15. Of course I am not responsible if other people edit the script and it stops working. 😉

    So there was something in the nightly build of ffmpeg that didn’t work?

    Most likely. Nightly builds are, by definition, made from the latest source code which may contain recent modifications, bugs, omissions, etcetera. It’s best to stick with a stable release unless there is the need of using the latest additions.

    My script is created and tested with a recent stable release in mind. 🙂

  16. Ciao Andrea, for some strange reasons the script works only once.
    If I try it again on another video the text I am supposed to copy doesn’t appear under the video.
    And another thing is going on recently.. Vpnsecure looks like working for a few minutes and then “BBC iPlayer TV programmes are available to play in the UK only” appears. I change server, it works for a few minutes and the message appear again.
    Any ideas how to fix those problems?

  17. I don’t have issues with that page. Please double check that you installed my script correctly and that it shows up in the list of Greasemonkey scripts in your browser.

  18. Hi Andrea, I can work the method fine for normal iplayer programmes, but do you know if there is any way to use it on programmes purchased on the iplayer website (but not available to download)? Thanks!

  19. Hi, I’ve installed only recently your script, but the command line does not show up. I am not using any VPN, but a chromium extension. I am able to see the video in streaming, but, again, no windows comes up whit the command line to copy.

  20. Emily, sorry but I don’t know about downloading purchased programmes.

    Cassy, it usually does not work with browser extensions and you will need to use a real VPN service. This is also due to the fact that extensions and similar kinds of proxies are often detected. Conversely, VPN services (together with their DNS servers) are usually better at this. Also, sometimes it might be good to reload the page if the box does not show up the first time (while using a VPN).

  21. Seems broken again:

    ffmpeg -v 16 -stats -i "null" -codec copy -qscale 0 -bsf:a aac_adtstoasc


  22. The script behaves inconsistently, sometimes I get the URL and sometimes I don’t. I am using Ubuntu 16.04 and the latest version of the script on Firefox and Chrome.

    For example: (works) (doesn’t work)

    I get a null URL:

    ffmpeg -v 16 -stats -i "null" -codec copy -qscale 0 -bsf:a aac_adtstoasc Francesco_s_Venice_2_Beauty.mp4
  23. Jun, Coruja, thank you for providing links! I analyzed those and it seems that the URLs of difference video qualities have a slightly different format. My script was choking at them and couldn’t determine the best quality. Please check out version 3.4.4. 🙂

  24. Yes, you can now download version 3.6 which adds support for the Olympics videos, that are embedded in a slightly different way. Don’t forget to leave a positive rating on Greasyfork afterwards. 🙂

  25. It seems to have stopped working – the url is now coming up as “null”, even on a video where I was able to download before.
    Can anything be done to make it work?
    Thanks for making this script available, I really appreciate it! 🙂

  26. The script works fine for me on multiple videos. What page are you referring to? Please check your VPN, your IP address is from the Netherlands.

  27. Thanks for your reply. Strange that my IP is showing as Netherlands for you – it’s supposed to be UK and the BBC site lets me watch the iPlayer. Guess that would explain why the script no longer works for me.
    Thanks for sharing your script – I did manage to use it a little before it stopped working for me. I’ve now found an alternative which involves downloading the video fragments (something to do with Adobe HDS) and then running a PHP script to combine the fragments once downloaded. This works quite well for me as I don’t have a reliable internet connection, so not having to download the whole stream in one go is more practical for me. FYI, here’s the method I’ve used instead: – see the comment by “norton”.
    Kind regards!

  28. Weird, but it can happen sometimes. Once I spent a couple of days with many websites thinking I was in the US when I was actually in Italy. IP geolocation relies on databases that sometimes change. Anyway, I sometimes use AdobeHDS.php but I tend to avoid it because HDS streams are a bit annoying to record. Well, in the end it seems you got it working in that way so it’s good. 🙂

  29. Hello,

    Thank you so much for your script and the tutorial. It’s working perfectly for me on mac. However I’m having issues with the quality. You said above that it downloads the best quality. Instead I’m having 540p quality when I know there’s 720p. Same for the radio, some stations have 320kbp but I’m getting 128kbp always. Am I doing something wrong, is there a setting I must activate?
    When I’m getting a radio show I also get this error mesage:

    [mp3 @ 0x7fb281817c00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 5807 >= 815

    But it still downloads the files perfectly. So I don’t understand what that’s about.

    I’m very sorry I’m new to this and I don’t know command lines very well. Thank you for your help.

  30. It may be that the quality detection fails on some videos. Could you provide the links to the specific episodes you are referring?

  31. This is the video in particular I wanted to get

    Thank you for providing a link and sorry for the late reply. Here’s what happened:

    • that video contains some streams which are declared to be 1920×1080 but they are not
    • the script was following that path, ignoring other options
    • the actual best quality of that set of streams is 960×540

    I have tweaked the script to give lower priority to the fake 1920×1080 streams. Version 3.6.2 now allows you to record that video in 1280×720 HD resolution.

    Regarding radio programmes:

    some stations have 320kbp but I’m getting 128kbp always

    MP3 conversion is enabled by default for audio-only content and the default is 128kbps I guess. This works well for voice recordings, but it might not be the best option for music. Could you share a link for a radio programme that is available in 320kbps so I can try to figure out a good compromise?

  32. Hello Andrea,
    Thank you so for your reply and for providing the update! I was able to download the video without problems and in HD resolution. You’ve made my day!

    On the mp3s, it’s not a huge deal, I’m happy your script exists in the first place. I was trying to get this among others. I was just surprised because I knew radio 3 had a higher bitrate than the other stations. They broadcast in HD at 320kbps because it’s best for classical and jazz and in the new iplayer for ios app you can download the shows and the high file size suggests higher bitrate indeed. Sadly the files are temporary and undownloadedble. It’s not a big deal but you might want to look into it. Many thanks!

  33. I have checked that page but I can’t seem to find a M3U8 stream with bitrate higher than 128kbps. One is declared as 320kbps but in reality it isn’t.

  34. That’s odd. Many thanks for having a look. Like I said it isn’t a huge deal. Thank you very much for this script!

  35. Thanks very much for the script! Works perfectly on Radio 6 with Win 7, Firefox 48.0.2, Greasemonkey 3.9 and ffmpeg N-81755-g267da70 64bit.

Che cosa ne pensi?

Inserisci i tuoi dati qui sotto o clicca su un'icona per effettuare l'accesso:


Stai commentando usando il tuo account Chiudi sessione /  Modifica )

Google+ photo

Stai commentando usando il tuo account Google+. Chiudi sessione /  Modifica )

Foto Twitter

Stai commentando usando il tuo account Twitter. Chiudi sessione /  Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione /  Modifica )


Connessione a %s...

This site uses Akismet to reduce spam. Learn how your comment data is processed.