This is a Java-based API wrapper for OpenSubtitles that simplifies integration with their services. The wrapper provides a user-friendly interface to interact with OpenSubtitles' subtitle search and retrieval functionalities.
- Search for subtitles using various parameters.
- Search by movie hash, IMDb ID, TMDb ID, and more.
- Pagination support for results.
- Filter and sort subtitles by language, trusted sources, year, etc.
- Java 8 or higher.
- Maven or Gradle for dependency management.
You can include this library in your project using JitPack. To do so:
-
Add the JitPack repository to your
build.gradle(orpom.xml):Gradle:
repositories { maven { url 'https://jitpack.io' } }
Maven:
<repositories> <repository> <id>jitpack.io</id> <url>https://jitpack.io</url> </repository> </repositories>
-
Add the dependency:
Gradle:
dependencies { implementation 'com.github.leandrop98:opensubtitles:x.x.x' }
Maven:
<dependency> <groupId>com.github.leandrop98</groupId> <artifactId>opensubtitles</artifactId> <version>x.x.x</version> </dependency>
-
-
Add the JitPack repository to your
build.gradle(orpom.xml):Gradle:
repositories { maven { url 'https://maven.pkg.github.com/leandrop98/opensubtitles' } }
-
Add the dependency:
Gradle:
dependencies { implementation 'com.opensubtitles:opensubtitles:x.x.x' }
Maven:
<dependency> <groupId>com.opensubtitles</groupId> <artifactId>opensubtitles</artifactId> <version>0.0.1</version> </dependency>
Here’s a simple example of how to use the API wrapper to search for subtitles:
import opensubtitles.api.OpenSubtitlesService;
import opensubtitles.api.subtitles.SubtitleSearchRequest;
public class Main {
public static void main(String[] args) {
OpenSubtitlesService openSubtitlesService = new OpenSubtitlesService(System.getenv("TEST_API_KEY"), "appnametest", "1.0.0");
SubtitleSearchRequest request = new SubtitleSearchRequest("iron", "en");
SubtitleSearchResponse res = openSubtitlesService.searchSubtitles(request);
}
}- Fork the repository.
- Create your feature branch (
git checkout -b feature/awesome-feature). - Commit your changes (
git commit -am 'Add awesome feature'). - Push to the branch (
git push origin feature/awesome-feature). - Open a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.