Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

[How to] install subliminal

Osiris

FreeNAS Experienced
Joined
Aug 15, 2013
Messages
149
Install subliminal in a FreeNas jail (or in freebsd)
Updated 2015-04-07

Hi guys, my 2 cents on this old question, since I've been searching the net for a lazy-tutorial without success.
I'm using this package https://github.com/Diaoul/subliminal and all credit goes to the devs.

My sabnzbd downloads all arrive on a network share named 'download' and are extracted to a subfolder herein named 'complete'.
This share is added as storage to the subliminal jail.
In fact, any share with movie files that can be added to the jail will do.


1. The jail.
  • create a standard jail, preferably enable ssh & login (or access the jail shell via freenas gui)
    so set ssh_enable to "YES" in /etc/rc.conf (and perhaps enable root login in /etc/ssh/sshd_config)
  • update portsnap
portsnap fetch extract
  • link folders with movies/series to the jail.
    Start by creating the folder, for example 'download'
mkdir /mnt/download
chown nobody:nogroup /mnt/download
chmod 777 /mnt/download
  • Add storage via the freenas gui: attach the share where sabnzbd downloads arrive to /mnt/download.
upload_2015-4-7_15-48-13.png

upload_2015-4-7_15-47-59.png


upload_2015-4-7_15-49-16.png

2. The Package
Get the package to the jail
  • I did NOT use the port to install subliminal directly, I deinstalled it again.
    U might still try
cd /usr/ports/multimedia/py-subliminal && make install clean BATCH=yes
I encountered several errors in this version, simply too many to handle.
Perhaps in the future, this will be updated.​
  • Lets add wget functionality to the jail. It is possible that you need to do pkg upgrade first, so
cd /usr/ports/ports-mgmt/pkg && make deinstall clean
cd /usr/ports/ports-mgmt/pkg && make install clean BATCH=yes
pkg2ng
cd /usr/ports/ftp/wget && make install clean BATCH=yes
cd ~

Another option is to use curl, but this gave me problems.
Just make sure you have an option to get the package file to the system.
The cleanest might be to scp the file.​
  • Pull the file.
Option A : Pull the latest stable release package either from python or github
wget https://pypi.python.org/packages/source/s/subliminal/subliminal-0.7.4.tar.gz --no-check-certificate
tar -xvf subliminal-0.7.4.tar.gz
mv subliminal-0.7.4 /usr/share/
mv /usr/share/subliminal-0.7.4 /usr/share/subliminal

Option B : Better yet, be a betatester & grab the dev master branch. This gave me the 0.8-dev version (2014-10-16).

wget https://github.com/Diaoul/subliminal/archive/master.zip --no-check-certificate
(or with curl : curl -L https://github.com/Diaoul/subliminal/archive/master.zip )

tar -xvf master.zip
mv subliminal-master /usr/share/
mv /usr/share/subliminal-master /usr/share/subliminal
  • Optional, open up this folder for usage & execution
chown -R nobody:nogroup /usr/share/subliminal
chmod -R 777 /usr/share/subliminal

3. Dependencies
Install dependencies. Might be that the setup does this, but I did so manually
  • Beautifulsoup
    cd /usr/ports/www/py-beautifulsoup/ && make install clean BATCH=yes
  • Guessit
    cd /usr/ports/multimedia/py-guessit && make install clean BATCH=yes
    This will get you guessit 8.0.
    I've tried newer versions of guessit (up to 9.4dev) but this will only result in errors, subs not found, etc...
  • Requests
    cd /usr/ports/www/py-requests && make install clean BATCH=yes
  • Enzyme
    cd /usr/ports/multimedia/py-enzyme && make install clean BATCH=yes
  • HTML5
    cd /usr/ports/www/py-html5lib && make install clean BATCH=yes

  • Dogpyle
    cd /usr/ports/devel/py-dogpile.cache && make install clean BATCH=yes

  • Babelfish
    cd /usr/ports/devel/py-babelfish && make install clean BATCH=yes
  • Charade
    cd /usr/ports/textproc/py-charade && make install clean BATCH=yes

    The Charade port no longer worked due to a broken ports package, but neither was it necessary.
    It seems to get autoinstalled properly.
  • PySrt
    cd /usr/ports/textproc/py-pysrt && make install clean BATCH=yes
3b. Setuptools
It is possible that setuptools is needed.
Skip these steps & try to build subliminal without it.
cd /usr/ports/devel/py-setuptools34/ && make install clean BATCH=yes
Worst case scenario: not using the ports version of setuptools.
Do NOT do this unless absolutely necessary.
cd ~
wget https://bootstrap.pypa.io/ez_setup.py --no-check-certificate
python2.7 ez_setup.py

4. Subliminal
Finally, build & install the package
cd /usr/share/subliminal
python2.7 setup.py build
python2.7 setup.py install

Now u can use the subliminal command

5. Usage

I suggest to either use crontab to schedule a job, or add some kind of script you can use in sabnzbd via sharing.
My scheduled job for Dutch subtitles :
find /mnt/download/complete/ \( -iname "*.mkv" -or -iname "*.avi" -or -iname "*.mp4" \) -exec subliminal -l nl -- "{}" \;

I added the following to crontab using crontab -e
30 10 * * * /mnt/it/dev/scripts/bash/subliminal_cron.sh
and subliminal_cron.sh has the following content:
#!/bin/sh
find /mnt/download/complete/ \( -iname "*.mkv" -or -iname "*.avi" -or -iname "*.mp4" \) -exec subliminal -l nl
--addic7ed-username myaddicteduser --addic7ed-password myaddictedpw -- "{}" \;
find /mnt/download/complete/ \( -iname "*.mkv" -or -iname "*.avi" -or -iname "*.mp4" \) -exec subliminal -l en
--addic7ed-username myaddicteduser --addic7ed-password myaddictedpw -- "{}" \;


This is working, but still work in progress.
 
Last edited:

cyberjock

Moderator
Joined
Mar 25, 2012
Messages
19,148
Made this it's own guide in the guides section. Good work.
 

Osiris

FreeNAS Experienced
Joined
Aug 15, 2013
Messages
149

Osiris

FreeNAS Experienced
Joined
Aug 15, 2013
Messages
149
update: podnapisi changed the way their urls are called.
workaround: use the --provider option & list all other providers.
I've adapted the cron script.
 

Osiris

FreeNAS Experienced
Joined
Aug 15, 2013
Messages
149
well, it works perfectly, but I switched to manual control.
Since I've got 2 Kodi's (on chromeboxes) with decent addons that crawl for subs at runtime, I'm not using subliminal that much anymore.
 
Top