Download “NPO Radio 2 – Top 2000” in mp3 format

In a marathon program from Christmas to New Year’s eve NPO Radio 2 broadcasts the so called “Top 2000“. A list of the 2000 most popular songs of all time. Because I’m not able to listen all 2000 songs in one go, I like to have them on a USB drive in MP3 format, so that I’m able to listen for example in my car.

The shell script below downloads the full “Top 2000” of 2018 in MP3 format from the official website. 80 MP3 files, ~12GB in size.

set -e

for i in $(seq 25 31); do
    curl -s$i-12-$year | grep '/gemist/uitzending' | cut -d'"' -f 2 | xargs -i echo "{}" | tac >> pages

for p in $(cat pages); do
    curl -s $p | grep mp3 | cut -d '"' -f 2 >> mp3
# optional: remove the 1st 4 items (00:00-02:00, 02:00-04:00, 04:00-06:00, 06:00-08:00)
#tail -n +5 mp3 | sponge mp3

for m in $(cat mp3); do
    curl -OL $m

6 thoughts on “Download “NPO Radio 2 – Top 2000” in mp3 format

  1. Eric

    Hi There,

    were do i copy the script?! Im not that smart. Thanks!! And thank you for your help!

  2. Arjen

    The -i option for xargs is deprecated and doesn’t work on a Mac for example. Replacing this with -I{} is equivalent.
    To make this work in terminal on a Mac, I had to replace “tac” with “tail -r” and install sponge using “brew install moreutils”

  3. Fedo

    to use this on a linux must I have a sh-file or can I copy the shell script and ?
    I am new on Linux 🙂


  4. pommi Post author

    @Fedo It’s best when you copy the script into a file and execute it from the file.

  5. Arjen

    The script still works for the 2020 version of the top 2000. Unfortunately, it sometimes only downloads 154 bytes instead of the full hour. I don’t know if this is a Mac issue, but I managed to work around it by retrying the download until the size is larger than a couple of kilobytes. If anyone is interested in the script drop me a line at _arjen_ at _blackbeemedia_ dot _com_ (without the underscores)

Leave a Reply

Your email address will not be published.