Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 7f3f340

Browse files
Merge pull request #218 from usdogu/fix-warnings
Fix warnings
2 parents ba8aecf + 52fb33f commit 7f3f340

File tree

86 files changed

+773
-1001
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+773
-1001
lines changed

AnimeciX/src/main/kotlin/com/keyiflerolsun/AnimeciX.kt

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ class AnimeciX : MainAPI() {
1414
override val hasMainPage = true
1515
override var lang = "tr"
1616
override val hasQuickSearch = false
17-
override val hasChromecastSupport = true
18-
override val hasDownloadSupport = true
1917
override val supportedTypes = setOf(TvType.Anime)
2018

2119
override var sequentialMainPage = true // * https://recloudstream.github.io/dokka/-cloudstream/com.lagradost.cloudstream3/-main-a-p-i/index.html#-2049735995%2FProperties%2F101969414
@@ -35,7 +33,7 @@ class AnimeciX : MainAPI() {
3533
)
3634
).parsedSafe<Category>()
3735

38-
val home = response?.pagination?.data?.mapNotNull { anime ->
36+
val home = response?.pagination?.data?.map { anime ->
3937
newAnimeSearchResponse(
4038
anime.title,
4139
"${mainUrl}/secure/titles/${anime.id}?titleId=${anime.id}",
@@ -49,9 +47,9 @@ class AnimeciX : MainAPI() {
4947
}
5048

5149
override suspend fun search(query: String): List<SearchResponse> {
52-
val response = app.get("${mainUrl}/secure/search/${query}?limit=20").parsedSafe<Search>() ?: return listOf<SearchResponse>()
50+
val response = app.get("${mainUrl}/secure/search/${query}?limit=20").parsedSafe<Search>() ?: return listOf()
5351

54-
return response.results.mapNotNull { anime ->
52+
return response.results.map { anime ->
5553
newAnimeSearchResponse(
5654
anime.title,
5755
"${mainUrl}/secure/titles/${anime.id}?titleId=${anime.id}",
@@ -71,30 +69,27 @@ class AnimeciX : MainAPI() {
7169
"x-e-h" to "7Y2ozlO+QysR5w9Q6Tupmtvl9jJp7ThFH8SB+Lo7NvZjgjqRSqOgcT2v4ISM9sP10LmnlYI8WQ==.xrlyOBFS5BHjQ2Lk"
7270
)
7371
).parsedSafe<Title>() ?: return null
74-
7572
val episodes = mutableListOf<Episode>()
7673
val titleId = url.substringAfter("?titleId=")
7774

78-
if (response.title.title_type == "anime") {
75+
if (response.title.titleType == "anime") {
7976
for (sezon in response.title.seasons) {
8077
val sezonResponse = app.get("${mainUrl}/secure/related-videos?episode=1&season=${sezon.number}&videoId=0&titleId=${titleId}").parsedSafe<TitleVideos>() ?: return null
8178
for (video in sezonResponse.videos) {
82-
episodes.add(Episode(
83-
data = video.url,
84-
name = "${video.season_num}. Sezon ${video.episode_num}. Bölüm",
85-
season = video.season_num,
86-
episode = video.episode_num
87-
))
79+
episodes.add(newEpisode(video.url) {
80+
this.name = "${video.seasonNum}. Sezon ${video.episodeNum}. Bölüm"
81+
this.season = video.seasonNum
82+
this.episode = video.episodeNum
83+
})
8884
}
8985
}
9086
} else {
91-
if (response.title.videos.isNotEmpty() == true) {
92-
episodes.add(Episode(
93-
data = response.title.videos.first().url,
94-
name = "Filmi İzle",
95-
season = 1,
96-
episode = 1
97-
))
87+
if (response.title.videos.isNotEmpty()) {
88+
episodes.add(newEpisode(response.title.videos.first().url) {
89+
this.name = "Filmi İzle"
90+
this.season = 1
91+
this.episode = 1
92+
})
9893
}
9994
}
10095

@@ -108,17 +103,17 @@ class AnimeciX : MainAPI() {
108103
this.posterUrl = fixUrlNull(response.title.poster)
109104
this.year = response.title.year
110105
this.plot = response.title.description
111-
this.tags = response.title.tags.filterNotNull().map { it.name }
106+
this.tags = response.title.tags.map { it.name }
112107
this.rating = response.title.rating.toRatingInt()
113-
addActors(response.title.actors.filterNotNull().map { Actor(it.name, fixUrlNull(it.poster)) })
108+
addActors(response.title.actors.map { Actor(it.name, fixUrlNull(it.poster)) })
114109
addTrailer(response.title.trailer)
115110
}
116111
}
117112

118113
override suspend fun loadLinks(data: String, isCasting: Boolean, subtitleCallback: (SubtitleFile) -> Unit, callback: (ExtractorLink) -> Unit): Boolean {
119-
Log.d("ACX", "data » ${data}")
120-
val iframeLink = app.get("${mainUrl}/${data}", referer="${mainUrl}/").url.toString()
121-
Log.d("ACX", "iframeLink » ${iframeLink}")
114+
Log.d("ACX", "data » $data")
115+
val iframeLink = app.get("${mainUrl}/${data}", referer="${mainUrl}/").url
116+
Log.d("ACX", "iframeLink » $iframeLink")
122117

123118
loadExtractor(iframeLink, "${mainUrl}/", subtitleCallback, callback)
124119

AnimeciX/src/main/kotlin/com/keyiflerolsun/AnimeciXModels.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@ data class Title(
1818
)
1919

2020
data class Pagination(
21-
@JsonProperty("current_page") val current_page: Int,
22-
@JsonProperty("last_page") val last_page: Int,
23-
@JsonProperty("per_page") val per_page: Int,
21+
@JsonProperty("current_page") val currentPage: Int,
22+
@JsonProperty("last_page") val lastPage: Int,
23+
@JsonProperty("per_page") val perPage: Int,
2424
@JsonProperty("data") val data: List<AnimeSearch>,
2525
@JsonProperty("total") val total: Int,
2626
)
2727

2828
data class AnimeSearch(
2929
@JsonProperty("id") val id: Int,
30-
@JsonProperty("title_type") val title_type: String,
30+
@JsonProperty("title_type") val titleType: String,
3131
@JsonProperty("name") val title: String,
3232
@JsonProperty("poster") val poster: String?,
3333
)
3434

3535
data class Anime(
3636
@JsonProperty("id") val id: Int,
37-
@JsonProperty("title_type") val title_type: String,
37+
@JsonProperty("title_type") val titleType: String,
3838
@JsonProperty("name") val title: String,
3939
@JsonProperty("poster") val poster: String,
4040
@JsonProperty("description") val description: String,
@@ -43,7 +43,7 @@ data class Anime(
4343
@JsonProperty("genres") val tags: List<Genre>,
4444
@JsonProperty("trailer") val trailer: String?,
4545
@JsonProperty("credits") val actors: List<Credit>,
46-
@JsonProperty("season_count") val season_count: Int, //Unrealiable?
46+
@JsonProperty("season_count") val seasonCount: Int, //Unrealiable?
4747
@JsonProperty("seasons") val seasons: List<Season>,
4848
@JsonProperty("videos") val videos: List<Video>
4949
)
@@ -58,8 +58,8 @@ data class Credit(
5858
)
5959

6060
data class Video(
61-
@JsonProperty("episode_num") val episode_num: Int?,
62-
@JsonProperty("season_num") val season_num: Int?,
61+
@JsonProperty("episode_num") val episodeNum: Int?,
62+
@JsonProperty("season_num") val seasonNum: Int?,
6363
@JsonProperty("url") val url: String,
6464
)
6565

AnimeciX/src/main/kotlin/com/keyiflerolsun/TauVideoExtractor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ open class TauVideo : ExtractorApi() {
1616
val extRef = referer ?: ""
1717
val videoKey = url.split("/").last()
1818
val videoUrl = "${mainUrl}/api/video/${videoKey}"
19-
Log.d("Kekik_${this.name}", "videoUrl » ${videoUrl}")
19+
Log.d("Kekik_${this.name}", "videoUrl » $videoUrl")
2020

2121
val api = app.get(videoUrl).parsedSafe<TauVideoUrls>() ?: throw ErrorLoadingException("TauVideo")
2222

BelgeselX/src/main/kotlin/com/keyiflerolsun/BelgeselX.kt

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ class BelgeselX : MainAPI() {
1414
override val hasMainPage = true
1515
override var lang = "tr"
1616
override val hasQuickSearch = false
17-
override val hasChromecastSupport = true
18-
override val hasDownloadSupport = true
1917
override val supportedTypes = setOf(TvType.Documentary)
2018

2119
override val mainPage = mainPageOf(
@@ -66,26 +64,27 @@ class BelgeselX : MainAPI() {
6664
val cx = "016376594590146270301:iwmy65ijgrm" // ! Might change in the future
6765

6866
val tokenResponse = app.get("https://cse.google.com/cse.js?cx=${cx}")
69-
val cseLibVersion = Regex("""cselibVersion\": \"(.*)\"""").find(tokenResponse.text)?.groupValues?.get(1)
70-
val cseToken = Regex("""cse_token\": \"(.*)\"""").find(tokenResponse.text)?.groupValues?.get(1)
67+
val cseLibVersion = Regex("""cselibVersion": "(.*)"""").find(tokenResponse.text)?.groupValues?.get(1)
68+
val cseToken = Regex("""cse_token": "(.*)"""").find(tokenResponse.text)?.groupValues?.get(1)
7169

7270
val response = app.get("https://cse.google.com/cse/element/v1?rsz=filtered_cse&num=100&hl=tr&source=gcsc&cselibv=${cseLibVersion}&cx=${cx}&q=${query}&safe=off&cse_tok=${cseToken}&oq=${query}&callback=google.search.cse.api9969&rurl=https%3A%2F%2Fbelgeselx.com%2F")
7371
Log.d("BLX","Search result: ${response.text}")
7472

75-
val titles = Regex("""\"titleNoFormatting\": \"(.*)\"""").findAll(response.text).map { it.groupValues[1] }.toList()
76-
val urls = Regex("""\"url\": \"(.*)\"""").findAll(response.text).map { it.groupValues[1] }.toList()
77-
val posterUrls = Regex("""\"ogImage\": \"(.*)\"""").findAll(response.text).map { it.groupValues[1] }.toList()
73+
val titles = Regex(""""titleNoFormatting": "(.*)"""").findAll(response.text).map { it.groupValues[1] }.toList()
74+
val urls = Regex(""""url": "(.*)"""").findAll(response.text).map { it.groupValues[1] }.toList()
75+
val posterUrls = Regex(""""ogImage": "(.*)"""").findAll(response.text).map { it.groupValues[1] }.toList()
7876

7977
val searchResponses = mutableListOf<TvSeriesSearchResponse>()
8078

8179
for (i in titles.indices) {
82-
val title = titles[i].split("İzle")[0].trim()?.toTitleCase() ?: continue
80+
val title = titles[i].split("İzle")[0].trim().toTitleCase()
8381
val url = urls.getOrNull(i) ?: continue
8482
val posterUrl = posterUrls.getOrNull(i) ?: continue
8583

8684
if(!url.contains("belgeseldizi")) continue
87-
88-
searchResponses.add(TvSeriesSearchResponse(title, url,this.name, posterUrl = posterUrl))
85+
searchResponses.add(newTvSeriesSearchResponse(title,url,TvType.Documentary) {
86+
this.posterUrl = posterUrl
87+
})
8988
}
9089

9190
return searchResponses
@@ -108,18 +107,17 @@ class BelgeselX : MainAPI() {
108107

109108
val seasonName = it.selectFirst("div.gen-single-meta-holder ul li")?.text()?.trim() ?: ""
110109
var epEpisode = Regex("""Bölüm (\d+)""").find(seasonName)?.groupValues?.get(1)?.toIntOrNull() ?: 0
111-
var epSeason = Regex("""Sezon (\d+)""").find(seasonName)?.groupValues?.get(1)?.toIntOrNull() ?: 1
110+
val epSeason = Regex("""Sezon (\d+)""").find(seasonName)?.groupValues?.get(1)?.toIntOrNull() ?: 1
112111

113112
if (epEpisode == 0) {
114113
epEpisode = counter++
115114
}
116115

117-
Episode(
118-
data = epHref,
119-
name = epName,
120-
season = epSeason,
121-
episode = epEpisode
122-
)
116+
newEpisode(epHref) {
117+
this.name = epName
118+
this.season = epSeason
119+
this.episode = epEpisode
120+
}
123121
}
124122

125123
return newTvSeriesLoadResponse(title, url, TvType.Documentary, episodes) {
@@ -130,25 +128,25 @@ class BelgeselX : MainAPI() {
130128
}
131129

132130
override suspend fun loadLinks(data: String, isCasting: Boolean, subtitleCallback: (SubtitleFile) -> Unit, callback: (ExtractorLink) -> Unit): Boolean {
133-
Log.d("BLX", "data » ${data}")
131+
Log.d("BLX", "data » $data")
134132
val source = app.get(data)
135133

136-
Regex("""<iframe\s+[^>]*src=\\\"([^\\\"']+)\\\"""").findAll(source.text).forEach {
137-
val alternatifUrl = it.groupValues[1]
138-
Log.d("BLX", "alternatifUrl » ${alternatifUrl}")
134+
Regex("""<iframe\s+[^>]*src=\\"([^\\"']+)\\"""").findAll(source.text).forEach { alternatifUrlMatchResult ->
135+
val alternatifUrl = alternatifUrlMatchResult.groupValues[1]
136+
Log.d("BLX", "alternatifUrl » $alternatifUrl")
139137
val alternatifResp = app.get(alternatifUrl, referer=data)
140138

141139
if (alternatifUrl.contains("new4.php")) {
142-
Regex("""file:\"([^\"]+)\", label: \"([^\"]+)""").findAll(alternatifResp.text).forEach {
140+
Regex("""file:"([^"]+)", label: "([^"]+)""").findAll(alternatifResp.text).forEach {
143141
var thisName = this.name
144-
var videoUrl = it.groupValues[1]
142+
val videoUrl = it.groupValues[1]
145143
var quality = it.groupValues[2]
146144
if (quality == "FULL") {
147145
quality = "1080p"
148146
thisName = "Google"
149147
}
150-
Log.d("BLX", "quality » ${quality}")
151-
Log.d("BLX", "videoUrl » ${videoUrl}")
148+
Log.d("BLX", "quality » $quality")
149+
Log.d("BLX", "videoUrl » $videoUrl")
152150

153151
callback.invoke(
154152
ExtractorLink(
@@ -163,7 +161,7 @@ class BelgeselX : MainAPI() {
163161
}
164162
} else {
165163
val iframe = fixUrlNull(alternatifResp.document.selectFirst("iframe")?.attr("src")) ?: return@forEach
166-
Log.d("BLX", "iframe » ${iframe}")
164+
Log.d("BLX", "iframe » $iframe")
167165

168166
loadExtractor(iframe, "${mainUrl}/", subtitleCallback, callback)
169167
}

BelgeselX/src/main/kotlin/com/keyiflerolsun/OdnoklassnikiExtractor.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,19 @@ open class Odnoklassniki : ExtractorApi() {
1313
override val requiresReferer = false
1414

1515
override suspend fun getUrl(url: String, referer: String?, subtitleCallback: (SubtitleFile) -> Unit, callback: (ExtractorLink) -> Unit) {
16-
val extRef = referer ?: ""
17-
Log.d("Kekik_${this.name}", "url » ${url}")
16+
Log.d("Kekik_${this.name}", "url » $url")
1817

1918
val userAgent = mapOf("User-Agent" to "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Mobile Safari/537.36")
2019

2120
val videoReq = app.get(url, headers=userAgent).text.replace("\\&quot;", "\"").replace("\\\\", "\\")
2221
.replace(Regex("\\\\u([0-9A-Fa-f]{4})")) { matchResult ->
2322
Integer.parseInt(matchResult.groupValues[1], 16).toChar().toString()
2423
}
25-
val videosStr = Regex("""\"videos\":(\[[^\]]*\])""").find(videoReq)?.groupValues?.get(1) ?: throw ErrorLoadingException("Video not found")
24+
val videosStr = Regex(""""videos":(\[[^]]*])""").find(videoReq)?.groupValues?.get(1) ?: throw ErrorLoadingException("Video not found")
2625
val videos = AppUtils.tryParseJson<List<OkRuVideo>>(videosStr) ?: throw ErrorLoadingException("Video not found")
2726

2827
for (video in videos) {
29-
Log.d("Kekik_${this.name}", "video » ${video}")
28+
Log.d("Kekik_${this.name}", "video » $video")
3029

3130
val videoUrl = if (video.url.startsWith("//")) "https:${video.url}" else video.url
3231

0 commit comments

Comments
 (0)