Skip to content

Commit

Permalink
fixed tom
Browse files Browse the repository at this point in the history
  • Loading branch information
SaurabhKaperwan committed Nov 29, 2024
1 parent c47b7fb commit fdd7db5
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 22 deletions.
2 changes: 1 addition & 1 deletion CineStream/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import org.jetbrains.kotlin.konan.properties.Properties

version = 41
version = 42

android {
defaultConfig {
Expand Down
21 changes: 10 additions & 11 deletions CineStream/src/main/kotlin/com/megix/CineStreamExtractors.kt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ object CineStreamExtractors : CineStreamProvider() {
subtitleCallback: (SubtitleFile) -> Unit
) {
val url = if(season == null) "$TomAPI/api/getVideoSource?type=movie&id=$id" else "$TomAPI/api/getVideoSource?type=tv&id=$id/$season/$episode"
val headers = mapOf(
"User-Agent" to "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.0",
"Referer" to "$AutoembedAPI/"
)
val json = app.get(url).text
val data = tryParseJson<TomResponse>(json) ?: return

Expand Down Expand Up @@ -328,7 +332,6 @@ object CineStreamExtractors : CineStreamProvider() {
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val Season = app.get("$jikanAPI/anime/${malId ?: return}").parsedSafe<JikanResponse>()?.data?.season ?:""
val malsync = app.get("$malsyncAPI/mal/anime/${malId ?: return}")
.parsedSafe<MALSyncResponses>()?.sites
val zoroIds = malsync?.zoro?.keys?.map { it }
Expand Down Expand Up @@ -833,16 +836,16 @@ object CineStreamExtractors : CineStreamProvider() {
}

suspend fun invokeRogmovies(
id: String? = null,
title: String? = null,
year: Int? = null,
season: Int? = null,
episode: Int? = null,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
invokeWpredis(
id,
title,
year,
season,
episode,
subtitleCallback,
Expand All @@ -851,16 +854,16 @@ object CineStreamExtractors : CineStreamProvider() {
)
}
suspend fun invokeVegamovies(
id: String? = null,
title: String? = null,
year: Int? = null,
season: Int? = null,
episode: Int? = null,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
invokeWpredis(
id,
title,
year,
season,
episode,
subtitleCallback,
Expand All @@ -870,8 +873,8 @@ object CineStreamExtractors : CineStreamProvider() {
}

private suspend fun invokeWpredis(
id: String? = null,
title: String? = null,
year: Int? = null,
season: Int? = null,
episode: Int? = null,
subtitleCallback: (SubtitleFile) -> Unit,
Expand All @@ -881,11 +884,7 @@ object CineStreamExtractors : CineStreamProvider() {
val (seasonSlug, episodeSlug) = getEpisodeSlug(season, episode)
val cfInterceptor = CloudflareKiller()
val fixtitle = title?.substringBefore("-")?.substringBefore(":")?.replace("&", " ")
val url = if (season == null) {
"$api/search/$fixtitle $year"
} else {
"$api/search/$fixtitle season $season"
}
val url = "$api/search/$id"
val domain= api.substringAfter("//").substringBefore(".")
app.get(url, interceptor = cfInterceptor).document.select("#main-content article")
.filter { element ->
Expand Down
9 changes: 3 additions & 6 deletions CineStream/src/main/kotlin/com/megix/CineStreamProvider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,8 @@ open class CineStreamProvider : MainAPI() {
override val hasDownloadSupport = true
val skipMap: MutableMap<String, Int> = mutableMapOf()
val cinemeta_url = "https://v3-cinemeta.strem.io"
//val cyberflix_url = "https://cyberflix.elfhosted.com/c/catalogs"
val kitsu_url = "https://anime-kitsu.strem.fun"
//val anime_catalogs_url = "https://1fe84bc728af-stremio-anime-catalogs.baby-beamup.club"
val haglund_url = "https://arm.haglund.dev/api/v2"
val jikanAPI = "https://api.jikan.moe/v4"
val streamio_TMDB = "https://94c8cb9f702d-tmdb-addon.baby-beamup.club"
val mediaFusion = "https://mediafusion.elfhosted.com"
companion object {
Expand All @@ -75,7 +72,7 @@ open class CineStreamProvider : MainAPI() {
const val moviesAPI = "https://moviesapi.club"
const val TwoEmbedAPI = "https://2embed.wafflehacker.io"
//const val FilmyxyAPI = "https://filmxy.wafflehacker.io"
const val AutoembedDramaAPI = "https://asian-drama.autoembed.cc"
const val AutoembedDramaAPI = "https://drama.autoembed.cc"
const val RarAPI = "https://nepu.to"
const val hianimeAPI = "https://hianime.to"
const val animepaheAPI = "https://animepahe.ru"
Expand Down Expand Up @@ -351,8 +348,8 @@ open class CineStreamProvider : MainAPI() {
argamap(
{
if(!res.isBollywood) invokeVegamovies(
res.id,
res.title,
year,
res.season,
res.episode,
subtitleCallback,
Expand Down Expand Up @@ -394,8 +391,8 @@ open class CineStreamProvider : MainAPI() {
},
{
if(res.isBollywood) invokeRogmovies(
res.id,
res.title,
year,
res.season,
res.episode,
subtitleCallback,
Expand Down
2 changes: 1 addition & 1 deletion Extractors/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = 10
version = 12

cloudstream {
//language = "hi"
Expand Down
6 changes: 3 additions & 3 deletions Extractors/src/main/kotlin/com/megix/Extractors.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import okhttp3.FormBody
import okhttp3.*
import okhttp3.MediaType.Companion.toMediaTypeOrNull
import okhttp3.RequestBody.Companion.toRequestBody
import android.util.Log

class Driveleech : Driveseed() {
override val name: String = "Driveleech"
Expand Down Expand Up @@ -92,9 +93,8 @@ open class Driveseed : ExtractorApi() {
callback: (ExtractorLink) -> Unit
) {
val document = app.get(url).document
val quality = document.selectFirst("li.list-group-item:contains(Name)")?.text() ?: ""
val fileName = quality.substringAfter("Name : ") ?: ""

val quality = document.selectFirst("li.list-group-item")?.text() ?: ""
val fileName = quality.replace("Name : ", "")
document.select("div.text-center > a").amap { element ->
val text = element.text()
val href = element.attr("href")
Expand Down

0 comments on commit fdd7db5

Please sign in to comment.