Table of Contents

Install jDownloader 2 in LXC contaner

Requirements:

This know how isn't recommend to use for Turris 1.x, because jDownloader heavily use CPU and instead of it it's better to use pyLoad

Introduction

In the beginning I will tell you what is jDownloader and it's usage.

jDowloader is useful tool for downloading files from many servers.

It's developed in Java language, which means it is multi-platform thing. It can download many files at one time and from different servers. It can also download tracks and videos from YouTube. Sometimes it can recognize captcha itself, but if it isn't successful it will request to you to fill it manually. Also you can setup file extraction, when it downloaded archive(s). You can limit your download speed and also set download time. If you don't run jDownloader headless, you can download some skins for it and even you can setup after succesfully download that it will turn off computer.

In this article I will show you, how to install jDownloader 2. I used Debian container, but that's up to you.

Installation

You need to create folder: “jdownloader”, which should be created in folder /home

cd /home
mkdir jdownloader

Now you will enter our created folder jdownloader

cd jdownloader

In SSH client you should see this output:

root@debian:/home/jdownloader#

It means you're in and you can download jDownloader.

wget http://installer.jdownloader.org/JDownloader.jar

After download you're gonna run jDownloader in headless mode, because Turris doesn't have graphical output.

java -Djava.awt.headless=true -jar JDownloader.jar

jDownloader checks if it is updated and if it isn't it would start download updates and after it it will automatically install them. This process can take around 20 minutes.

In the meantime you need to create account on this website: MyJdownloader

After jDownloader installed all of updates it will tell you that jDownloader was restarted by itself and it's running in background.

 Self Update successful
|---------------------------Headless Information-------------------------------
|       Restart Required
|       JDownloader Updated and restarted itself.
|       The process restarted itself and runs now in the background: 288@localhost
|       If you do not want JD to restart itself, use the -norestart switch.
|------------------------------------------------------------------------------

It is necessary to kill/terminate jDownloader for example through htop (task manager on Unix) and we will again start jDownloader manually.

java -Djava.awt.headless=true -jar JDownloader.jar

This process is gonna take again around 20 minutes and after it will verify all updates it will say this:

|---------------------------Headless Information-------------------------------
|       MyJDownloader Setup
|       Your 'My JDownloader' logins are not correct.
|       Please check username/email and password!
|       Enter y -> Enter Logins
|       Enter n -> Exit JDownloader

Now you will need credentials from site, where you registered and to put credentials you need to press keyboard Y' and after it send it to jDownloader by pressing ENTER'. After it you will put there email and also press ENTER and then put there your password and press ENTER

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.

After you put there correct credentials you could see your jDownloader on this page: https://my.jdownloader.org po

Automatic start at startup LXC container

For Unix based system, which used systemd as Debian or ArchLinuxARM you can use this script, but if you changed path, where did you install jdownloader then you will need edit this script.

wget https://gist.githubusercontent.com/BKPepe/ed8b9cde3675e48642dc55a8e81d5985/raw/dd753c0843c0d113951b639b3e91da1c10f16f85/jd.sh -O /etc/init.d/jdownloader
chmod +x /etc/init.d/jdownloader

And now we will reload daemon

systemctl daemon-reload

After that we can look, if you can start jDownloader through service

service jdownloader start

and with this command, you can find if it is running

service jdownloader status

If you have this output:

root@debian:~# service jdownloader status
● jdownloader.service - LSB: JDownloader2 server daemon
   Loaded: loaded (/etc/init.d/jdownloader; generated; vendor preset: enabled)
   Active: active (running) since Wed 2017-06-21 21:34:20 UTC; 3s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 2177 ExecStart=/etc/init.d/jdownloader start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/jdownloader.service
           └─2180 /usr/bin/java -Djava.awt.headless=true -jar /root/jdownloader/JDownloader.jar

Jun 21 21:34:20 debian1 systemd[1]: Starting LSB: JDownloader2 server daemon...
Jun 21 21:34:20 debian1 jdownloader[2177]: Start JDownloader
Jun 21 21:34:20 debian1 systemd[1]: Started LSB: JDownloader2 server daemon.

Then everything is OK. Last one command for automatic start after startup LXC container.

sudo systemctl enable jdownloader.service

It's done! Congrats!