Skip to content

Commit

Permalink
Release: Nightly 5.2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
amarullz committed Jul 16, 2024
1 parent 21d371a commit 17723c7
Show file tree
Hide file tree
Showing 9 changed files with 112 additions and 45 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ android {
minSdk 22
targetSdk 34
versionCode 524
versionName "5.2.7-Nightly"
versionName "5.2.8-Nightly"


// Automatic Build Version
Expand Down
36 changes: 35 additions & 1 deletion app/src/main/assets/inject/view_player.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,37 @@
}catch(e){
}
});
function jwgetdata(){
// console.log("ATVLOG jwpget data");
var med=null;
try{
med=__JWP.getConfig().playlist[0];
}catch(ee){}
if (med){
// console.log("ATVLOG jwpget has data");
var dat={
result:{
sources:[
{file:med.sources[0].file}
],
tracks:[]
}
};
for (var i=0;i<med.tracks.length;i++){
dat.result.tracks.push({
kind:med.tracks[i].kind,
file:med.tracks[i].file,
label:med.tracks[i].label
});
}
window.__JWMEDIA=dat;
// console.log("ATVLOG Got Data: "+JSON.stringify(dat));
$p('mediainfo',dat);
}
else{
setTimeout(jwgetdata,200);
}
}
function initjw(){
console.log("ATVLOG initjw");
__JWP.setControls(0);
Expand Down Expand Up @@ -127,13 +158,15 @@
__VID=vid[0];
__JWP=pl;
initjw();
jwgetdata();
return;
}
}
}
setTimeout(findjw,200);
}

/*
if (location.hash!='#NOPLAY'){
findjw();
try{
Expand All @@ -146,6 +179,7 @@
__NOPLAY=true;
console.log("NOPLAY");
}

*/
findjw();
})();
</script>
40 changes: 34 additions & 6 deletions app/src/main/assets/view/m.js
Original file line number Diff line number Diff line change
Expand Up @@ -1862,10 +1862,10 @@ const wave={
wave.filemoonGetData(u,cb);
return;
}
// else{
// cb(null);
// return;
// }
else{
cb(null);
return;
}

