Skip to main content

cli program for subtitles download from OpenSubtitles

Project description

TV Series Renamer

Simple script in python3 that download and organize subtitles from OpenSubtitles. The purpose of the program is to make easier for user to get every subtitle associated with its related video.

How does it work

This program works in ~/Downloads (default) or in a directory passed as argument.

  1. It takes every subdirectory, video, archive and subtitle file in folder that looks like it’s a tv-series related file.

  2. After that it move archives in the corrisponding folder or extracts their contents if the video file is in the same directory of the archive.

  3. If a video file and a subtitle file are related (same tv-shows name and same season and episode) the program renames the subtitle the same as the video.

Configure OpenSubtitle account

Configure opensubtitles.json file as show in opensubtitles.json.example and put it into ~/.opensubtitles_downloader. If you want to use it anonymously don’t insert any username, otherwise use your account on OpenSubtitles.

– opensubtitles.json.example –

{
    "username": "username",
    "password": "password",
    "language": ["en"],
    "useragent": "mistalbo"
}

Install package from pip

pip install --user opensubtitles-downloader

How to use it

Launch it with ~/Downloads directory as target:

$ opensubtitles_downloader

Launch it with user input directory as target:

$ opensubtitles_downloader -d <directory>

Launch it with user input file as target:

$ opensubtitles_downloader -f <filename>

Launch it with clean option:

$ opensubtitles_downloader -c

When this option is activated, the script looks for all subtitles for which there is no video file related and for all empty directories, then it put them in trash. Using the clean option doesn’t prevent the program from downloading subtitles, it’s intended as an extra action and not as an alternative to regular actions.

Contribute

Read CONTRIBUTING.md.

News

0.2.1

Release date: 19-Nov-2020

  • Removed ‘guessit’ library (it was causing verbose output)

0.2.0

Release date: 18-Nov-2020

  • Added ‘guessit’ library

  • Opensubtitles download doesn’t fully trust hash, check that subtitle filename is correct.

0.1.5

Release date: 07-Feb-2019

  • Fix logging to stdout

0.1.4

Release date: 07-Feb-2019

  • Improved

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

opensubtitles_downloader-1.0.3.tar.gz (14.3 kB view hashes)

Uploaded Source

Built Distribution

opensubtitles_downloader-1.0.3-py3-none-any.whl (28.2 kB view hashes)

Uploaded Python 3

Supported by

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