更新 'SrcLive.js'

master
src48597962 6 months ago
parent f89b51eaaa
commit 686eac6990
  1. 55
      SrcLive.js

@ -8,6 +8,7 @@ function Live() {
clearMyVar('JYlivedyurl'); clearMyVar('JYlivedyurl');
clearMyVar('selectgroup'); clearMyVar('selectgroup');
clearMyVar('JYlivelocal'); clearMyVar('JYlivelocal');
clearMyVar('JYlive_datalist');
})); }));
var d = []; var d = [];
@ -74,6 +75,7 @@ function Live() {
url: $("#noLoading#").lazyRule(() => { url: $("#noLoading#").lazyRule(() => {
putMyVar('JYlivedyurl', 'juying'); putMyVar('JYlivedyurl', 'juying');
putMyVar('JYlivelocal', '1'); putMyVar('JYlivelocal', '1');
clearMyVar('JYlive_datalist');
refreshPage(false); refreshPage(false);
return "toast://聚影直播本地源数据"; return "toast://聚影直播本地源数据";
}), }),
@ -92,6 +94,7 @@ function Live() {
putMyVar('JYlivedyurl', dyurl); putMyVar('JYlivedyurl', dyurl);
clearMyVar('JYlivelocal'); clearMyVar('JYlivelocal');
clearMyVar('editmode'); clearMyVar('editmode');
clearMyVar('JYlive_datalist');
refreshPage(false); refreshPage(false);
return "toast://已切换远程订阅:" + dyname; return "toast://已切换远程订阅:" + dyname;
}, dyname, dyurl), }, dyname, dyurl),
@ -106,45 +109,45 @@ function Live() {
col_type: 'line' col_type: 'line'
}) })
} }
let JYlives = [];
if (JYlive) { if (JYlive) {
if (JYlive.indexOf('#genre#') > -1) { if (JYlive.indexOf('#genre#') > -1) {
var JYlives = JYlive.split('\n'); JYlives = JYlive.split('\n');
} else if (JYlive.indexOf('#EXTINF:-1') > -1) { } else if (JYlive.indexOf('#EXTINF:-1') > -1) {
var JYlives = JYlive.split('#EXTINF:-1 '); JYlives = JYlive.split('#EXTINF:-1 ');
} else {
var JYlives = [];
} }
} else {
var JYlives = [];
} }
if (JYlives.length > 0) { if (JYlives.length > 0) {
let datalist = []; let datalist = storage0.getMyVar('JYlive_datalist') || [];
let datalist2 = []; let datalist2 = [];
let group = "";
for (let i = 0; i < JYlives.length; i++) { if(datalist.length == 0){
try { let group = "";
if (JYlive.indexOf('#genre#') > -1) { for (let i = 0; i < JYlives.length; i++) {
if (JYlives[i].indexOf('#genre#') > -1) { try {
group = JYlives[i].split(',')[0]; if (JYlive.indexOf('#genre#') > -1) {
} else if (JYlives[i].indexOf(',') > -1) { if (JYlives[i].indexOf('#genre#') > -1) {
datalist.push({ group: group, name: JYlives[i].split(',')[0].trim() }); group = JYlives[i].split(',')[0];
} else if (JYlives[i].indexOf(',') > -1) {
datalist.push({ group: group, name: JYlives[i].split(',')[0].trim() });
}
} else if (JYlives[i].indexOf('group-title') > -1) {
datalist.push({ group: JYlives[i].match(/group-title="(.*?)"/)[1], name: JYlives[i].match(/",(.*?)\n/)[1] });
} }
} else if (JYlives[i].indexOf('group-title') > -1) { } catch (e) {
datalist.push({ group: JYlives[i].match(/group-title="(.*?)"/)[1], name: JYlives[i].match(/",(.*?)\n/)[1] }); //log(e.message);
} }
} catch (e) {
//log(e.message);
} }
let obj = {};
if (JYlivedyurl == "juying") { putMyVar('JYlivenum', datalist.length); }
datalist = datalist.reduce((newArr, next) => {
obj[next.name] ? "" : (obj[next.name] = true && newArr.push(next));
return newArr;
}, []);
} }
let obj = {};
if (JYlivedyurl == "juying") { putMyVar('JYlivenum', datalist.length); }
datalist = datalist.reduce((newArr, next) => {
obj[next.name] ? "" : (obj[next.name] = true && newArr.push(next));
return newArr;
}, []);
d.push({ d.push({
title: "🔍", title: "🔍",
url: $.toString((guanlidata, datalist) => { url: $.toString((guanlidata, datalist) => {

Loading…
Cancel
Save