Vor einigen Tagen wurde ich von einem begeisterten NAS-Nutzer gefragt, ob man nicht PyLoad  auch auf den Geräten installieren könne. Ich kannte PyLoad nicht, daher habe ich mir den Downloadmanager mal näher angesehen:

pyLoad ist ein schneller, leicht gewichtiger und funktionsreicher Download Manager für viele One-Click-Hoster, Container Formate wie DLC, Video Sites oder simple HTTP- oder FTP-Links.

Das in Python geschriebene Programm bietet für die Interaktion mit dem Nutzer ein Webinterface, GUI-Programme und einen Kommandozeilenclient. Das beste ist aber, dass ein Daemon auf dem NAS laufen kann, der über das ebenfalls auf dem NAS laufende Webinterface oder über die GUI auf einem auf der angeschlossenen Rechner gesteuert werden kann.

Installiere zunächst fun_plug und Optware nach meinen Anweisungen. Anschließend müssen die folgenden Pakete installiert werden:

1
ipkg install python py25-crypto py25-curl libcurl py25-openssl py25-django tesseract-ocr tesseract-ocr-lang-eng unzip sqlite wget-ssl py25-pil unrar ossp-js

Sollten bei einem der nachfolgenden Befehle seltsame Python-Fehler auftreten, sollte man das NAS einmal durchstarten und nochmal den Befehl nach dem Reboot ausführen. Nach diesem einmaligen Reboot traten diese Fehler nicht mehr auf, ich vermute, da hatten die Umgebungsvariablen nicht so ganz gestimmt.

Gehe in /opt und lade das Programm herunter:

1
2
3
4
cd /opt/
wget http://get.pyload.org/get/src/
unzip pyload-src*.zip
rm pyload-src-*.zip

Zunächst muss das Konfigurationsverzeichnis auf /opt/pyload/.pyload geändert werden, da es sonst zu Fehlern im Webserver kommen kann:

1
2
cd /opt/pyload/
python pyLoadCore.py --changedir --configdir=/opt/pyload/.pyload

Drücke einmal Enter um /opt/pyload/.pyload zu bestätigen. Drücke dann nochmals Enter um den Dialog zu verlassen. Die Ausgaben sehen dabei so aus, ich habe das drücken von Enter mittels {ENTER} markiert:

Setting new configpath, current configuration will not be transfered! Configpath [/opt/pyload/.pyload]:{ENTER} Configpath changed, setup will now close, please restart to go on. Press Enter to exit.{ENTER}

Nun gehts an den Installationsprozess:

1
python pyLoadCore.py -s

Dieser fragt dich jede Menge Fragen, ich habe unten mal meine Ausgaben dargestellt. Auf dem DNS-323/CH3SNAS muss laut Webseitenkommentar der Webservertyp auf “threaded” umgestellt werden, ansonsten funktioniert das Webinterface nicht. Als Download-Ordner habe ich /mnt/HD/HD_a2/Downloads/ gewählt, das ist natürlich anpassbar. Jedes Mal wenn ich Enter gedruckt habe, habe ich unten “{ENTER}” eingefügt. Alle anderen Eingaben sind fett markiert:

Choose your Language / Wähle deine Sprache ([en], de, fr, it, es, nl, sv, ru, pl, cs, pt_BR):

Welcome to the pyLoad Configuration Assistent. It will check your system and make a basic setup in order to run pyLoad.

The value in brackets [] always is the default value, in case you don’t want to change it or you are unsure what to choose, just hit enter. Don’t forget: You can always rerun this assistent with –setup or -s parameter, when you start pyLoadCore. If you have any problems with this assistent hit STRG-C, to abort and don’t let him start with pyLoadCore automatically anymore.

When you are ready for system check, hit enter. {ENTER}

System Check

Python Version: OK pycurl: OK sqlite3: OK

pycrypto: OK py-OpenSSL: OK

py-imaging: OK tesseract: OK

PyQt4: missing

jinja2: OK beaker: OK JS engine: OK

System check finished, hit enter to see your status report.

Status

Features available: container decrypting, ssl connection, automatic captcha decryption, Webinterface, extended Click’N’Load

Continue with setup? ([y]/n): {ENTER}

Do you want to change the config path? Current is /opt/pyload/.pyload If you use pyLoad on a server or the home partition lives on an iternal flash it may be a good idea to change it. Change config path? (y/[n]): {ENTER}

Do you want to configure login data and basic settings? This is recommend for first run. Make basic setup? ([y]/n): {ENTER}

Basic Setup

The following logindata is valid for CLI, GUI and webinterface. Username [User]: MEINNUTZER {ENTER} Password: MEINPASSWORT {ENTER} Password (again): MEINPASSWORT {ENTER}

Language ([en], de, fr, it, es, nl, sv, ru, pl, cs, pt_BR): Downloadfolder [Downloads]: /opt/pyload/downloads/ {ENTER} Max parallel downloads [3]: {ENTER} Use Reconnect? (y/[n]): {ENTER}

Do you want to configure ssl? Configure ssl? (y/[n]): {ENTER}

Do you want to configure webinterface? Configure webinterface? ([y]/n): {ENTER}

Webinterface Setup

Activate webinterface? ([y]/n): {ENTER}

Listen address, if you use 127.0.0.1 or localhost, the webinterface will only accessible locally. Address [0.0.0.0]:{ENTER} Port [8000]:{ENTER}

pyLoad offers several server backends, now following a short explanation. builtin: Default server, best choice if you dont know which one to choose. threaded: This server offers SSL and is a good alternative to builtin. fastcgi: Can be used by apache, lighttpd, requires you to configure them, which is not too easy job. lightweight: Very fast alternative written in C, requires libev and linux knowlegde. Get it from here: https://github.com/jonashaag/bjoern , compile it and copy bjoern.so to module/lib

Attention: In some rare cases the builtin server is not working, if you notice problems with the webinterface come back here and change the builtin server to the threaded one here. Server ([builtin], threaded, fastcgi, lightweight):{ENTER}

Setup finished successfully. Hit enter to exit and restart pyLoad {ENTER}

Nun lade noch das Start-Script für PyLoad herunter:

1
2
3
mkdir -p /opt/etc/init.d/
wget http://wolf-u.li/u/236/ -O /opt/etc/init.d/S95startPyload.sh
chmod +x /opt/etc/init.d/S95startPyload.sh

Starten kannst du Pyload nun so:

1
/opt/etc/init.d/S95startPyload.sh start

Die Kommandos “status” und “restart” funktionieren ebenfalls Stoppen kann man PyLoad natürlich auch wieder:

1
/opt/etc/init.d/S95startPyload.sh stop

Viel Spaß mit PyLoad!

Für das Update auf neuere Versionen gibt es hier einen Artikel, der Android-Client für pyLoad ist hier kurz vorgestellt.