https://github.com/epic-r-r/opensubtitle
https://github.com/epic-r-r/opensubtitle
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/epic-r-r/opensubtitle
- Owner: Epic-R-R
- Created: 2022-08-15T08:32:27.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-08-15T09:14:49.000Z (almost 4 years ago)
- Last Synced: 2025-12-25T19:55:14.511Z (6 months ago)
- Language: Python
- Size: 21.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

# Opensubtitle API
A simple API for download subtitle from opensubtitle for movies and series
**API is currently in BETA**
# API
Change credentials.json file:
```json
{
"username": "YOURUSER",
"password": "YOURPASS",
"api-key": "YOURAPIKEY"
}
```
```python
from openSubtitle import OpenSubtitles
op = OpenSubtitles()
op.login()
file_info = os.search_for_subtitle("MOVIE FILE PATH", "en", True)
op.download_subtitle(file_info['file_no'])
```
### Search for a subtitle:
```python
search_for_subtitle(full_file_path, sublanguage, forced)
```
> full_file_path = **required**,
> sublanguage = **required**,
> forced = **optional** (default=False)
Returns dictionary:
```dict
{
file_no : file_no,
file_name: file_name
}
```
### Download subtitle:
```python
download_subtitle(file_no, output_directory, output_filename, overwrite)
```
> file_no = **required**,
> output_directory = **optional**
> output_filename = **optional**
> overwrite = **optional** (default=False)