User Tools

Site Tools

This documentation is no longer maintained by the Turris team (although it can be used by the community to share content). The current official documentation is at docs.turris.cz.

Install pyLoad in LXC container

In the beginning I will tell you what is pyLoad and for what you can use it.

pyLoad is open-source download manager from file hosting services like Mega.nz and MediaFire.com It has so many useful features like: SSL, premium accounts, captcha recognition, unrar, checksum (CRC) and you can even set, when you want to download

If you remember, that it sounds similar and you know very similar tool, which is jDownloader, that's good. You can choice what you want and it is possible that jDownloader will be too heavy to use it on Turris, but you can try it to install jDownloader 2 in LXC container

From your computer, tablet or mobile you can login to web interface.

It is also possible that you can find Android app or GUI for desktop, but both are no longer in active development. It's known that it is working on completely rewrite and there should be finally new design for web interface, but currently there is no ETA, but it is almost finished - 60%.

And before you will start it's good to know why we're going to install pyLoad in in LXC container

Requirements:

  • SSH client (Windows: PuTTY | Linux: terminal)
  • have at least 250 GB free space on your HDD
  • have LXC container ( Turris 1.x or Omnia )

Now I will show you how to install pyLoad.

Dependencies

Before installing PyLoad you will need dependencies and after it you can install pyLoad

Turris 1.x

apt-get install git python-pycurl python-crypto tesseract-ocr python-openssl python-imaging python-qt4 rhino python-passlib

Omnia

apt-get install git python-pycurl python-crypto tesseract-ocr python-openssl python-imaging python-qt4 rhino python-passlib

Downloading pyLoad

Before we can download pyLoad from GitHub you will need to login to SSH to your's router.

After success connection to SSH you need to write this commands to download pyLoad from GitHub.

git clone https://github.com/pyload/pyload.git
cd pyload
git checkout stable

Now we successfully downloaded source code and we can install it.

Install pyLoad and installation wizard

The easiest way how to install pyLoad is because install wizard, which help you very much.

python pyLoadCore.py

Now we choose which language do we want for installation wizard.

Every choice you need to confirm by key enter

For English you should write: en and confirm it. Installation wizard will ask you if you want check all necessary modules for full use pyLoad.

It should look like this output:

## System check ##
Verze Pythonu: OK
pycurl: OK
sqlite3: OK

pycrypto: OK
py-OpenSSL: OK

py-imaging: OK
tesseract: OK

PyQt4: OK

jinja2: OK
beaker: OK
jadro JS: OK

If checking was successful, then you can continue with installation. If it wasn't successful, you need to contact author of this article - contact is in the bottom.

Now it is going to check functions, which are available.

## Status ##

Dostupne funkce: dekodovani kontejneru, pripojeni ssl, automaticke rozpoznavani captchy, GUI, Webove rozhrani, rozsirene Click'N'Load

Pokracovat v instalaci? ([y]/n):

If you want to continue then you need to write y and confirm it by enter

Wizard ask you if you want you want to use default installation path, which is: /root/.pyload

If you want to use default path, it's ok. Skip next paragraph.

If you don't, you can edit to by yourself and press enter and installation wizard are gonna exit itself and you will need to start once again installation wizard through:

python pyLoadCore.py

Follow the instructions in the wizard to point. Don't forget to create for the first time default settings for web interface.

When you're filling password, so they're not shown, but they are there. Don't use weak or default passwords like 12345 or admin.

During install wizard it will ask you if you're gonna use desktop client or app in your phone. As I told you earlier they're not in active development, so it's good to disable it, because it will save you some space in RAM and also enable SSL (encrypted connection) - you never know, when somebody listen to yours communication!

When you successfully pass the installation wizard. Let's move to install SSL certificate

SSL certification

In default configuration path of pyLoad if you didnt change the path during installation it is located in /root/.pyload

If you don't know, how to go to this folder you can use this command:

cd /root/.pyload

Now each by one copy&paste to terminal through CTRL + C (copy) and CTRL + V (paste)

openssl genrsa -out ssl.key 1024
openssl req -new -key ssl.key -out ssl.csr

Now you will need fill few informations for SSL certificate and if you don't want fill them, it's ok. Just press 9 times ENTER

Country Name (2 letter code) [AU]:
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []: 
Email Address []:

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:pyload
An optional company name []:

and then

openssl req -days 36500 -x509 -key ssl.key -in ssl.csr > ssl.crt

After you will start pyLoad (as I will show you next) you need to go to the webinterface of pyLoad and enable SSL.

How to start pyLoad:

Now you will switch from configuration (hidden) folder pyload, where you have downloaded pyLoad. That's should be in /root/pyload

cd /root/pyload

Before you will setup automatic startup at boot, you will need to check it manually if everything is OK.

python pyLoadCore.py

If you have this output:

