-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into samehadaku
- Loading branch information
Showing
88 changed files
with
3,080 additions
and
1,923 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
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,4 @@ | ||
dependencies { | ||
implementation(project(":lib-filemoon-extractor")) | ||
implementation(project(":lib-playlist-utils")) | ||
} |
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
46 changes: 46 additions & 0 deletions
46
multisrc/overrides/dooplay/pobreflix/src/extractors/EplayerExtractor.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,46 @@ | ||
package eu.kanade.tachiyomi.animeextension.pt.pobreflix.extractors | ||
|
||
import eu.kanade.tachiyomi.animesource.model.Video | ||
import eu.kanade.tachiyomi.lib.playlistutils.PlaylistUtils | ||
import eu.kanade.tachiyomi.network.POST | ||
import okhttp3.FormBody | ||
import okhttp3.Headers | ||
import okhttp3.OkHttpClient | ||
|
||
class EplayerExtractor(private val client: OkHttpClient) { | ||
private val headers by lazy { | ||
Headers.headersOf( | ||
"X-Requested-With", | ||
"XMLHttpRequest", | ||
"Referer", | ||
EPLAYER_HOST, | ||
"Origin", | ||
EPLAYER_HOST, | ||
) | ||
} | ||
|
||
private val playlistUtils by lazy { PlaylistUtils(client, headers) } | ||
|
||
fun videosFromUrl(url: String, lang: String): List<Video> { | ||
val id = url.substringAfterLast("/") | ||
|
||
val postUrl = "$EPLAYER_HOST/player/index.php?data=$id&do=getVideo" | ||
val body = FormBody.Builder() | ||
.add("hash", id) | ||
.add("r", "") | ||
.build() | ||
|
||
val masterUrl = client.newCall(POST(postUrl, headers, body = body)).execute().use { | ||
it.body.string() | ||
.substringAfter("videoSource\":\"") | ||
.substringBefore('"') | ||
.replace("\\", "") | ||
} | ||
|
||
return playlistUtils.extractFromHls(masterUrl, videoNameGen = { "[$lang] EmbedPlayer - $it" }) | ||
} | ||
|
||
companion object { | ||
private const val EPLAYER_HOST = "https://embedplayer.online" | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
multisrc/overrides/dooplay/pobreflix/src/extractors/MyStreamExtractor.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,50 @@ | ||
package eu.kanade.tachiyomi.animeextension.pt.pobreflix.extractors | ||
|
||
import eu.kanade.tachiyomi.animesource.model.Video | ||
import eu.kanade.tachiyomi.lib.playlistutils.PlaylistUtils | ||
import eu.kanade.tachiyomi.network.GET | ||
import okhttp3.Headers | ||
import okhttp3.OkHttpClient | ||
|
||
// From animeworldindia | ||
class MyStreamExtractor(private val client: OkHttpClient, private val headers: Headers) { | ||
|
||
private val playlistUtils by lazy { PlaylistUtils(client, headers) } | ||
|
||
fun videosFromUrl(url: String, language: String): List<Video> { | ||
val host = url.substringBefore("/watch?") | ||
|
||
return runCatching { | ||
val response = client.newCall(GET(url, headers)).execute() | ||
val body = response.use { it.body.string() } | ||
|
||
val codePart = body | ||
.substringAfter("sniff(") // Video function | ||
.substringBefore(",[") | ||
|
||
val streamCode = codePart | ||
.substringAfterLast(",\"") // our beloved hash | ||
.substringBefore('"') | ||
|
||
val id = codePart.substringAfter(",\"").substringBefore('"') // required ID | ||
|
||
val streamUrl = "$host/m3u8/$id/$streamCode/master.txt?s=1&cache=1" | ||
|
||
val cookie = response.headers.firstOrNull { | ||
it.first.startsWith("set-cookie", true) && it.second.startsWith("PHPSESSID", true) | ||
}?.second?.substringBefore(";") ?: "" | ||
|
||
val newHeaders = headers.newBuilder() | ||
.set("cookie", cookie) | ||
.set("accept", "*/*") | ||
.build() | ||
|
||
playlistUtils.extractFromHls( | ||
streamUrl, | ||
masterHeaders = newHeaders, | ||
videoHeaders = newHeaders, | ||
videoNameGen = { "[$language] MyStream: $it" }, | ||
) | ||
}.getOrElse { emptyList<Video>() } | ||
} | ||
} |
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
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
Oops, something went wrong.