Skip to content

Commit

Permalink
Cambio yomiroll
Browse files Browse the repository at this point in the history
  • Loading branch information
imper1aldev committed Sep 25, 2023
1 parent ee0730b commit d6b5cf3
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class YomirollProvider : MainAPI() {
val url = request.data.replace("{start}", start)
val position = request.data.toHttpUrl().queryParameter("start")?.toIntOrNull() ?: 0

val parsed = app.get(url, interceptor = tokenInterceptor).parsed<AnimeResult>()
val parsed = app.get(url, headers = getCrunchyrollToken()).parsed<AnimeResult>()
val hasNextPage = position + 36 < parsed.total

val home = parsed.data.map {
Expand Down Expand Up @@ -126,7 +126,7 @@ class YomirollProvider : MainAPI() {
} else {
"$crApiUrl/cms/movie_listings/${anime.id}?locale=en-US"
},
interceptor = tokenInterceptor
headers = getCrunchyrollToken()
).parsed<AnimeResult>().data.first()

val title = anime.title
Expand Down Expand Up @@ -179,7 +179,7 @@ class YomirollProvider : MainAPI() {
} else {
"$crApiUrl/cms/movie_listings/${anime.id}/movies"
},
interceptor = tokenInterceptor
headers = getCrunchyrollToken()
).parsed<SeasonResult>()

val chunkSize = Runtime.getRuntime().availableProcessors()
Expand Down Expand Up @@ -213,7 +213,7 @@ class YomirollProvider : MainAPI() {
private suspend fun getEpisodes(seasonData: SeasonResult.Season): List<Episode> {
val episodes = app.get(
"$crApiUrl/cms/seasons/${seasonData.id}/episodes",
interceptor = tokenInterceptor
headers = getCrunchyrollToken()
).parsed<EpisodeResult>()
return episodes.data.sortedBy { it.episode_number }.mapNotNull EpisodeMap@{ ep ->
Episode(
Expand Down Expand Up @@ -281,7 +281,7 @@ class YomirollProvider : MainAPI() {
val (mediaId, audioL) = it
val streams = app.get(
"https://beta-api.crunchyroll.com/content/v2/cms/videos/$mediaId/streams",
interceptor = tokenInterceptor,
headers = getCrunchyrollToken(),
timeout = 20000
).parsedSafe<CrunchyrollSourcesResponses>()

Expand Down

0 comments on commit d6b5cf3

Please sign in to comment.