更新 'SrcLive.js'

pull/1/head
src48597962 2 years ago
parent 0c3be36384
commit fe697d16d1
  1. 35
      SrcLive.js

@ -33,11 +33,11 @@ function Live() {
if(livedata.length>0){
d.push({
title: '选择👉',
title: '本地👉',
url: $("#noLoading#").lazyRule(() => {
putMyVar('JYlivedyurl','juying');
refreshPage(false);
return "toast://已刷新";
return "toast://聚影直播本地源数据";
}),
col_type: 'scroll_button'
})
@ -49,7 +49,7 @@ function Live() {
url: $("#noLoading#").lazyRule((dyname,dyurl) => {
putMyVar('JYlivedyurl',dyurl);
refreshPage(false);
return "toast://已选择远程订阅:"+dyname;
return "toast://已切换远程订阅:"+dyname;
},dyname,dyurl),
col_type: 'scroll_button'
})
@ -66,8 +66,8 @@ function Live() {
}
let YChtml = readFile('live'+md5(tourl)+'.txt')||request(tourl,{timeout:2000}).replace(/TV-/g,'TV').replace(/\[.*\]/g,'');
if(YChtml.indexOf('#genre#')>-1){
if(!fileExist('live'+md5(livedata[0].url)+'.txt')){
saveFile('live'+md5(livedata[0].url)+'.txt',YChtml);
if(!fileExist('live'+md5(tourl)+'.txt')){
saveFile('live'+md5(tourl)+'.txt',YChtml);
}
if(JYlivedyurl=="juying"){
writeFile(JYlivefile, YChtml);
@ -324,10 +324,22 @@ function guanlidata(datalist) {
img: 'https://lanmeiguojiang.com/tubiao/ke/156.png',
col_type: 'icon_2_round',
url: $('#noLoading#').lazyRule((name) => {
require(config.依赖.match(/http(s)?:\/\/.*\//)[0] + 'SrcLive.js');
LivePlay(name);
},datalist[i].name),
extra: {
id: datalist[i].name,
cls: 'livelist'
}
});
}
return list;
}
function LivePlay(name) {
let JYlivefile= "hiker://files/rules/Src/Juying/live.txt";
let JYlive=fetch(JYlivefile);
let JYlive= getMyVar('JYlivedyurl','juying')=="juying"?fetch(JYlivefile):readFile('live'+md5(getMyVar('JYlivedyurl','juying'))+'.txt');
let JYlives = JYlive.split('\n');
if(!/^url/.test(getMyVar('editmode','0'))){
if(!/^url/.test(getMyVar('editmode','0'))||getMyVar('JYlivedyurl','juying')!="juying"){
let urls = [];
for(let i = 0;i<JYlives.length;i++){
try{
@ -377,16 +389,7 @@ function guanlidata(datalist) {
}
},name,JYlivefile)
}
},datalist[i].name),
extra: {
id: datalist[i].name,
cls: 'livelist'
}
});
}
return list;
}
function LiveSet() {
addListener("onClose", $.toString(() => {
if(getMyVar('isEdit')=="1"){

Loading…
Cancel
Save