From d7795bbfd282bba7bf3e79a60318a091ab769505 Mon Sep 17 00:00:00 2001 From: src48597962 <48597962@qq.com> Date: Sat, 26 Nov 2022 22:49:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'SrcLive.js'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SrcLive.js | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/SrcLive.js b/SrcLive.js index b8f45d31..a98c0a45 100644 --- a/SrcLive.js +++ b/SrcLive.js @@ -128,7 +128,7 @@ function Live() { url: $.toString((guanlidata,datalist) => { if(datalist.length>0){ deleteItemByCls('livelist'); - var lists = datalist.filter(item => { + let lists = datalist.filter(item => { return item.name.includes(input); }) let gldatalist = guanlidata(lists); @@ -318,6 +318,13 @@ function guanlidata(datalist) { return LiveEdit(name,'rename'); },name) }]:[]; + longClick.push({ + title: "推送至TVBOX", + js: $.toString((name) => { + require(config.依赖.match(/http(s)?:\/\/.*\//)[0] + 'SrcLive.js'); + return LiveEdit(name,'pushBox'); + },name) + }) list.push({ title: name, img: 'https://lanmeiguojiang.com/tubiao/ke/156.png', @@ -403,6 +410,46 @@ function LiveEdit(name,mode) { return "toast://输入不能为空" } },name,JYlivefile) + }else if(mode=='pushBox'){ + let push = { + "name": name, + "pic": 'https://lanmeiguojiang.com/tubiao/ke/156.png', + "content": '聚影直播推送', + "director": "未知", + "actor": "未知" + }; + let urls = []; + let JYlive= fetch(JYlivefile); + let JYlives = JYlive.split('\n'); + for(let i=0;i-1&&JYlives[i].split(',')[0].replace(/TV-/g,'TV').replace(/\[.*\]/g,'').trim()==name){ + urls.push(JYlives[i].split(',')[1]); + } + }catch(e){} + } + if(urls.length>0){ + push['from'] = name; + push['url'] = urls; + var state = request(tvip + '/action', { + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + //'X-Requested-With': 'XMLHttpRequest', + 'Referer': tvip + }, + timeout: 2000, + body: 'do=push&url=' + JSON.stringify(push), + method: 'POST' + }); + + if (state == 'ok') { + return 'toast://推送成功,如果tvbox显示“没找到数据”可能是该链接需要密码或者当前的jar不支持。'; + } else { + return 'toast://推送失败'; + } + }else{ + return 'toast://播放地址为空'; + } } } function LiveSet() {