Skip to content

Commit b767297

Browse files
improvement
1 parent 0bf006f commit b767297

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

DubbindoProvider/src/main/kotlin/com/dubbindo/DubbindoProvider.kt

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ class DubbindoProvider : MainAPI() {
3131

3232
private var sessionCookie = ""
3333

34-
private val subscribedChannelIds = mutableSetOf<String>()
35-
3634
private val baseHeaders get() = mapOf(
3735
"User-Agent" to "Mozilla/5.0 (Linux; Android 10; Mobile) AppleWebKit/537.36 Chrome/124.0 Mobile Safari/537.36",
3836
"Referer" to "$mainUrl/"
@@ -102,8 +100,6 @@ class DubbindoProvider : MainAPI() {
102100

103101
if (channelId.isBlank()) return false
104102

105-
if (channelId in subscribedChannelIds) return true
106-
107103
val mainSession = document
108104
.selectFirst("input.main_session")?.attr("value")?.trim()
109105
.orEmpty()
@@ -126,8 +122,6 @@ class DubbindoProvider : MainAPI() {
126122

127123
if (!resp.isSuccessful) return false
128124

129-
subscribedChannelIds.add(channelId)
130-
131125
val muteUrl = if (mainSession.isNotBlank())
132126
"$mainUrl/aj/user/notify?hash=$mainSession"
133127
else
@@ -148,12 +142,12 @@ class DubbindoProvider : MainAPI() {
148142
}
149143

150144
private fun isSubscribeWall(document: Document): Boolean {
151-
if (isVideoInQueue(document)) return false
152-
val playerArea = document.selectFirst("div.video-player")?.text().orEmpty()
145+
val playerArea = document.selectFirst("div.video-processing, div.video-player")
146+
?.text().orEmpty()
153147
return playerArea.contains("subscribe to watch", ignoreCase = true) ||
154148
document.select("video#my-video source, video source").isEmpty()
155149
}
156-
150+
157151
private fun isVideoInQueue(document: Document): Boolean =
158152
document.selectFirst("div.pt_video_player div.video-processing") != null
159153

@@ -290,7 +284,7 @@ class DubbindoProvider : MainAPI() {
290284
.text().replace("\u2063", "").trim()
291285
val recommendations = document.select("div.related-video-wrapper")
292286
.mapNotNull { it.toRelatedResult() }
293-
287+
294288
if (isVideoInQueue(document)) {
295289
return newMovieLoadResponse(title, url, TvType.Movie, "[]") {
296290
posterUrl = poster

0 commit comments

Comments
 (0)