-
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., Debian, Ubuntu): libwww-perl liblwp-protocol-https-perl libmojolicious-perl libxml-libxml-perl
- RPM-based (e.g., Fedora, CentOS): perl-libwww-perl perl-LWP-Protocol-https perl-Mojolicious perl-XML-LibXML
- Ports-based (e.g, OpenBSD, FreeBSD): p5-libwww p5-LWP-Protocol-https p5-Mojolicious p5-XML-LibXML
- pacman-based (e.g., Arch Linux, Manjaro): perl-libwww perl-lwp-protocol-https perl-mojolicious (from AUR) perl-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., Debian, Ubuntu): libcgi-pm-perl
- RPM-based (e.g., Fedora, CentOS): perl-CGI
- Ports-based (e.g, OpenBSD, FreeBSD): p5-CGI
- pacman-based (e.g., Arch Linux, Manjaro): perl-cgi
For example, to install the packages 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
, yum install
, pkg_add
, pkg install
, pacman -S
). 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.
Some required Perl modules may not be installed with the above packages, and others such as Mojolicious may not be packaged for your distro, or may be obsolete. If so, 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. Package names in some different distros are:
- DEB-based (e.g., Debian, Ubuntu): cpanminus liblocal-lib-perl
- RPM-based (e.g., Fedora, CentOS): perl-App-cpanminus perl-local-lib
- Ports-based (e.g, OpenBSD, FreeBSD): p5-App-cpanminus p5-local-lib
- pacman-based (e.g., Arch Linux, Manjaro): perl-app-cpanminus perl-local-lib
For example, to install the packages in Debian with Perl 5.24:
apt install cpanminus liblocal-lib-perl
Replace the command above with the appropriate package names and installation command for your system (e.g., dnf install
, yum install
, pkg_add
, pkg install
, pacman -S
). If you are not logged in as root, you will need to preface installation commands with sudo
.
Once cpanminus and local::lib are installed, configure your local module library in ~/perl5:
# 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.
From: http://stackoverflow.com/questions/2980297/how-can-i-use-cpan-as-a-non-root-user
Once your local library is configured, you can install modules with cpanm Module::Name [Module::Name ...]
. Before using your local library, make sure any missing modules are not available via the system package manager.
EXAMPLE: CentOS 7
The missing Env and Time::Piece modules should be installed separately with the package manager:
yum install perl-Env perl-Time-Piece
If you are not logged in as root, you will need to preface your installation command with sudo
.
The obsolete IO::Socket::SSL module and the missing Mojolicious module must be upgraded/installed in your local library:
cpanm IO::Socket::SSL Mojolicious
NOTE: Do not preface the cpanm
command with sudo
since it is installing modules in your local library, which is inside your home directory.
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., , dnf install
, yum install
, pkg_add
, pkg install
, pacman -S
). If you are not logged in as root, you will need to preface your installation commands with sudo
.
A few distros may not have packaged versions of ffmpeg or AtomicParsley in their repositories. You may be able to acquire external programs from unofficial repositories, or see the instructions below. 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, or none at all. If your version of AtomicParsley is <0.9.4, it is recommended that you install a modern version if possible. Check the version with AtomicParsley --version
, or check version with package manager. 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://sourceforge.net/projects/get-iplayer/files/utils/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
Builds are for Linux on Intel only. No Raspberry Pi version available (use get_iplayer Raspbian repo). Does not work on Windows Subsystem for Linux.
-
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
. -
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
. -
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.
Check for updates at the following URL:
https://github.com/get-iplayer/get_iplayer/releases
Updates can also be tracked with a feed from the GitHub repository:
https://github.com/get-iplayer/get_iplayer/releases.atom
There is no need to uninstall the previous version of get_iplayer before installing a new version. You can simply download and 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.