wave.vidplayGetMedia(u,function(url){
if (url){
Expand Down Expand Up @@ -2362,6 +2362,7 @@ window.addEventListener('message',function(e) {
// };

window.__M3U8CB=function(d){
window.__MDATA=(d);
if(_API.m3u8cb)
_API.m3u8cb(d);
};
Expand Down Expand Up @@ -2443,6 +2444,11 @@ const _API={
var pd=JSON.parse(e.data);
if (pd){
if ('vcmd' in pd){
if (pd.vcmd=='mediainfo'){
// _API.showToast("Got MediaInfo Event 2");
window.__M3U8CB(pd.val);
return;
}
if (pd.vcmd!='time'){
console.log("PLAYER-MSG = "+e.data);
}
Expand Down Expand Up @@ -6357,7 +6363,11 @@ const pb={
}
},
vid_event:function(c,v){
if (c=='complete'){
if (c=='mediainfo'){
// _API.showToast("Got MediaInfo Event");
window.__M3U8CB(v);
}
else if (c=='complete'){
if (pb.pb_track_ctl.innerHTML!='replay'){
vtt.playback.buffering_set(false);
pb.vid_stat.play=false;
Expand Down Expand Up @@ -6923,6 +6933,24 @@ const pb={

var mp3utrycount=0;

if (!_ISELECTRON){
_API.setMessage(function(e){
if (e){
// _API.showToast("Got Win Message "+e.data);
// console.log("ATVLOG WinMSG = "+e.data);
try{
var pd=JSON.parse(e.data);
if (pd){
if ('vcmd' in pd){
pb.vid_event(pd.vcmd,pd.val);
}
}
}catch(x){
}
}
});
}

_API.setVizPageCb(function(d){
if (d==0)
pb.pb_track_pos.innerHTML='INITIALIZING';
Expand Down Expand Up @@ -7394,7 +7422,7 @@ const pb={
}
}
_API.setVizCb(preloadVidCb);
$n('iframe','',{src:d.stream_vurl+(__SD5?"":"#NOPLAY"),frameborder:'0'},pb.pb_vid,'');
$n('iframe','',{src:d.stream_vurl+(__SD5?"":""),frameborder:'0'},pb.pb_vid,'');
});
// $n('iframe','',{src:d.stream_vurl+(__SD5?"":"#NOPLAY"),frameborder:'0'},pb.pb_vid,'');
}
Expand Down
38 changes: 20 additions & 18 deletions app/src/main/java/com/amarullz/androidtv/animetvjmto/AnimeView.java
Original file line number Diff line number Diff line change
Expand Up @@ -1074,11 +1074,11 @@ else if (host.equals(Conf.SOURCE_DOMAIN5_API)){
else if (host.contains(Conf.STREAM_DOMAIN)
||host.contains(Conf.STREAM_DOMAIN1)
||host.contains(Conf.STREAM_DOMAIN2)){
if (accept.startsWith("text/html")||
url.startsWith("https://"+host+"/mediainfo")) {
if (accept.startsWith("text/html")/*||
url.startsWith("https://"+host+"/mediainfo")*/) {
Log.d(_TAG,"VIEW PLAYER REQ = "+url);
if (!accept.startsWith("text/html"))
sendVidpageLoaded(1);
// if (!accept.startsWith("text/html"))
// sendVidpageLoaded(1);
try {
AnimeApi.Http http=new AnimeApi.Http(url);
for (Map.Entry<String, String> entry :
Expand All @@ -1091,26 +1091,28 @@ else if (host.contains(Conf.STREAM_DOMAIN)
if (accept.startsWith("text/html")) {
try {
aApi.injectString(http.body, playerInjectString);
sendVidpageLoaded(1);
}catch(Exception ignored){}
sendVidpageLoaded(0);
} else {
Log.d(_TAG, "sendM3U8Req = " + http.body.toString("UTF-8"));
sendM3U8Req(http.body.toString("UTF-8"));
try {
Thread.sleep(200);
}catch(Exception ignored){}
Log.d(_TAG, "sendM3U8Req Wait = " + http.body.toString("UTF-8"));
// sendVidpageLoaded(0);
}
// else {
// Log.d(_TAG, "sendM3U8Req = " + http.body.toString("UTF-8"));
// sendM3U8Req(http.body.toString("UTF-8"));
// try {
// Thread.sleep(200);
// }catch(Exception ignored){}
// Log.d(_TAG, "sendM3U8Req Wait = " + http.body.toString("UTF-8"));
// }
InputStream stream = new ByteArrayInputStream(http.body.toByteArray());
return new WebResourceResponse(http.ctype[0], http.ctype[1], stream);
}
} catch (Exception ignored) {}
if (!accept.startsWith("text/html"))
sendVidpageLoaded(2);
else {
sendVidpageLoaded(3);
return null;
}
// if (!accept.startsWith("text/html"))
// sendVidpageLoaded(2);
// else {
// sendVidpageLoaded(3);
// return null;
// }
return aApi.badRequest;
}else if (accept.startsWith("text/css")||accept.startsWith("image/")){
Log.d(_TAG,"BLOCK CSS/IMG = "+url);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ public static String getDomain(){
// " (KHTML, like Gecko) Chrome/119.0.0.0 " +
// "Safari/537.36 Edg/116.0.1938.69";

"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0";
// "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0";

"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0";

// "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like " +
// "Gecko) Chrome/122.0.0.0 Safari/537.36";
Expand Down
3 changes: 2 additions & 1 deletion electron/src/libs/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ const { pathToFileURL } = require('url')
const fs = require("fs");

const common={
UAG:"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0",
UAG: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0",
// "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0",
dns:[
"aniwave.to", /* default */
"aniwave.to",
Expand Down
10 changes: 5 additions & 5 deletions electron/src/libs/intercept.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,11 +387,11 @@ const intercept={
req.headers.set('Origin','https://'+url.hostname);
req.headers.set('Referer','https://'+url.hostname+'/');
let f=intercept.fetchStream(req);
if (url.pathname.startsWith("/mediainfo")){
let body=await (await f).text();
common.execJs("__M3U8CB("+body+");");
return intercept.fetchError();
}
// if (url.pathname.startsWith("/mediainfo")){
// let body=await (await f).text();
// common.execJs("__M3U8CB("+body+");");
// return intercept.fetchError();
// }
return f;
}
}
Expand Down
22 changes: 11 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "animetv",
"version": "5.2.7",
"version": "5.2.8",
"description": "AnimeTV for Desktop",
"main": "electron/src/animetv.js",
"scripts": {
Expand Down

0 comments on commit 17723c7

Please sign in to comment.