From c7135eadb52723d74de8e0e881767a30cee6797b Mon Sep 17 00:00:00 2001 From: Ahmad Date: Mon, 29 Jan 2024 12:10:36 +0700 Subject: [PATCH] Fix change episode stuck at previous video --- app/build.gradle | 4 +-- app/src/main/assets/inject/9anime_inject.js | 39 ++++++++++++++------- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 8ff0463d..488473df 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "com.amarullz.androidtv.animetvjmto" minSdk 28 targetSdk 33 - versionCode 155 - versionName "1.5.5-beta5" + versionCode 156 + versionName "1.5.6-beta6" // Automatic Build Version buildConfigField "long", "TIMESTAMP", System.currentTimeMillis() + "L" diff --git a/app/src/main/assets/inject/9anime_inject.js b/app/src/main/assets/inject/9anime_inject.js index 792ba467..4253fe40 100644 --- a/app/src/main/assets/inject/9anime_inject.js +++ b/app/src/main/assets/inject/9anime_inject.js @@ -51,6 +51,7 @@ function ___PLAYER(player){ window.__EPGET=function(u){ for (var i=0;i0){ + server_state++; + server[0].click(); + } + } + startFetchTimeout(1); + } function clickNextServer(){ var srcquery=[ "div[data-type=softsub]", @@ -250,7 +263,7 @@ function ___PLAYER(player){ server_state++; var n=server_state-2; - if (n==0||n==1){ + if (n<=1){ var svr=wsvr.querySelector(srcquery[n]); if (svr){ var server=svr.getElementsByTagName('li'); @@ -262,7 +275,9 @@ function ___PLAYER(player){ } } else{ - startFetchTimeout(1); + clickLastServer(); + return; + } clickNextServer(); } @@ -278,17 +293,15 @@ function ___PLAYER(player){ clickNextServer(); } } - else{ - if (server_state==2){ - data.stream_url.soft=player.firstElementChild.src; - console.log("ATVLOG-VIDURL [SOFT] = "+data.stream_url.soft); - clickNextServer(); - } - else{ - console.log("ATVLOG-VIDURL [DUB] = "+data.stream_url.soft); - data.stream_url.dub=player.firstElementChild.src; - startFetchTimeout(1); - } + else if (server_state==2){ + data.stream_url.soft=player.firstElementChild.src; + console.log("ATVLOG-VIDURL [SOFT] = "+data.stream_url.soft); + clickNextServer(); + } + else if(server_state==3){ + console.log("ATVLOG-VIDURL [DUB] = "+data.stream_url.soft); + data.stream_url.dub=player.firstElementChild.src; + clickLastServer(); } }catch(e){} });