FrAnime Fix

This commit is contained in:
petit 2024-08-09 11:55:40 +02:00
parent f2ab3c6ee2
commit 0e49a80eea
6 changed files with 71 additions and 17 deletions

View file

@ -2,21 +2,21 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application>
<activity
android:name=".fr.franime.FrAnimeUrlActivity"
android:excludeFromRecents="true"
android:exported="true"
android:theme="@android:style/Theme.NoDisplay"
>
android:name=".fr.franime.FrAnimeUrlActivity"
android:excludeFromRecents="true"
android:exported="true"
android:theme="@android:style/Theme.NoDisplay"
>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="https"
android:host="franime.fr"
android:pathPattern="/anime/..*"
/>
android:scheme="https"
android:host="franime.fr"
android:pathPattern="/anime/..*"
/>
</intent-filter>
</activity>
</application>
</manifest>
</manifest>

View file

@ -1,7 +1,7 @@
ext {
extName = 'FrAnime'
extClass = '.FrAnime'
extVersionCode = 11
extVersionCode = 12
isNsfw = true
}
apply from: "$rootDir/common.gradle"
@ -11,4 +11,5 @@ dependencies {
implementation(project(':lib:vk-extractor'))
implementation(project(':lib:sendvid-extractor'))
implementation(project(':lib:sibnet-extractor'))
implementation project(':lib:vidmoly-extractor')
}

View file

@ -9,6 +9,7 @@ import eu.kanade.tachiyomi.animesource.model.Video
import eu.kanade.tachiyomi.animesource.online.AnimeHttpSource
import eu.kanade.tachiyomi.lib.sendvidextractor.SendvidExtractor
import eu.kanade.tachiyomi.lib.sibnetextractor.SibnetExtractor
import eu.kanade.tachiyomi.lib.vidmolyextractor.VidMolyExtractor
import eu.kanade.tachiyomi.lib.vkextractor.VkExtractor
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.await
@ -101,7 +102,7 @@ class FrAnime : AnimeHttpSource() {
SEpisode.create().apply {
setUrlWithoutDomain(anime.url + "&ep=${index + 1}")
name = episode.title
name = episode.title ?: "Episode ${index + 1}"
episode_number = (index + 1).toFloat()
}
}
@ -123,14 +124,19 @@ class FrAnime : AnimeHttpSource() {
val players = if (episodeLang == "vo") episodeData.languages.vo.players else episodeData.languages.vf.players
val sendvidExtractor by lazy { SendvidExtractor(client, headers) }
val sibnetExtractor by lazy { SibnetExtractor(client) }
val vkExtractor by lazy { VkExtractor(client, headers) }
val vidMolyExtractor by lazy { VidMolyExtractor(client) }
val videos = players.withIndex().parallelCatchingFlatMap { (index, playerName) ->
val apiUrl = "$videoBaseUrl/$episodeLang/$index"
val playerUrl = client.newCall(GET(apiUrl, headers)).await().body.string()
when (playerName) {
"vido" -> listOf(Video(playerUrl, "FRAnime (Vido)", playerUrl))
"sendvid" -> SendvidExtractor(client, headers).videosFromUrl(playerUrl)
"sibnet" -> SibnetExtractor(client).videosFromUrl(playerUrl)
"vk" -> VkExtractor(client, headers).videosFromUrl(playerUrl)
"sendvid" -> sendvidExtractor.videosFromUrl(playerUrl)
"sibnet" -> sibnetExtractor.videosFromUrl(playerUrl)
"vk" -> vkExtractor.videosFromUrl(playerUrl)
"vidmoly" -> vidMolyExtractor.videosFromUrl(playerUrl)
else -> emptyList()
}
}

View file

@ -68,7 +68,7 @@ data class Season(
@Serializable
data class Episode(
@SerialName("title") val title: String,
@SerialName("title") val title: String?,
@SerialName("lang") val languages: EpisodeLanguages,
)