Skip to content

cryo-kronos/subliminal

 
 

Repository files navigation

Subliminal

Subtitles, faster than your thoughts.

Latest Version

Travis CI build status

Documentation Status

Code coverage

License

Join the chat at https://gitter.im/Diaoul/subliminal

Project page

https://github.com/Diaoul/subliminal

Documentation

https://subliminal.readthedocs.org/

Usage

CLI

Download English subtitles:

$ subliminal download -l en The.Big.Bang.Theory.S05E18.HDTV.x264-LOL.mp4
Collecting videos  [####################################]  100%
1 video collected / 0 video ignored / 0 error
Downloading subtitles  [####################################]  100%
Downloaded 1 subtitle

Library

Download best subtitles in French and English for videos less than two weeks old in a video folder:

from datetime import timedelta

from babelfish import Language
from subliminal import download_best_subtitles, region, save_subtitles, scan_videos

# configure the cache
region.configure('dogpile.cache.dbm', arguments={'filename': 'cachefile.dbm'})

# scan for videos newer than 2 weeks and their existing subtitles in a folder
videos = [v for v in scan_videos('/video/folder') if v.age < timedelta(weeks=2)]

# download best subtitles
subtitles = download_best_subtitles(videos, {Language('eng'), Language('fra')})

# save them to disk, next to the video
for v in videos:
    save_subtitles(v, subtitles[v])

Nautilus integration

Screenshots

Menu

Configuration

Choose subtitles

Install

  1. Install subliminal on your system sudo pip install -U subliminal
  2. Install nautilus-python with your package manager sudo apt-get install nautilus-python
  3. Create the extension directory mkdir -p ~/.local/share/nautilus-python/extensions/subliminal
  4. Copy the script cp examples/nautilus.py ~/.local/share/nautilus-python/extensions/subliminal-nautilus.py
  5. Copy UI files cp -R examples/ui ~/.local/share/nautilus-python/extensions/subliminal/
  6. (Optional) Create a translation directory for your language mkdir -p ~/.local/share/nautilus-python/extensions/subliminal/locale/fr/LC_MESSAGES
  7. (Optional) Install the translation msgfmt examples/i18n/fr.po -o ~/.local/share/nautilus-python/extensions/subliminal/locale/fr/LC_MESSAGES/subliminal.mo

About

Subliminal - Subtitles, faster than your thoughts

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%