SubDlApi

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
data class ApiKeyResponse(val ok: Boolean? = false, val apiKey: String, val usage: SubDlApi.Usage? = null)
Link copied to clipboard
data class ApiResponse(val status: Boolean? = null, val results: List<SubDlApi.Result>? = null, val subtitles: List<SubDlApi.Subtitle>? = null)
Link copied to clipboard
object Companion
Link copied to clipboard
data class OAuthTokenResponse(val token: String, val userData: SubDlApi.UserData? = null, val status: Boolean? = null, val message: String? = null)
Link copied to clipboard
data class Result(val sdId: Int? = null, val type: String? = null, val name: String? = null, val imdbId: String? = null, val tmdbId: Long? = null, val firstAirDate: String? = null, val year: Int? = null)
Link copied to clipboard
data class Subtitle(val releaseName: String, val name: String, val lang: String, val author: String? = null, val url: String? = null, val subtitlePage: String? = null, val season: Int? = null, val episode: Int? = null, val language: String? = null, val hearingImpaired: Boolean? = null)
Link copied to clipboard
data class SubtitleOAuthEntity(var userEmail: String, var pass: String, var name: String? = null, var accessToken: String? = null, var apiKey: String? = null)
Link copied to clipboard
data class Usage(val total: Long? = 0, val today: Long? = 0)
Link copied to clipboard
data class UserData(val email: String, val name: String, val country: String, val scStepCode: String, val scVerified: Boolean, val username: String? = null, val scUsername: String)

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: subdl_logo_big

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 override 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
@WorkerThread
open suspend 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 fun refreshToken(token: AuthToken): AuthToken?

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

Link copied to clipboard
@WorkerThread
suspend fun resource(auth: AuthData?, subtitle: AbstractSubtitleEntities.SubtitleEntity): SubtitleResource
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open suspend override fun user(token: AuthToken?): AuthUser?

Get the visible user account