OpenSubtitlesApi

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class OAuthToken(var token: String? = null, var status: Int? = null)
Link copied to clipboard
data class ResultAttributes(var subtitleId: String? = null, var language: String? = null, var release: String? = null, var url: String? = null, var files: List<OpenSubtitlesApi.ResultFiles>? = listOf(), var featDetails: OpenSubtitlesApi.ResultFeatureDetails? = ResultFeatureDetails(), var hearingImpaired: Boolean? = null)
Link copied to clipboard
data class ResultData(var id: String? = null, var type: String? = null, var attributes: OpenSubtitlesApi.ResultAttributes? = ResultAttributes())
Link copied to clipboard
data class ResultDownloadLink(var link: String? = null, var fileName: String? = null, var requests: Int? = null, var remaining: Int? = null, var message: String? = null, var resetTime: String? = null, var resetTimeUtc: String? = null)
Link copied to clipboard
data class ResultFeatureDetails(var year: Int? = null, var title: String? = null, var movieName: String? = null, var imdbId: Int? = null, var tmdbId: Int? = null, var seasonNumber: Int? = null, var episodeNumber: Int? = null, var parentImdbId: Int? = null, var parentTitle: String? = null, var parentTmdbId: Int? = null, var parentFeatureId: Int? = null)
Link copied to clipboard
data class ResultFiles(var fileId: Int? = null, var fileName: String? = null)
Link copied to clipboard
data class Results(var data: List<OpenSubtitlesApi.ResultData>? = listOf())

Properties

Link copied to clipboard
open override val createAccountUrl: String

Link to a website for creating a new account

Link copied to clipboard
open override val hasInApp: Boolean = true

Has in app login support, aka login with a dialog

Link copied to clipboard
open val hasOAuth2: Boolean = false

Has OAuth2 login support, including login, loginRequest and refreshToken

Link copied to clipboard
open val hasPin: Boolean = false

Has on device pin support, aka login with a QR code

Link copied to clipboard
open override val icon: ERROR CLASS: Unresolved name: open_subtitles_icon

Drawable icon of the service

Link copied to clipboard
open override val idPrefix: String
Link copied to clipboard

The requirements to login in app

Link copied to clipboard
open override val name: String
Link copied to clipboard
open val redirectUrlIdentifier: String? = null

The sensitive redirect URL from OAuth should contain "/redirectUrlIdentifier" to trigger the login

Link copied to clipboard
open val requiresLogin: Boolean = true

If this service requires an account to use

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open suspend fun invalidateToken(token: AuthToken): Nothing

An optional security measure to make sure that even if an attacker gets ahold of the token, it will be invalid.

Link copied to clipboard

Is this url a valid redirect url for this service?

Link copied to clipboard
open suspend override fun load(auth: AuthData?, subtitle: AbstractSubtitleEntities.SubtitleEntity): String?
Link copied to clipboard
open suspend fun login(payload: AuthPinData): AuthToken?

Pin login, this will be called periodically while logging in to check if the pin has been verified by the user

open suspend fun login(redirectUrl: String, payload: String?): AuthToken?

OAuth2 login from a valid redirectUrl, and payload given in loginRequest

open suspend override fun login(form: AuthLoginResponse): AuthToken?

In app login

Link copied to clipboard
Link copied to clipboard

OAuth2 login request, asking the service to provide a url to open in the browser

Link copied to clipboard
open suspend fun pinRequest(): AuthPinData?

Pin login request, asking the service to provide an verificationUrl to display with a QR code

Link copied to clipboard
open suspend override fun refreshToken(token: AuthToken): AuthToken?

OAuth2 token refresh, this ensures that all token passed to other functions will be valid

Link copied to clipboard
Link copied to clipboard

Fetch subtitles using token authenticated on previous method (see authorize). Returns list of Subtitles which user can select to download (see load).

Link copied to clipboard
Link copied to clipboard
open suspend override fun user(token: AuthToken?): AuthUser?

Get the visible user account