更新 'SrcLive.js'

pull/1/head
src48597962 2 years ago
parent 67670c5e6f
commit a751de9f4a
  1. 58
      SrcLive.js

@ -3,11 +3,18 @@ function Live() {
clearMyVar('editmode'); clearMyVar('editmode');
clearMyVar('clearlive'); clearMyVar('clearlive');
clearMyVar('JYlivenum'); clearMyVar('JYlivenum');
clearMyVar('JYlivedyurl');
})); }));
var d = []; var d = [];
let JYlivefile = "hiker://files/rules/Src/Juying/live.txt"; d.push({
let JYlive=fetch(JYlivefile); title: '<b>聚影√</b> &nbsp &nbsp <small>⚙直播设置⚙</small>',
img: "https://img.vinua.cn/images/QqyC.png",
url: $('hiker://empty#noRecordHistory##noHistory#').rule(() => {
require(config.依赖.match(/http(s)?:\/\/.*\//)[0] + 'SrcLive.js');
LiveSet();
}),
col_type: 'avatar'
});
let livecfgfile = "hiker://files/rules/Src/Juying/liveconfig.json"; let livecfgfile = "hiker://files/rules/Src/Juying/liveconfig.json";
let livecfg = fetch(livecfgfile); let livecfg = fetch(livecfgfile);
if(livecfg != ""){ if(livecfg != ""){
@ -16,6 +23,37 @@ function Live() {
var liveconfig = {}; var liveconfig = {};
} }
let livedata = liveconfig['data']||[]; let livedata = liveconfig['data']||[];
let JYlivefile = "hiker://files/rules/Src/Juying/live.txt";
if(livedata.length>0){
for(let i=0;i<livedata.length;i++){
d.push({
title: getMyVar('JYlivedyurl')==livedata[i]?'‘‘’’<b><span style="color:#3399cc">'+livedata[i]:livedata[i],
url: $("#noLoading#").lazyRule(() => {
if(code=="exitedit"){
clearMyVar('editmode');
deleteItemByCls('editmenu');
return "toast://退出编辑,正常观看";
}else{
putMyVar('editmode',code);
}
for(let i in editnames){
if(editnames[i].split('|')[1]==code){
updateItem(code,{title:'‘‘’’<b><span style="color:#3399cc">'+name})
}else{
updateItem(editnames[i].split('|')[1],{title:editnames[i].split('|')[0]})
}
}
return "toast://进入"+name+"模式";
}),
col_type: 'scroll_button'
})
}
}
let JYlive=fetch(JYlivefile);
if(JYlive==""&&livedata.length>0&&getMyVar('clearlive','0')!="1"){ if(JYlive==""&&livedata.length>0&&getMyVar('clearlive','0')!="1"){
showLoading('发现订阅源,正在初始化'); showLoading('发现订阅源,正在初始化');
log('本地源文件为空且有订阅,默认导入第一个订阅'); log('本地源文件为空且有订阅,默认导入第一个订阅');
@ -34,15 +72,7 @@ function Live() {
}else{ }else{
var JYlives = []; var JYlives = [];
} }
d.push({
title: '<b>聚影√</b> &nbsp &nbsp <small>⚙直播设置⚙</small>',
img: "https://img.vinua.cn/images/QqyC.png",
url: $('hiker://empty#noRecordHistory##noHistory#').rule(() => {
require(config.依赖.match(/http(s)?:\/\/.*\//)[0] + 'SrcLive.js');
LiveSet();
}),
col_type: 'avatar'
});
if(JYlives.length>0){ if(JYlives.length>0){
let datalist = []; let datalist = [];
let datalist2 = []; let datalist2 = [];
@ -418,7 +448,7 @@ function LiveSet() {
for(let i=0;i<livedata.length;i++){ for(let i=0;i<livedata.length;i++){
d.push({ d.push({
title: livedata[i], title: livedata[i],
url: $(["更新缓存","删除订阅","导入聚直播","导入聚影√"],2,"").select((livecfgfile, url)=>{ url: $(["更新缓存","删除订阅","导入聚直播","导入聚影√","复制链接"],2,"").select((livecfgfile, url)=>{
try{ try{
if(input=="更新缓存"){ if(input=="更新缓存"){
showLoading('正在缓存,请稍后.'); showLoading('正在缓存,请稍后.');
@ -529,6 +559,8 @@ function LiveSet() {
}else{ }else{
return "toast://文件异常,导入失败"; return "toast://文件异常,导入失败";
} }
}else if(input=="复制链接"){
copy(url);
} }
return "hiker://empty"; return "hiker://empty";
}catch(e){ }catch(e){

Loading…
Cancel
Save