Skip to content

Commit

Permalink
Fix change episode stuck at previous video
Browse files Browse the repository at this point in the history
  • Loading branch information
amarullz committed Jan 29, 2024
1 parent 556756a commit c7135ea
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 15 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
39 changes: 26 additions & 13 deletions app/src/main/assets/inject/9anime_inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ function ___PLAYER(player){
window.__EPGET=function(u){
for (var i=0;i<episode_el.length;i++){
if (u==episode_el[i].href){
server_state=1;
episode_el[i].click();
return true;
}
Expand Down Expand Up @@ -241,6 +242,18 @@ function ___PLAYER(player){
}
setTimeout(clickServer,5);
}
function clickLastServer(){
var wsvr=$('w-servers');
var svr=wsvr.querySelector("div[data-type=sub]");
if (svr){
var server=svr.getElementsByTagName('li');
if (server.length>0){
server_state++;
server[0].click();
}
}
startFetchTimeout(1);
}
function clickNextServer(){
var srcquery=[
"div[data-type=softsub]",
Expand All @@ -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');
Expand All @@ -262,7 +275,9 @@ function ___PLAYER(player){
}
}
else{
startFetchTimeout(1);
clickLastServer();
return;

}
clickNextServer();
}
Expand All @@ -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){}
});
Expand Down

0 comments on commit c7135ea

Please sign in to comment.