Skip to main content

This Python library is designed to make downloading Sinhala subtitles for TV series and movies easy. To use it, simply install the library using pip and import it into your Python script.

Project description

Sinhala Subtitles Downloader

This Python library makes it easy to download Sinhala subtitles for TV series and movies. It currently supports two websites, Baiscope and Cineru.

Installation

You can install the library using pip:

pip install sinhala_sub

Usage

To use the library, simply import it and call one of the following functions:

search(query, site=None)

Searches for available Sinhala subtitles for a given TV series or movie.

from sinhala_sub import SinhalaSubtitles 

# Create an instance of the SinhalaSubtitles class 
subtitles = SinhalaSubtitles() 

# Search for  Sinhala subtitles for Pirates of the Caribbean movie" 
results = subtitles.search('Pirates of the Caribbean') 

# Print the list of available subtitle files
for  result  in results: 
	print(result)

search subtitles with mentioning website :

results = subtitles.search('Pirates of the Caribbean', site='baiscopelk')
  • query: The name of the TV series or movie.
  • site: Optional. The website to search on. Can be "baiscopelk" or "cineru".

Returns a list of available Sinhala subtitle files.

download(page_url)

Downloads a Sinhala subtitle file from a given URL.

from sinhala_sub import SinhalaSubtitles

# Create an instance of the SinhalaSubtitles class
subtitles = SinhalaSubtitles()

# Download Sinhala subtitles for the movie "Pirates of the Caribbean: Dead Men Tell No Tales"
url = 'https://www.baiscopelk.com/pirates-of-the-caribbean-dead-men-tell-no-tales-2017-with-sinhala-subtitles/'
subtitles.download(url)
  • page_url: The URL of the subtitle file to download.

Returns True if the download is successful, False otherwise.

bulk(bulk_url)

Downloads a bulk of Sinhala subtitle files from a given URL.

from sinhala_sub import SinhalaSubtitles

# Create an instance of the SinhalaSubtitles class
subtitles = SinhalaSubtitles()

# Download a bulk of Sinhala subtitles for the TV series "Supernatural"
url = 'https://www.baiscopelk.com/tv-series/supernatural-2005/'
subtitles.bulk(url)
  • bulk_url: The URL of the subtitle file bulk to download.

Returns a list of downloaded subtitle files.

License

This library is released under the MIT license.

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

sinhala_sub-3.0.1.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

sinhala_sub-3.0.1-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file sinhala_sub-3.0.1.tar.gz.

File metadata

  • Download URL: sinhala_sub-3.0.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for sinhala_sub-3.0.1.tar.gz
Algorithm Hash digest
SHA256 d6efaaf2c2acc1b5fd2c12a37359a368dfef5878475eda81e024044d6bb7dddb
MD5 97261359c696eb050ecaa1eaa93f215e
BLAKE2b-256 081601405325779caf11d2e0cc4d3f0b590d4623018b026cf62d7100c17637fe

See more details on using hashes here.

File details

Details for the file sinhala_sub-3.0.1-py3-none-any.whl.

File metadata

  • Download URL: sinhala_sub-3.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for sinhala_sub-3.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aa116ed015be7fd2ef2fa8ef555fc18dc6d736ad3d07415c406687780ed0a653
MD5 f2ce1ccde5433852cec171e97a093a7d
BLAKE2b-256 8d76e7113370995d04cd1f4bfe1c6b56c53c7ea47a0c6f1424073632b0ddd9bf

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