Skip to main content

Subtidal, for batch downloading subtitles for all movies in a central media folder.

Project description

subtidal

GitHub python3

A command line utility for batch downloading subtitles for all movies organized in a central media folder.

Walks the file tree, visiting subfolders and downloading subtitles for each movie if they do not already exist.

Changes subtitle names so that they are automatically recognized by Roku Media Player, VLC, and others.

Makes quick work of central media folders and entire hard drives alike. Ideally, your central media folder will be organized as a repository of folders, with one movie or TV show each, but subtidal will still work if they're not quite that tidy.

Installation

Use the package manager pip to install subtidal. From the command line:

pip install subtidal

Quickstart

Option 1: From the command line

cd /path/to/Your-Movie-Folder
download-subtitles

or, call download-subtitles and specify the path directly:

download-subtitles /path/to/your-movie-folder

Option 2: From Python

from subtidal.download import download

download("./path/to/Your Movie Folder")

# you can also add optional parameters
download(directory="./path/to/Your Movie Folder", verbose=True)

subtidal-demo

Motivation

I hope this project is of use to you. I got frustrated (or rather, was very mildly inconvenienced) because some of the movies I downloaded online didn't come included with subtitles, and I often found myself having to pause the movie I was watching to manually download them from sites like opensubtitles.org](https://opensubtitles.org).

Furthermore, even when subtitles were included with a movie, if the filename differed at all from the name of the movie, they weren't recognized by the Roku Media Player, so I set about to rectify that.

I have a huge, network-attached-storage media folder that acts as the central repository for all of the movies I download online, and I wanted to create a package that could download missing subtitles for every movie in it in one fell swoop.

I imagined that as I downloaded new movies and TV shows into this central repository, I'd be able to run the package periodically via a cron job on my Raspberry Pi, so I'd never have to suffer the loathsome indignity of watching a show without having subtitles available ever again. This package is my attempt to make that vision a reality (or to make some fun out of laziness, depending on how you look at it), and in so doing, make a package available to the public on PyPI, which I had never done before.

Additional function & parameter info in the docstring

def download_subtitles(directory, verbose=False):
    """
    Takes in a directory path, walks through the file tree, and downloads subtitles for any video files found.
    Renames the subtitle file to match the video's name (in order to make it compatible with Roku Media Player.)

    :param (str) directory: Directory where video files or folders are located.
    :param (str) language : [optional] Desired language for subtitles, expressed as a 3-letter ISO-639-3 code. Visit https://bit.ly/29fjNpm for a list of language codes.
    :param (str) country : [optional] Country code (needed in addition to language code for certain languages).
    :param (bool) verbose : [optional] Prints more output to the console.

    Examples:
    1. download_subtitles('./Users/Laura/Movies')
    2. download_subtitles(directory='./Users/Tim/TV Shows', verbose=True)
    """

Contributing

Pull requests are welcome!

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

subtidal-1.1.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

subtidal-1.1.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file subtidal-1.1.0.tar.gz.

File metadata

  • Download URL: subtidal-1.1.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.4.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for subtidal-1.1.0.tar.gz
Algorithm Hash digest
SHA256 54a2237afd4fe78b0c3c203c09caac59a1ec2a74a82f562ebc190fa407564bac
MD5 ba54eb872bdb8787728cf2d60fb55616
BLAKE2b-256 7b0412723048472ba0c3e1e45332202e887f5edea6ac433a47fbcea4a3ce2246

See more details on using hashes here.

File details

Details for the file subtidal-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: subtidal-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.4.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for subtidal-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 205a0e8c67b529cfbf4180aa9f1f45dda07bec47bcd2d101bca6d736a2f5f25d
MD5 50e510fa9c3d47e9c6a06bfe5defc128
BLAKE2b-256 eba266b99f8ef5250c0d9ee9636f8c48dfd58d5e4e9449c1eecf622aa8f0d6cd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page