Skip to main content

OpenSubtitles Subtitles Downloader

Project description

OpenSubtitles Subtitles Downloader - OSSD

This package allows you to download subtitles as text from www.opensubtitles.com. All you need to have is Selenium with Chrome driver, requests package (pip install requests) and this OSSD package.

Instalation

pip install ossd

PyPi page - https://pypi.org/project/ossd/

Usage

import ossd
ossd.get_subtitles(driver, movie_name)

Methods

get_subtitles -- returns most downloaded subtitles text, if error occurs then returns " " (whitespace) and prints error code parse_subtitles -- parses script lines from default format into one line only text format, skips ads on the script start

Example

 import ossd
 from selenium import webdriver  
 driver = webdriver.Chrome(executable_path=driverPath)
 text = ossd.get_subtitles(driver, "Star Wars: A New Hope")

Output (in variable text)

Same as here.

0
00:02:40,680 --> 00:02:42,557
Did you hear that? \

1 \ 00:02:42,680 --> 00:02:45,319
They shut down the main reactor. \ We'll be destroyed for sure. \

2
00:02:45,440 --> 00:02:46,873
This is madness. \

3
00:02:56,560 --> 00:02:57,913
We're doomed.
....


one_text = ossd.parse_subtitles(text)

Output (in variable one_text)

Did you hear that? They shut down the main reactor. We'll be destroyed for sure. This is madness. We're doomed. ...

Licence - MIT

Free for use, editing, selling, just mention author

Development

  • Clean ununsed: rm -rf build/ dist/ *egg* **.pyc __pycache__
  • Build package: python setup.py sdist bdist_wheel
  • deploy package: python -m twine upload dist/*

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

ossd-1.0.8.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ossd-1.0.8-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file ossd-1.0.8.tar.gz.

File metadata

  • Download URL: ossd-1.0.8.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.4

File hashes

Hashes for ossd-1.0.8.tar.gz
Algorithm Hash digest
SHA256 a9226863c02f57f4b6e00ed12294bd8ad530003b982bb0a6d5b5a7bed3b857bd
MD5 55edcd11613fbe99d196f5c052b30c4d
BLAKE2b-256 0b2ee76e08f1257b9e5645f7d53c5ff35d1c6e840e41dd1a651c5a947c929711

See more details on using hashes here.

File details

Details for the file ossd-1.0.8-py3-none-any.whl.

File metadata

  • Download URL: ossd-1.0.8-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.4

File hashes

Hashes for ossd-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 247bdc0ce741ea3e985656ea36996a8ef89dfc67c0644c4f4cd4d4a66e59b51f
MD5 456224eec0bd5df5d3f9b65962d4d346
BLAKE2b-256 e292a4c4fc97b4f99404db1e192cc7f5986ddcba6f80f30abbc04ab5fa9c8b98

See more details on using hashes here.

Supported by

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