Skip to content
notnac edited this page May 7, 2018 · 128 revisions

macOS installation

(Return to Installation ToC)

Before you begin

  • Only macOS 10.10 (Yosemite) or higher is supported
  • Only macOS system Perl is supported for use with get_iplayer. If you use perlbrew, plenv, ActivePerl, MacPorts Perl, Homebrew Perl, etc., you are responsible for configuring it correctly and installing the modules required by get_iplayer.
  • get_iplayer is also available from MacPorts and Homebrew. Those packages are NOT supported by the get_iplayer developers. Do not mix an installation from MacPorts or Homebrew with a manual installation.

Manual Installation

Xcode command line tools

The Xcode command line tools must be installed before installing any Perl Modules. From a command prompt in Terminal run:

xcode-select --install

and follow the prompts.

Perl

Perl is part of the macOS base system, so no installation is necessary. Note also that the CGI, LWP, LWP::Protocol::https (though broken), and XML::LibXML modules are already installed with the system Perl. These instructions assume you are using the system Perl on macOS 10.10+, which has sufficiently recent versions of those modules.

You will first need to create a local libary for Perl modules. You can create a local module library with cpanminus and the local::lib module. Your local library will contain just the additional Perl modules you need. The instructions below are taken from:

http://stackoverflow.com/questions/2980297/how-can-i-use-cpan-as-a-non-root-user

Run the commands below from a command prompt in Terminal.

To install cpanminus and local::lib and set up your local library in ~/perl5:

# bootstrap cpanminus and local::lib
curl -L "http://cpanmin.us" | perl - -l ~/perl5 App::cpanminus local::lib
# set configuration for current shell
eval `perl -I ~/perl5/lib/perl5 -Mlocal::lib`
# set configuration for future sessions
echo 'eval `perl -I ~/perl5/lib/perl5 -Mlocal::lib`' >> ~/.bash_profile

This example is for the bash shell. You may also prefer to initialise your environment in ~/.bashrc (for non-login shells) and source that file from ~/.bash_profile. The "eval" statement initialises environment variables necessary for local::lib to function. If you are not using bash, use the appropriate initialisation mechanism for your shell.

After your local library is set up, install the updated/additional modules required by get_iplayer:

cpanm Mozilla::CA IO::Socket::SSL Mojolicious 

The above will override the version of IO::Socket::SSL in macOS system Perl.

External programs

  1. Download a static build of AtomicParsley at:

    https://bitbucket.org/dinkypumpkin/atomicparsley/downloads/AtomicParsley-0.9.6-macos-bin.zip

  2. Download a static build of the latest release of ffmpeg from https://evermeet.cx/pub/ffmpeg.

  3. Extract the AtomicParsley and ffmpeg binaries from their respective archives into your working directory.

  4. Install the programs from a command prompt in Terminal

     sudo install -m 755 AtomicParsley ffmpeg /usr/local/bin
    

Command-line interface (CLI)

Run the commands below from a command prompt in Terminal.

  1. Download the latest release to working directory

     curl -kLO https://raw.github.com/get-iplayer/get_iplayer/master/get_iplayer
    
  2. Install get_iplayer CLI script

     sudo install -m 755 ./get_iplayer /usr/local/bin
    
  3. Run CLI

     get_iplayer [...]
    

    Upon launch, get_iplayer will update its programme index cache if necessary. If yours is a new installation, the update will take longer than usual since get_iplayer will be building a full 30-day cache.

Web PVR Manager (WPM)

NOTE: You must install the CLI (as described above) along with the WPM.

Run the commands below from a command prompt in Terminal.

  1. Download the latest release to working directory

     curl -kLO https://raw.github.com/get-iplayer/get_iplayer/master/get_iplayer.cgi
    
  2. Install get_iplayer.cgi WPM script

     sudo install -m 755 ./get_iplayer.cgi /usr/local/bin
    
  3. Launch the WPM server

     get_iplayer.cgi --listen 127.0.0.1 --port 1935
    
  4. Once the WPM server is running, connect to it by opening the URL below in your web browser:

    http://127.0.0.1:1935

  5. After the WPM has opened in your browser, select the programme types (BBC TV, BBC Radio) you wish to index, then click the Refresh Cache button. A new tab or window will open that shows the cache being refreshed. If yours is a new installation, the update will take longer than usual since get_iplayer will be building a full 30-day cache.

  6. Stop the WPM by typing Ctrl-C in the Terminal window where it is running.

WPM launcher script

You can use a shell script to launch the WPM server and your web browser together.

  1. Copy the following into a new text file named get_iplayer_web_pvr in your working directory. Adjust paths if necessary.
#!/bin/bash
# path to get_iplayer CLI
GIPCLI=/usr/local/bin/get_iplayer
# path to get_iplayer WPM server
GIPWPM=/usr/local/bin/get_iplayer.cgi
# use 0.0.0.0 to bind to all interfaces
LISTEN=127.0.0.1
# port must be higher than 1024 for unprivileged users
PORT=1935
echo "Starting Web PVR Manager (Ctrl-C to stop)..."
/usr/bin/screen -d -m /usr/bin/perl "$GIPWPM" -g "$GIPCLI" -l $LISTEN -p $PORT
echo "Waiting for Web PVR Manager to start..."
sleep 5
echo "Opening Web PVR Manager..."
open "http://$LISTEN:$PORT"
echo "Showing Web PVR Manager output..."
/usr/bin/screen -r
  1. Install the script

     sudo install -m 755 get_iplayer_web_pvr /usr/local/bin
    
  2. Launch the WPM with:

     get_iplayer_web_pvr
    
  3. The WPM server will launch in a console window and your default browser will be opened to this URL:

    http://127.0.0.1:1935

    If not, click the link above or enter the URL in your web browser.

  4. After the WPM has opened in your browser, select the programme types (e.g., BBC TV, BBC Radio) you wish to index, then click the Refresh Cache button. A new tab or window will open that shows the cache being refreshed. If yours is a new installation, the update will take longer than usual since get_iplayer will be building a full 30-day cache.

  5. Stop the WPM by typing Ctrl-C in the Terminal window where it is running.

Upgrades

Upgrade to future releases by downloading new CLI/WPM scripts and installing them (as described above) over the old versions. You may also need to install updated Perl Modules or external programs. Consult the release notes for details.

Clone this wiki locally