-
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 Debian with Perl 5.24:
apt install libwww-perl liblwp-protocol-https-perl libmojolicious-perl libxml-libxml-perl libcgi-pm-perl
Replace the command above with the appropriate package names and installation command for your system (e.g., 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:
# bootstrap cpanminus and local::lib
wget -O- "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, 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 Debian:
apt install atomicparsley ffmpeg
Replace the command above with the appropriate package names and installation command for your system (e.g., pacman -S
, pkg install
, dnf install
). If you are not logged in as root, you will need to preface your installation commands with sudo
.
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: 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.
NOTE: Users of Ubuntu/Mint versions before 18.04/19 should NOT install ffmpeg or AtomicParsley from default repositories. Use the get-player PPA or the instructions below instead.
NOTE: Raspbian users should NOT install ffmpeg or AtomicParsley from default repositories. Use the get_iplayer Raspbian repo instead.
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.
get_iplayer uses AtomicParsley to add metadata tags to downloaded media files, but some distros only provide an outdated version. If your version of AtomicParsley is <0.94, it is recommended that you install a modern version if possible. Check the version with AtomicParsley --version
. Use the commands below as a guide to install and configure a suitable version of ffmpeg for get_iplayer. Change "64" to "32" for 32-bit systems.
wget https://bitbucket.org/dinkypumpkin/atomicparsley/downloads/AtomicParsley-0.9.6-linux64-bin.zip
unzip AtomicParsley-0.9.6-linux64-bin.zip AtomicParsley
sudo install -m 755 AtomicParsley /usr/local/bin
get_iplayer --prefs-add --atomicparsley=/usr/local/bin/AtomicParsley
-
Download the latest release to working directory
wget https://raw.githubusercontent.com/get-iplayer/get_iplayer/master/get_iplayer
-
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 [...]
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.
-
Download the latest release to working directory
wget https://raw.githubusercontent.com/get-iplayer/get_iplayer/master/get_iplayer.cgi
-
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. If yours is a new installation, the update will take longer than usual since get_iplayer will be building a full 30-day cache. -
Stop the WPM by typing Ctrl-C.
There is generally no need to uninstall the previous version of get_iplayer before installing a new version. You can simply install get_iplayer over the previous version. However, if you prefer to uninstall and re-install, that should work as well. The system package manager will handle upgrades to any packaged dependencies.