-
Notifications
You must be signed in to change notification settings - Fork 231
unix
Perl is part of the base system for most Linux/BSD distros. If not, it will almost certainly be available in your system's package repositories.
Perl modules required by get_iplayer should be available in the package repositories for your system. However, the naming convention for packaged Perl modules differs between distros. Generally speaking, a module's namespace separator ("::") is replaced by a hyphen, a prefix (and sometimes a suffix) are added, and the name is sometimes changed to lower case. The package names for the LWP
, LWP::Protocol::https
, Mojolicious
and XML::LibXML
modules in some different distros are:
- DEB-based (e.g., Ubuntu): libwww-perl liblwp-protocol-https-perl libmojolicious-perl libxml-libxml-perl
- RPM-based (e.g., Fedora): perl-libwww-perl perl-LWP-Protocol-https perl-Mojolicious perl-XML-LibXML
- Ports-based (e.g, OpenBSD): p5-libwww p5-LWP-Protocol-https p5-Mojolicious p5-XML-LibXML
Users of Perl 5.22 and higher will also need to install the CGI
module to use the Web PVR Manager.
- DEB-based (e.g., Ubuntu): libcgi-pm-perl
- RPM-based (e.g., Fedora): perl-CGI
- Ports-based (e.g, OpenBSD): p5-CGI
For example, to install the Perl modules for get_iplayer in Arch Linux with Perl 5.24:
pacman -S perl-libwww perl-libwww-protocol-https perl-mojolicious perl-xml-libxml perl-cgi
Replace the command above with the appropriate package names and installation command for your system (e.g., apt-get install
, dnf install
, pkg install
). If you are not logged in as root, you will need to run your installation commands with sudo
.
Note that the package for LWP::Protocol::https
may be automatically installed with the package for LWP
, but that varies by distro. To be safe you should specify it separately in your install command.
If Perl modules utilised by get_iplayer are not available via the package manager for your system, it is generally unwise to employ superuser access to force additional modules into your system's Perl installation. As an alternative, you can create a local module library with cpanminus and the Perl 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
To install cpanminus and local::lib and set up your local library in ~/perl5:
curl -L "http://cpanmin.us" | perl - -l ~/perl5 App::cpanminus local::lib
eval `perl -I ~/perl5/lib/perl5 -Mlocal::lib`
echo 'eval `perl -I ~/perl5/lib/perl5 -Mlocal::lib`' >> ~/.bash_profile
NOTE: If your system does not have curl
try wget
. Replace curl -L
with wget -O-
.
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, you can install modules with cpanm Module::Name [Module::Name ...]
. For example, to install the Perl modules for get_iplayer on a platform with Perl 5.24:
cpanm LWP LWP::Protocol::https Mojolicious XML::LibXML CGI
The external programs used by get_iplayer should be available in the package repositories for your system. The package name will usually be the same as the program itself, though not always. For example, to install the external programs for get_iplayer in Arch Linux:
pacman -S atomicparsley ffmpeg
Replace the command above with the appropriate package names and installation command for your system (e.g., apt-get install
, pkg install
, dnf install
). If you are not logged in as root, you will need to preface your installation commands with sudo
.
get_iplayer uses ffmpeg to convert raw downloads to MP4/M4A files. Old Linux distros or long-term support releases do not provide a modern version of ffmpeg (3.0+) that can support all of the raw formats used. In particular, users of Debian/Raspbian 8 (jessie) and below, Ubuntu 16.04 and below, and Mint 18.x and below must install a modern version of ffmpeg (3.0+), which is not available from default repositories. However, you can install a static build of the latest ffmpeg from https://johnvansickle.com/ffmpeg. Use the commands below as a guide to install and configure a suitable version of ffmpeg for get_iplayer. Change "64bit" to "32bit" for 32-bit systems. For Raspberry Pi, change "64bit" to "armhf-32bit" or "armel-32bit" as appropriate. If you're not sure which, try "armhf-32bit" first. Before installing, check the version of ffmpeg supplied with your system with ffmpeg -version
.
wget http://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz
tar -xf ffmpeg-release-64bit-static.tar.xz
sudo install -m 755 ffmpeg-*-static/ffmpeg /usr/local/bin
get_iplayer --prefs-add --ffmpeg=/usr/local/bin/ffmpeg
These instructions should work for any Linux distro that lacks ffmpeg 3.0+ or whose version of ffmpeg is either broken or lacks features required by get_iplayer. By installing a separate static build of ffmpeg, you can support get_iplayer without interfering with your system's ffmpeg or libav packages and their dependents.
Some distros may offer multiple versions of ffmpeg. Install the most recent version available if possible. If the program executable is not named "ffmpeg" (e.g., "ffmpeg3"), use the --ffmpeg
option to configure get_iplayer to use the correct program executable.
A few distros do not have packaged versions of all the necessary external programs in their repositories. You may need to acquire external programs from unofficial repositories or - in rare instances - be required to build your own. Check your distro's repositories before installing.
NOTE: Ubuntu/Mint users should NOT install the AtomicParsley package from default repositories. Use the get-player PPA instead.
NOTE: Raspbian users should NOT install AtomicParsley from default repositories. Use the get_iplayer Raspbian repo instead.
-
Download the latest release to working directory
curl -kLO https://raw.github.com/get-iplayer/get_iplayer/master/get_iplayer
NOTE: If your system does not have
curl
trywget
. Replacecurl -kLO
withwget --no-check-certificate
. -
Install get_iplayer CLI script
install -m 755 ./get_iplayer /usr/local/bin
NOTE: If you are not logged is as root, you will need to preface your install command with
sudo
.If you don't wish to install get_iplayer in $PATH, ensure your local copy is executable:
chmod 755 ./get_iplayer
-
Run CLI at a command prompt
get_iplayer [...]
-
Download the latest release to working directory
curl -kLO https://raw.github.com/get-iplayer/get_iplayer/master/get_iplayer.cgi
NOTE: If your system does not have
curl
trywget
. Replacecurl -kLO
withwget --no-check-certificate
. -
Install get_iplayer.cgi WPM script
install -m 755 ./get_iplayer.cgi /usr/local/bin
NOTE: If you are not logged is as root, you will need to preface your install command with
sudo
.If you don't wish to install get_iplayer.cgi in $PATH, ensure your local copy is executable:
chmod 755 ./get_iplayer.cgi
-
Launch the WPM server at a command prompt
get_iplayer.cgi --listen 127.0.0.1 --port 1935
-
Once the WPM server is running, connect to it by opening http://127.0.0.1:1935 in your web browser.
-
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. -
Stop the WPM by typing Ctrl-C.