|
|
@ -33,7 +33,7 @@ export default class Rarbg extends Provider |
|
|
|
/** |
|
|
|
* Since the API is sereverly broken, we need a bunch of retries |
|
|
|
*/ |
|
|
|
protected readonly SEARCH_RETRIES = 30; |
|
|
|
protected override readonly SEARCH_RETRIES = 30; |
|
|
|
|
|
|
|
/** |
|
|
|
* Store the time when the API needs to re-authenticate |
|
|
@ -48,14 +48,14 @@ export default class Rarbg extends Provider |
|
|
|
/** |
|
|
|
* Indicate if the API is currently authenticated |
|
|
|
*/ |
|
|
|
protected async isAuthenticated() { |
|
|
|
protected override async isAuthenticated() { |
|
|
|
return Date.now() < this.nextAuthenticationTime; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Authenticate the RARBG context |
|
|
|
*/ |
|
|
|
protected async authenticate() { |
|
|
|
protected override async authenticate() { |
|
|
|
let now = Date.now(); |
|
|
|
let [status, response] = await jsonRequest<ITokenResponse>( |
|
|
|
`${URL_BASE}&get_token=get_token` |
|
|
@ -71,7 +71,7 @@ export default class Rarbg extends Provider |
|
|
|
/** |
|
|
|
* Search for a movie |
|
|
|
*/ |
|
|
|
public async searchMovieImdb(imdbId: string, movie: IMovieSearchInfo) { |
|
|
|
public override async searchMovieImdb(imdbId: string, movie: IMovieSearchInfo) { |
|
|
|
let [_, response] = await jsonRequest<ISearchResult>( |
|
|
|
`${URL_BASE}&token=${this.token}` |
|
|
|
+ `&mode=search&search_imdb=${imdbId}` |
|
|
|