Skip to content

Commit a1ba305

Browse files
update dependencies
1 parent 86d4fd4 commit a1ba305

7 files changed

Lines changed: 532 additions & 0 deletions

File tree

.github/workflows/update-token.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Auto Grab Kuramanime Token
2+
3+
on:
4+
schedule:
5+
- cron: '0 */3 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
grab-token:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout Repositori
13+
uses: actions/checkout@v3
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: '18'
19+
20+
- name: Install Puppeteer & Stealth
21+
run: |
22+
npm init -y
23+
npm install puppeteer puppeteer-extra puppeteer-extra-plugin-stealth
24+
25+
- name: Run Scraper
26+
run: node scraper.js
27+
28+
- name: Commit & Push Token ke Repo
29+
run: |
30+
git config --global user.name 'github-actions[bot]'
31+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
32+
git add kurama_token.txt
33+
git commit -m "Auto-update token Kuramanime" || echo "Token is still the same"
34+
git push
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// use an integer for version numbers
2+
version = 1
3+
4+
5+
cloudstream {
6+
language = "id"
7+
// All of these properties are optional, you can safely remove them
8+
9+
description = "Test"
10+
authors = listOf("Miku")
11+
12+
/**
13+
* Status int as the following:
14+
* 0: Down
15+
* 1: Ok
16+
* 2: Slow
17+
* 3: Beta only
18+
* */
19+
status = 1 // will be 3 if unspecified
20+
tvTypes = listOf(
21+
"AnimeMovie",
22+
"Anime",
23+
"OVA",
24+
)
25+
26+
iconUrl = "https://www.google.com/s2/favicons?domain=kuramanime.com&sz=%size%"
27+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest package="com.hexated"/>
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
package com.hexated
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty
4+
import com.lagradost.cloudstream3.SubtitleFile
5+
import com.lagradost.cloudstream3.app
6+
import com.lagradost.cloudstream3.extractors.FilemoonV2
7+
import com.lagradost.cloudstream3.extractors.Filesim
8+
import com.lagradost.cloudstream3.extractors.StreamSB
9+
import com.lagradost.cloudstream3.utils.ExtractorApi
10+
import com.lagradost.cloudstream3.utils.ExtractorLink
11+
import com.lagradost.cloudstream3.utils.INFER_TYPE
12+
import com.lagradost.cloudstream3.utils.Qualities
13+
import com.lagradost.cloudstream3.utils.getQualityFromName
14+
import com.lagradost.cloudstream3.utils.newExtractorLink
15+
16+
class Sunrong : FilemoonV2() {
17+
override var mainUrl = "https://sunrong.my.id"
18+
override var name = "Sunrong"
19+
}
20+
21+
class Nyomo : StreamSB() {
22+
override var name: String = "Nyomo"
23+
override var mainUrl = "https://nyomo.my.id"
24+
}
25+
26+
class Streamhide : Filesim() {
27+
override var name: String = "Streamhide"
28+
override var mainUrl: String = "https://streamhide.to"
29+
}
30+
31+
open class Lbx : ExtractorApi() {
32+
override val name = "Linkbox"
33+
override val mainUrl = "https://lbx.to"
34+
private val realUrl = "https://www.linkbox.to"
35+
override val requiresReferer = true
36+
37+
override suspend fun getUrl(
38+
url: String,
39+
referer: String?,
40+
subtitleCallback: (SubtitleFile) -> Unit,
41+
callback: (ExtractorLink) -> Unit
42+
) {
43+
val token = Regex("(?:/f/|/file/|\\?id=)(\\w+)").find(url)?.groupValues?.get(1) ?: return
44+
45+
val response = app.get("$realUrl/api/file/share_out_list/?sortField=utime&sortAsc=0&pageNo=1&pageSize=50&shareToken=$token")
46+
.parsedSafe<Responses>()
47+
48+
val itemId = response?.data?.itemId ?: return
49+
50+
app.get("$realUrl/api/file/detail?itemId=$itemId", referer = url)
51+
.parsedSafe<Responses>()?.data?.itemInfo?.resolutionList?.forEach { link ->
52+
val resolvedUrl = link.url ?: return@forEach
53+
callback.invoke(
54+
newExtractorLink(
55+
name,
56+
name,
57+
resolvedUrl,
58+
INFER_TYPE
59+
) {
60+
this.referer = "$realUrl/"
61+
this.quality = getQualityFromName(link.resolution)
62+
}
63+
)
64+
}
65+
}
66+
67+
data class Resolutions(
68+
@JsonProperty("url") val url: String? = null,
69+
@JsonProperty("resolution") val resolution: String? = null,
70+
)
71+
72+
data class ItemInfo(
73+
@JsonProperty("resolutionList") val resolutionList: ArrayList<Resolutions>? = arrayListOf(),
74+
)
75+
76+
data class Data(
77+
@JsonProperty("itemInfo") val itemInfo: ItemInfo? = null,
78+
@JsonProperty("itemId") val itemId: String? = null,
79+
)
80+
81+
data class Responses(
82+
@JsonProperty("data") val data: Data? = null,
83+
)
84+
}
85+
86+
open class Kuramadrive : ExtractorApi() {
87+
override val name = "DriveKurama"
88+
override val mainUrl = "https://kuramadrive.com"
89+
override val requiresReferer = true
90+
91+
override suspend fun getUrl(
92+
url: String,
93+
referer: String?,
94+
subtitleCallback: (SubtitleFile) -> Unit,
95+
callback: (ExtractorLink) -> Unit
96+
) {
97+
val req = app.get(url, referer = referer)
98+
val doc = req.document
99+
val title = doc.select("title").text()
100+
val token = doc.select("meta[name=csrf-token]").attr("content")
101+
val routeCheckAvl = doc.select("input#routeCheckAvl").attr("value")
102+
103+
if (routeCheckAvl.isNullOrEmpty()) return
104+
105+
val json = app.get(
106+
routeCheckAvl, headers = mapOf(
107+
"X-Requested-With" to "XMLHttpRequest",
108+
"X-CSRF-TOKEN" to token
109+
),
110+
referer = url,
111+
cookies = req.cookies
112+
).parsedSafe<Source>()
113+
114+
if (json?.url != null) {
115+
callback.invoke(
116+
newExtractorLink(
117+
name,
118+
name,
119+
json.url,
120+
INFER_TYPE
121+
) {
122+
this.referer = "$mainUrl/"
123+
this.quality = getIndexQuality(title)
124+
}
125+
)
126+
}
127+
}
128+
129+
private fun getIndexQuality(str: String?): Int {
130+
return Regex("(\\d{3,4})[pP]").find(str ?: "")?.groupValues?.getOrNull(1)?.toIntOrNull()
131+
?: Qualities.Unknown.value
132+
}
133+
134+
private data class Source(
135+
@JsonProperty("url") val url: String? = null,
136+
)
137+
}

0 commit comments

Comments
 (0)