pyload raspberry

por | 10 Junio, 2017

Installing pyLoad on a Raspberry Pi with Raspbian Jessie

All credits for this guide go to eNBeWe. Thanks, mate!

In the following I assume that you are running a Raspberry Pi with a recent version of Raspbian. At the point of writing this means you are running some version of Debian Jessie.

First we are going to create a system user for running pyload.

sudo adduser --system pyload

Next we are installing some dependencies for pyLoad. First make sure that you have the following two lines in your /etc/apt/sources.list

deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi
deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi

Then we update our package list and install the dependencies.

sudo apt-get update
sudo apt-get -y install git liblept4 python python-crypto python-pycurl python-imaging tesseract-ocr zip unzip python-openssl libmozjs-24-bin
sudo apt-get -y build-dep rar unrar-nonfree
sudo apt-get source -b unrar-nonfree
sudo dpkg -i unrar_*_armhf.deb
sudo rm -rf unrar-*

Please notice the list of packages that are installed here. Most guides are installing rhino instead of libmozjs here. Both of these packages are JavaScript environments. The difference between rhino and libmozjs is the language they are implemented in. While rhino is implemented in Java libmozjs is using c++. For this reason you need the whole Java execution environment on your system if you want to use rhino. I don’t think it is reasonable to install a complete java runtime on a server that should be running a python program. So I think the C++ implementation is superior in this point.

To get libmozjs running with pyLoad we need to create a symlink.

cd /usr/bin
ln -s js24 js

Now we can download the current version of pyLoad and install that. We are using the current git version which is usually a bit newer that the latest release.

cd /opt
sudo git clone -b stable https://github.com/pyload/pyload.git
cd pyload
sudo -u pyload python pyLoadCore.py

The last line should start the configuration wizard of pyload and create an initial setup. Just follow the on-screen instructions. If everything went well you should have a running pyLoad instance.

If you want to start pyload at every reboot you can create a systemd service file for that. Just create a new file

sudo nano /etc/systemd/system/pyload.service

and dump the following code in there.

[Unit]
Description=Python Downloader
After=network.target

[Service]
User=pyload
ExecStart=/usr/bin/python /opt/pyload/pyLoadCore.py

[Install]
WantedBy=multi-user.target

Now we need to activate this rule with systemd.

sudo systemctl enable pyload.service

After a reboot this should automatically be executed and you can see the status of the service with

sudo systemctl status pyload