Skip to content

Commit

Permalink
anitubeinua: Fix ajax request for episode urls
Browse files Browse the repository at this point in the history
  • Loading branch information
CakesTwix committed Apr 9, 2024
1 parent eca1492 commit 0c99673
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion AnitubeinuaProvider/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// use an integer for version numbers
version = 8
version = 9


cloudstream {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class AnitubeinuaProvider : MainAPI() {
"$mainUrl/f/sort=rating/order=desc/page/" to "Популярні",
)

private var dle_login_hash = ""

override suspend fun getMainPage(page: Int, request: MainPageRequest): HomePageResponse {
val document = app.get(request.data + page).document

Expand Down Expand Up @@ -105,7 +107,7 @@ class AnitubeinuaProvider : MainAPI() {
val subEpisodes = mutableListOf<Episode>()
val dubEpisodes = mutableListOf<Episode>()
val id = url.split("/").last().split("-").first()
val dle_login_hash = document.body().selectFirst("script")!!.html()
dle_login_hash = document.body().selectFirst("script")!!.html()
.substringAfterLast("dle_login_hash = '")
.substringBefore("';")

Expand Down Expand Up @@ -188,10 +190,9 @@ class AnitubeinuaProvider : MainAPI() {
val dataList = data.split(", ")
// Log.d("CakesTwix-Debug", data)
if (dataList[1].toIntOrNull() != null) { // Its ajax list

val ajax =
fromPlaylistAjax(
"$mainUrl/engine/ajax/playlists.php?news_id=${dataList[1]}&xfield=playlist&time=${Date().time}"
"$mainUrl/engine/ajax/playlists.php?news_id=${dataList[1]}&xfield=playlist&user_hash=$dle_login_hash"
)

// Filter by name and isDub
Expand Down

0 comments on commit 0c99673

Please sign in to comment.