29.03.2017 18:07:11 INFO      Spoustim pyLoad 0.4.9
29.03.2017 18:07:11 INFO      Nastaven domovsky adresar: /root/.pyload
29.03.2017 18:07:13 INFO      Aktivovane pluginy: ClickNLoad, EventMapper, ExternalScripts, ExtractArchive, MergeFiles, UnSkipOnFail, UpdateManager, UserAgentSwitcher, XFileSharing
29.03.2017 18:07:13 INFO      Deaktivovat pluginy: AndroidPhoneNotify, AntiStandby, AntiVirus, BypassCaptcha, Captcha9Kw, CaptchaBrotherhood, Checksum, CloudFlareDdos, DeathByCaptcha, DeleteFinished, DownloadScheduler, ExpertDecoders, HotFolder, IRC, ImageTyperz, JustPremium, LinkFilter, LinkdecrypterComHook, LogMarker, MultiHome, PushBullet, PushOver, RestartFailed, SkipRev, TransmissionRPC, WindowsPhoneNotify, XMPP
29.03.2017 18:07:13 INFO      Cas stahovani: True
29.03.2017 18:07:13 INFO      Zahajuji ThriftBackend: 0.0.0.0:7227
29.03.2017 18:07:13 INFO      Volne misto: 64.58 GiB
29.03.2017 18:07:14 INFO      Aktivuji Ucty...
29.03.2017 18:07:14 INFO      Aktivuji Pluginy...
29.03.2017 18:07:16 INFO      Starting threaded webserver: 0.0.0.0:8000
29.03.2017 18:07:16 INFO      ADDON UpdateManager: pyLoad is up to date!
29.03.2017 18:07:17 INFO      ADDON XFileSharing: Auto-discover new hosters
29.03.2017 18:07:17 INFO      ADDON XFileSharing: Auto-discover new crypters
29.03.2017 18:07:17 INFO      pyLoad is up and running
29.03.2017 18:07:18 INFO      ADDON UpdateManager: All plugins are up to date!
29.03.2017 18:07:19 INFO      ADDON ClickNLoad: Proxy listening on 0.0.0.0:9666

It means everything is setup correctly. Because it is running in our session and when you will close PuTTY then it will also terminates pyLoad. You can terminate pyLoad using shortcuts CTRL + C

If you want to run it on background you can use this, but it's better to go to step, because this command won't start it on boot.

python pyLoadCore.py --daemon

If you want to terminate pyLoad, which runs on background you can terminate it with command:

python pyLoadCore.py -q

By default you can see web interface on this address: http://192.168.1.10:8000 (non-encrypted)

Enable HTTPS (SSL)

How to enable HTTPS?

You will need to go to webinterface and click there to Config

In GeneralSSL browse for SSL certificate (file: ssl.crt) and browse for SSL key (file: ssl.key) and click to Submit Now go to Webinterface and enable HTTPS.

Now you will need to restart pyLoad. So right now you can access pyLoad only on this address
https://192.168.1.10:8000

Don't forget to fill captcha, when file hosting requires. pyLoad shows this warning:

Automatic startup during startup of LXC container

For Linux system, which use systemd for example as Debian and ArchLinux you can use this script, but if you changed path, where is pyload (not configuration folder, which is hidden) then you would need to edit this script.

It's not good to run almost every app with root privileges!

wget https://github.com/BKPepe/scripty-turris/blob/master/pyload.service -O /etc/systemd/system/pyload.service
chmod +x /etc/systemd/system/pyload.service

First at all you will need to try to start pyLoad

service pyload start

and then you will verify if it is running and if it is OK.

service pyload status

If you see this this output, then everything is OK and in the next step I will show you how to enable automatic startup after you will enable LXC container or after boot of Turris.

root@debian:~# service pyload status
● pyload.service - Downloadtool for One-Click-Hoster written in python.
   Loaded: loaded (/etc/systemd/system/pyload.service; disabled)
   Active: active (running) since Sat 2017-06-03 18:56:30 CEST; 3s ago
 Main PID: 6253 (python)
   CGroup: /system.slice/pyload.service
           └─6253 python /home/pepe/pyload/pyLoadCore.py

Jun 03 18:56:30 Debian-NAS systemd[1]: Started Downloadtool for One-Click-Hoster written in python..
Jun 03 18:56:31 Debian-NAS pyLoadCore.py[6253]: 03.06.2017 18:56:31 INFO      Starting pyLoad 0.4.9
Jun 03 18:56:31 Debian-NAS pyLoadCore.py[6253]: 03.06.2017 18:56:31 INFO      Using home directory: /home/pepe/.pyload
Jun 03 18:56:32 Debian-NAS pyLoadCore.py[6253]: 03.06.2017 18:56:32 INFO      Activated plugins: ClickNLoad, EventMapper, ExternalScripts, ExtractArchive, MergeFiles, UnSkipOnFail, UpdateManager, UserAgentSwitcher, XFileSharing
Jun 03 18:56:32 Debian-NAS pyLoadCore.py[6253]: 03.06.2017 18:56:32 INFO      Deactivate plugins: AndroidPhoneNotify, AntiStandby, AntiVirus, BypassCaptcha, Captcha9Kw, CaptchaBrotherhood, Checksum, CloudFlareDdos, DeathByCaptcha, Del...
Jun 03 18:56:32 Debian-NAS pyLoadCore.py[6253]: 03.06.2017 18:56:32 INFO      Downloadtime: True
Jun 03 18:56:33 Debian-NAS pyLoadCore.py[6253]: 03.06.2017 18:56:33 INFO      Starting builtin webserver: 0.0.0.0:8000
Jun 03 18:56:33 Debian-NAS pyLoadCore.py[6253]: 03.06.2017 18:56:33 INFO      Free space: 1.69 TiB
Jun 03 18:56:33 Debian-NAS pyLoadCore.py[6253]: 03.06.2017 18:56:33 INFO      Activating Accounts...
Jun 03 18:56:33 Debian-NAS pyLoadCore.py[6253]: 03.06.2017 18:56:33 INFO      Activating Plugins...
Hint: Some lines were ellipsized, use -l to show in full.

If you see different output, then you will need to edit path in script pyload.service, which is in path /etc/systemd/system/

This is how to start pyLoad after starting up LXC container

sudo systemctl enable pyload.service

Installation is done! Congrats! ;-)

Modifications

Themes

PyPlex

How to install it and how it looks you can find here: https://github.com/xunil75/PyPlex

How to remove pyLoad

If you'd decide to uninstall pyLoad, you will need to remove two folders: pyload and hidden configuration folder .pyload

Author of this article: Josef Schlehofer
You can contact him directly by PM on forum or feel free to create thread on our Turris forum.