Compare commits

...

12 Commits

Author SHA1 Message Date
RowdyRushya bd1f35a327
Merge aa522c8052 into 138e1a1f0e 2024-04-27 16:00:32 -07:00
Luna712 138e1a1f0e
Don't check year when checking duplicates if year is empty (#1060)
Some sources don't use year which makes this not match when it really should match
2024-04-27 22:40:15 +02:00
RowdyRushya aa522c8052
silly silly fix 2024-04-24 21:08:11 -07:00
RowdyRushya ce3359c0fa
silly change 2024-04-24 17:59:15 -07:00
RowdyRushya 30839e3a09
Merge branch 'recloudstream:master' into master 2024-04-24 17:56:49 -07:00
RowdyRushya c363596d4f
Including series name in episode data.
This data is passed to loadLinks but name is not included in TvSeriesLoadResponse which is crucial as not all sites support filtering using ids and name is required.
2024-04-24 17:56:16 -07:00
RowdyRushya dc8ba3399c
Learned and understood what is flattening the code. 2024-04-24 17:49:00 -07:00
RowdyRushya a936fc9ac8
suggestions 2024-04-17 10:14:39 -07:00
rushi-chavan c82d2e329e Update ExtractorApi.kt 2024-04-15 21:40:33 -07:00
RowdyRushya 47ca5aa5cc
Extractor: New extractor VidSrcTo
+ new AnyVidplay extractor which can be used on alternate vidplay domains by AnyVidplay(<new doamin>),getUrl(...)
2024-04-15 21:05:50 -07:00
RowdyRushya 33e985bfea
Merge branch 'recloudstream:master' into master 2024-04-15 20:48:20 -07:00
Rushikesh Chavan e404a16ae9
Extractor: Update Vidplay Extractor 2024-04-12 01:53:30 -07:00
5 changed files with 74 additions and 1 deletions

View File

@ -0,0 +1,64 @@
package com.lagradost.cloudstream3.extractors
import android.util.Base64
import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.SubtitleFile
import com.lagradost.cloudstream3.amap
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink
import java.net.URLDecoder
import javax.crypto.Cipher
import javax.crypto.spec.SecretKeySpec
class VidSrcTo : ExtractorApi() {
override val name = "VidSrcTo"
override val mainUrl = "https://vidsrc.to"
override val requiresReferer = true
override suspend fun getUrl(
url: String,
referer: String?,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val mediaId = app.get(url).document.selectFirst("ul.episodes li a")?.attr("data-id") ?: return
val res = app.get("$mainUrl/ajax/embed/episode/$mediaId/sources").parsedSafe<VidsrctoEpisodeSources>() ?: return
if (res?.status != 200) return
res.result?.amap { source ->
val embedRes = app.get("$mainUrl/ajax/embed/source/${source.id}").parsedSafe<VidsrctoEmbedSource>() ?: return@amap
val finalUrl = DecryptUrl(embedRes.result.encUrl)
when (source.title) {
"Vidplay" -> AnyVidplay(finalUrl.substringBefore("/e/")).getUrl(finalUrl, referer, subtitleCallback, callback)
"Filemoon" -> FileMoon().getUrl(finalUrl, referer, subtitleCallback, callback)
}
}
}
private fun DecryptUrl(encUrl: String): String {
var data = encUrl.toByteArray()
data = Base64.decode(data, Base64.URL_SAFE)
val rc4Key = SecretKeySpec("WXrUARXb1aDLaZjI".toByteArray(), "RC4")
val cipher = Cipher.getInstance("RC4")
cipher.init(Cipher.DECRYPT_MODE, rc4Key, cipher.parameters)
data = cipher.doFinal(data)
return URLDecoder.decode(data.toString(Charsets.UTF_8), "utf-8")
}
data class VidsrctoEpisodeSources(
@JsonProperty("status") val status: Int,
@JsonProperty("result") val result: List<VidsrctoResult>?
)
data class VidsrctoResult(
@JsonProperty("id") val id: String,
@JsonProperty("title") val title: String
)
data class VidsrctoEmbedSource(
@JsonProperty("status") val status: Int,
@JsonProperty("result") val result: VidsrctoUrl
)
data class VidsrctoUrl(@JsonProperty("url") val encUrl: String)
}

View File

@ -13,6 +13,10 @@ import javax.crypto.spec.SecretKeySpec
// Code found in https://github.com/KillerDogeEmpire/vidplay-keys
// special credits to @KillerDogeEmpire for providing key
class AnyVidplay(hostUrl: String) : Vidplay() {
override val mainUrl = hostUrl
}
class MyCloud : Vidplay() {
override val name = "MyCloud"
override val mainUrl = "https://mcloud.bz"

View File

@ -105,6 +105,7 @@ open class TmdbProvider : MainAPI() {
this.id,
episode.episode_number,
episode.season_number,
this.name ?: this.original_name,
).toJson(),
episode.name,
episode.season_number,
@ -122,6 +123,7 @@ open class TmdbProvider : MainAPI() {
this.id,
episodeNum,
season.season_number,
this.name ?: this.original_name,
).toJson(),
season = season.season_number
)

View File

@ -1099,13 +1099,14 @@ class ResultViewModel2 : ViewModel() {
val duplicateEntries = data.filter { it: DataStoreHelper.LibrarySearchResponse ->
val librarySyncData = it.syncData
val yearCheck = year == it.year || year == null || it.year == null
val checks = listOf(
{ imdbId != null && getImdbIdFromSyncData(librarySyncData) == imdbId },
{ tmdbId != null && getTMDbIdFromSyncData(librarySyncData) == tmdbId },
{ malId != null && librarySyncData?.get(AccountManager.malApi.idPrefix) == malId },
{ aniListId != null && librarySyncData?.get(AccountManager.aniListApi.idPrefix) == aniListId },
{ normalizedName == normalizeString(it.name) && year == it.year }
{ normalizedName == normalizeString(it.name) && yearCheck }
)
checks.any { it() }

View File

@ -182,6 +182,7 @@ import com.lagradost.cloudstream3.extractors.Vanfem
import com.lagradost.cloudstream3.extractors.Vicloud
import com.lagradost.cloudstream3.extractors.VidSrcExtractor
import com.lagradost.cloudstream3.extractors.VidSrcExtractor2
import com.lagradost.cloudstream3.extractors.VidSrcTo
import com.lagradost.cloudstream3.extractors.VideoVard
import com.lagradost.cloudstream3.extractors.VideovardSX
import com.lagradost.cloudstream3.extractors.Vidgomunime
@ -872,6 +873,7 @@ val extractorApis: MutableList<ExtractorApi> = arrayListOf(
Streamlare(),
VidSrcExtractor(),
VidSrcExtractor2(),
VidSrcTo(),
PlayLtXyz(),
AStreamHub(),
Vidplay(),