Medusa is an Automatic Video Library Manager for TV Shows. It watches for new episodes of your favorite shows, and when they are posted it does its magic. It is mainly written in Python and javascript, and is very easy to install :
We're going to install Medusa on a debian10 CT on proxmox:
Then start the CT and ssh into it:
[ 10.0.0.10/16 ] [ /dev/pts/19 ] [Github/blog/servers]
→ ssh root@10.0.0.173
The authenticity of host '10.0.0.173 (10.0.0.173)' can't be established.
ED25519 key fingerprint is SHA256:inPSVYTAXYA1JprBpkjIowAOmlo1EH5Wvpakh+K3cEI.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '10.0.0.173' (ED25519) to the list of known hosts.
Linux medusa 5.4.106-1-pve #1 SMP PVE 5.4.106-1 (Fri, 19 Mar 2021 11:08:47 +0100) x86_64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
root@medusa:~# id
uid=0(root) gid=0(root) groups=0(root)
Then install the required dependencies:
root@medusa:~# apt update -y ; apt upgrade -y ; apt install vim -y
root@medusa:~# apt install git-core openssl mediainfo -y
once that's done, create the medusa user:
root@medusa:~# addgroup --system medusa
Adding group `medusa' (GID 115) ...
Done.
root@medusa:~# adduser --disabled-password --system --home /var/lib/medusa --gecos "Medusa" --ingroup medusa medusa
Adding system user `medusa' (UID 107) ...
Adding new user `medusa' (UID 107) with group `medusa' ...
Creating home directory `/var/lib/medusa' ...
root@medusa:~#
root@medusa:~# mkdir /opt/medusa ; chown medusa:medusa /opt/medusa
root@medusa:~# git clone https://github.com/pymedusa/Medusa.git /opt/medusa
Cloning into '/opt/medusa'...
remote: Enumerating objects: 133130, done.
remote: Counting objects: 100% (617/617), done.
remote: Compressing objects: 100% (357/357), done.
remote: Total 133130 (delta 327), reused 426 (delta 218), pack-reused 132513
Receiving objects: 100% (133130/133130), 170.29 MiB | 3.28 MiB/s, done.
Resolving deltas: 100% (91973/91973), done.
Checking out files: 100% (7276/7276), done.
root@medusa:~# mkdir /opt/medusa/media/
root@medusa:~# chown -R medusa:medusa /opt/medusa
Once that's done, create the systemd service file to launch medusa:
root@medusa:~# cp -v /opt/medusa/runscripts/init.systemd /etc/systemd/system/medusa.service
'/opt/medusa/runscripts/init.systemd' -> '/etc/systemd/system/medusa.service'
root@medusa:~# chown root:root /etc/systemd/system/medusa.service
root@medusa:~# chmod 644 /etc/systemd/system/medusa.service
root@medusa:~# systemctl enable --now medusa
Created symlink /etc/systemd/system/multi-user.target.wants/medusa.service -> /etc/systemd/system/medusa.service.
root@medusa:~# systemctl status medusa
* medusa.service - Medusa Daemon
Loaded: loaded (/etc/systemd/system/medusa.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2021-04-17 09:29:28 UTC; 5s ago
Main PID: 9891 (python3)
Tasks: 1 (limit: 7372)
Memory: 70.4M
CGroup: /system.slice/medusa.service
`-9891 /usr/bin/python3 /opt/medusa/start.py -q --nolaunch --datadir=/opt/medusa
Apr 17 09:29:28 medusa systemd[1]: Started Medusa Daemon.
root@medusa:~#
Once that's done, the service is started, and we can view our medusa instance on port 8081:
Once you've selected the show to add, select where to store the files (i chose the /opt/medusa/media/) folder because i know the medusa user can access it.
next we're going to leave the options as default except for the quality set to 'Any':
Now by default medusa comes with no providers enabled, so let's go and select at least 2 of them:
Once selected, hit 'Save' at the bottom of the page, and return to your shows page:
Select a season, and change it's status to 'Wanted':
So here you can see that it managed to 'Snatch' the episodes we selected:
Now from here medusa's job is done, it basically downloaded the .torrent files, but it still needs to send them somewhere:
Now we know the .torrent files will be located at /opt/medusa/media:
Here you can see what medusa is doing, it is saving the .torrent files in the /opt/medusa/media/ folder as it snatches them, not it's basically time to setup rtorrent to automatically recursively download what arrives in that directory.
For the torrenting itself, you can use any torrent client you want. Since we're in a ssh connection we're going to use rtorrent:
root@medusa:/opt/medusa# apt search rtorrent
Sorting... Done
Full Text Search... Done
rtorrent/stable 0.9.7-1 amd64
ncurses BitTorrent client based on LibTorrent from rakshasa
root@medusa:/opt/medusa# apt install rtorrent -y
before launching it, edit the ~/.rtorrent.rc file:
Some Address 67120,
Duttlenheim, France.
This cute theme was created to showcase your work in a simple way. Use it wisely.