forked from aniyomiorg/aniyomi-extensions
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'aniyomiorg:master' into master
- Loading branch information
Showing
17 changed files
with
174 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
ext { | ||
extName = 'MissAV' | ||
extClass = '.MissAV' | ||
extVersionCode = 6 | ||
extVersionCode = 7 | ||
isNsfw = true | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
ext { | ||
extName = 'Animes Digital' | ||
extClass = '.AnimesDigital' | ||
extVersionCode = 2 | ||
extVersionCode = 3 | ||
} | ||
|
||
apply from: "$rootDir/common.gradle" | ||
|
||
dependencies { | ||
implementation(project(":lib:unpacker")) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
.../src/eu/kanade/tachiyomi/animeextension/pt/animesdigital/extractors/ProtectorExtractor.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package eu.kanade.tachiyomi.animeextension.pt.animesdigital.extractors | ||
|
||
import eu.kanade.tachiyomi.animesource.model.Video | ||
import eu.kanade.tachiyomi.network.GET | ||
import eu.kanade.tachiyomi.util.asJsoup | ||
import okhttp3.Headers | ||
import okhttp3.HttpUrl.Companion.toHttpUrl | ||
import okhttp3.OkHttpClient | ||
|
||
private const val HOST = "https://sabornutritivo.com" | ||
|
||
class ProtectorExtractor(private val client: OkHttpClient) { | ||
fun videosFromUrl(url: String): List<Video> { | ||
val fixedUrl = if (!url.startsWith("https")) "https:$url" else url | ||
val token = fixedUrl.toHttpUrl().queryParameter("token")!! | ||
val headers = Headers.headersOf("cookie", "token=$token;") | ||
val doc = client.newCall(GET("$HOST/social.php", headers)).execute().asJsoup() | ||
val videoHeaders = Headers.headersOf("referer", doc.location()) | ||
val iframeUrl = doc.selectFirst("iframe")!!.attr("src").trim() | ||
return listOf(Video(iframeUrl, "Animes Digital", iframeUrl, videoHeaders)) | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...tal/src/eu/kanade/tachiyomi/animeextension/pt/animesdigital/extractors/ScriptExtractor.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package eu.kanade.tachiyomi.animeextension.pt.animesdigital.extractors | ||
|
||
import eu.kanade.tachiyomi.animesource.model.Video | ||
import eu.kanade.tachiyomi.lib.unpacker.Unpacker | ||
import okhttp3.Headers | ||
|
||
object ScriptExtractor { | ||
fun videosFromScript(scriptData: String, headers: Headers): List<Video> { | ||
val script = when { | ||
"eval(function" in scriptData -> Unpacker.unpack(scriptData) | ||
else -> scriptData | ||
}.ifEmpty { null }?.replace("\\", "") ?: return emptyList() | ||
|
||
return script.substringAfter("sources:").substringAfter(".src(") | ||
.substringBefore(")") | ||
.substringAfter("[") | ||
.substringBefore("]") | ||
.split("{") | ||
.drop(1) | ||
.map { | ||
val quality = it.substringAfter("label", "") | ||
.substringAfterKey() | ||
.trim() | ||
.ifEmpty { "Animes Digital" } | ||
val url = it.substringAfter("file").substringAfter("src") | ||
.substringAfterKey() | ||
.trim() | ||
Video(url, quality, url, headers) | ||
} | ||
} | ||
|
||
private fun String.substringAfterKey() = substringAfter(':') | ||
.substringAfter('"') | ||
.substringBefore('"') | ||
.substringAfter("'") | ||
.substringBefore("'") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.