libvio_open.js 8.6 KB

1
  1. import{load,_}from"assets://js/lib/cat.js";var key="libvio",HOST="https://libvio.app",host="",siteKey="",siteType=0;const MOBILE_UA="Mozilla/5.0 (Linux; Android 11; M2007J3SC Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045714 Mobile Safari/537.36";async function request(reqUrl,agentSp){return(await req(reqUrl,{method:"get",headers:{"User-Agent":agentSp||MOBILE_UA,Referer:host}})).content}async function init(cfg){siteKey=cfg.skey,siteType=cfg.stype;cfg=await request(HOST),cfg=load(cfg);host=cfg("div.content-top > ul > li").find("a:first")[0].attribs.href}async function home(filter){var html=await request(host),html=load(html)("ul.stui-header__menu > li > a[href*=type]"),html=_.map(html,cls=>{var typeId=cls.attribs.href;return{type_id:typeId=typeId.substring(typeId.lastIndexOf("/")+1).replace(".html",""),type_name:cls.children[0].data}});return JSON.stringify({class:html,filters:{1:[{key:"area",name:"地区",value:[{n:"全部",v:""},{n:"中国大陆",v:"中国大陆"},{n:"中国香港",v:"中国香港"},{n:"中国台湾",v:"中国台湾"},{n:"美国",v:"美国"},{n:"法国",v:"法国"},{n:"英国",v:"英国"},{n:"日本",v:"日本"},{n:"韩国",v:"韩国"},{n:"德国",v:"德国"},{n:"泰国",v:"泰国"},{n:"印度",v:"印度"},{n:"意大利",v:"意大利"},{n:"西班牙",v:"西班牙"},{n:"加拿大",v:"加拿大"},{n:"其他",v:"其他"}]},{key:"year",name:"年份",value:[{n:"全部",v:""},{n:"2023",v:"2023"},{n:"2022",v:"2022"},{n:"2021",v:"2021"},{n:"2020",v:"2020"},{n:"2019",v:"2019"},{n:"2018",v:"2018"},{n:"2017",v:"2017"},{n:"2016",v:"2016"},{n:"2015",v:"2015"},{n:"2014",v:"2014"},{n:"2013",v:"2013"},{n:"2012",v:"2012"},{n:"2011",v:"2011"},{n:"2010",v:"2010"}]},{key:"lang",name:"语言",value:[{n:"全部",v:""},{n:"国语",v:"国语"},{n:"英语",v:"英语"},{n:"粤语",v:"粤语"},{n:"闽南语",v:"闽南语"},{n:"韩语",v:"韩语"},{n:"日语",v:"日语"},{n:"法语",v:"法语"},{n:"德语",v:"德语"},{n:"其它",v:"其它"}]},{key:"by",name:"排序",value:[{n:"时间",v:"time"},{n:"人气",v:"hits"},{n:"评分",v:"score"}]}],2:[{key:"area",name:"地区",value:[{n:"全部",v:""},{n:"中国大陆",v:"中国大陆"},{n:"中国台湾",v:"中国台湾"},{n:"中国香港",v:"中国香港"},{n:"韩国",v:"韩国"},{n:"日本",v:"日本"},{n:"美国",v:"美国"},{n:"泰国",v:"泰国"},{n:"英国",v:"英国"},{n:"新加坡",v:"新加坡"},{n:"其他",v:"其他"}]},{key:"year",name:"年份",value:[{n:"全部",v:""},{n:"2023",v:"2023"},{n:"2022",v:"2022"},{n:"2021",v:"2021"},{n:"2020",v:"2020"},{n:"2019",v:"2019"},{n:"2018",v:"2018"},{n:"2017",v:"2017"},{n:"2016",v:"2016"},{n:"2015",v:"2015"},{n:"2014",v:"2014"},{n:"2013",v:"2013"},{n:"2012",v:"2012"},{n:"2011",v:"2011"},{n:"2010",v:"2010"}]},{key:"lang",name:"语言",value:[{n:"全部",v:""},{n:"国语",v:"国语"},{n:"英语",v:"英语"},{n:"粤语",v:"粤语"},{n:"闽南语",v:"闽南语"},{n:"韩语",v:"韩语"},{n:"日语",v:"日语"},{n:"其它",v:"其它"}]},{key:"by",name:"排序",value:[{n:"时间",v:"time"},{n:"人气",v:"hits"},{n:"评分",v:"score"}]}],4:[{key:"area",name:"地区",value:[{n:"全部",v:""},{n:"中国",v:"中国"},{n:"日本",v:"日本"},{n:"欧美",v:"欧美"},{n:"其他",v:"其他"}]},{key:"year",name:"年份",value:[{n:"全部",v:""},{n:"2023",v:"2023"},{n:"2022",v:"2022"},{n:"2021",v:"2021"},{n:"2020",v:"2020"},{n:"2019",v:"2019"},{n:"2018",v:"2018"},{n:"2017",v:"2017"},{n:"2016",v:"2016"},{n:"2015",v:"2015"},{n:"2014",v:"2014"},{n:"2013",v:"2013"},{n:"2012",v:"2012"},{n:"2011",v:"2011"},{n:"2010",v:"2010"},{n:"2009",v:"2009"},{n:"2008",v:"2008"},{n:"2007",v:"2007"},{n:"2006",v:"2006"},{n:"2005",v:"2005"},{n:"2004",v:"2004"}]},{key:"lang",name:"语言",value:[{n:"全部",v:""},{n:"国语",v:"国语"},{n:"英语",v:"英语"},{n:"粤语",v:"粤语"},{n:"闽南语",v:"闽南语"},{n:"韩语",v:"韩语"},{n:"日语",v:"日语"},{n:"其它",v:"其它"}]},{key:"by",name:"排序",value:[{n:"时间",v:"time"},{n:"人气",v:"hits"},{n:"评分",v:"score"}]}],27:[{key:"by",name:"排序",value:[{n:"时间",v:"time"},{n:"人气",v:"hits"},{n:"评分",v:"score"}]}],15:[{key:"area",name:"地区",value:[{n:"全部",v:""},{n:"日本",v:"日本"},{n:"韩国",v:"韩国"}]},{key:"year",name:"年份",value:[{n:"全部",v:""},{n:"2023",v:"2023"},{n:"2022",v:"2022"},{n:"2021",v:"2021"},{n:"2020",v:"2020"},{n:"2019",v:"2019"},{n:"2018",v:"2018"},{n:"2017",v:"2017"},{n:"2016",v:"2016"},{n:"2015",v:"2015"},{n:"2014",v:"2014"},{n:"2013",v:"2013"},{n:"2012",v:"2012"},{n:"2011",v:"2011"},{n:"2010",v:"2010"}]},{key:"lang",name:"语言",value:[{n:"全部",v:""},{n:"国语",v:"国语"},{n:"英语",v:"英语"},{n:"粤语",v:"粤语"},{n:"闽南语",v:"闽南语"},{n:"韩语",v:"韩语"},{n:"日语",v:"日语"},{n:"其它",v:"其它"}]},{key:"by",name:"排序",value:[{n:"时间",v:"time"},{n:"人气",v:"hits"},{n:"评分",v:"score"}]}],16:[{key:"area",name:"地区",value:[{n:"全部",v:""},{n:"美国",v:"美国"},{n:"英国",v:"英国"},{n:"德国",v:"德国"},{n:"加拿大",v:"加拿大"},{n:"其他",v:"其他"}]},{key:"year",name:"年份",value:[{n:"全部",v:""},{n:"2023",v:"2023"},{n:"2022",v:"2022"},{n:"2021",v:"2021"},{n:"2020",v:"2020"},{n:"2019",v:"2019"},{n:"2018",v:"2018"},{n:"2017",v:"2017"},{n:"2016",v:"2016"},{n:"2015",v:"2015"},{n:"2014",v:"2014"},{n:"2013",v:"2013"},{n:"2012",v:"2012"},{n:"2011",v:"2011"},{n:"2010",v:"2010"}]},{key:"lang",name:"语言",value:[{n:"全部",v:""},{n:"国语",v:"国语"},{n:"英语",v:"英语"},{n:"粤语",v:"粤语"},{n:"闽南语",v:"闽南语"},{n:"韩语",v:"韩语"},{n:"日语",v:"日语"},{n:"其它",v:"其它"}]},{key:"by",name:"排序",value:[{n:"时间",v:"time"},{n:"人气",v:"hits"},{n:"评分",v:"score"}]}]}})}async function homeVod(){var html=await request(host+"/show/1--hits---------.html"),$=load(html),html=$("ul.stui-vodlist > li"),html=_.map(html,item=>{var a=$(item).find("a:first")[0],item=$($(item).find("span.pic-text")[0]).text().trim();return{vod_id:a.attribs.href.replace(/.*?\/detail\/(.*).html/g,"$1"),vod_name:a.attribs.title,vod_pic:a.attribs["data-original"],vod_remarks:item||""}});return JSON.stringify({list:html})}async function category(tid,pg,filter,extend){var tid=await request(host+"/show/"+tid+"-"+(extend.area||"")+"-"+(extend.by||"time")+"--"+(extend.lang||"")+"----"+(pg=pg<=0||void 0===pg?1:pg)+"---"+(extend.year||"")+".html"),$=load(tid),extend=$("ul.stui-vodlist > li"),tid=_.map(extend,item=>{var a=$(item).find("a:first")[0],item=$($(item).find("span.pic-text")[0]).text().trim();return{vod_id:a.attribs.href.replace(/.*?\/detail\/(.*).html/g,"$1"),vod_name:a.attribs.title,vod_pic:a.attribs["data-original"],vod_remarks:item||""}}),extend=0<$("ul.stui-page__item > li > a:contains(下一页)").length?parseInt(pg)+1:parseInt(pg);return JSON.stringify({page:parseInt(pg),pagecount:extend,limit:24,total:24*extend,list:tid})}async function detail(id){var html=await request(host+"/detail/"+id+".html"),$=load(html),html={vod_id:id,vod_name:$("h1:first").text().trim(),vod_type:$(".stui-content__detail p:first a").text(),vod_actor:$(".stui-content__detail p:nth-child(3)").text().replace("主演:",""),vod_pic:$(".stui-content__thumb img:first").attr("data-original"),vod_remarks:$(".stui-content__detail p:nth-child(5)").text()||"",vod_content:$("span.detail-content").text().trim()},playMap={},id=$("div.stui-pannel__head > h3[class*=iconfont]"),playlists=$("ul.stui-content__playlist"),id=(_.each(id,(tab,i)=>{var from=tab.children[0].data,tab=playlists[i],tab=$(tab).find("a");_.each(tab,it=>{var title=it.children[0].data,playUrl=it.attribs.href;0==title.length&&(title=it.children[0].data.trim()),playMap.hasOwnProperty(from)||(playMap[from]=[]),playMap[from].push(title+"$"+playUrl)})}),html.vod_play_from=_.keys(playMap).join("$$$"),_.values(playMap)),id=_.map(id,urlist=>urlist.join("#"));return html.vod_play_url=id.join("$$$"),JSON.stringify({list:[html]})}async function play(flag,id,flags){var html=(html=await request(host+id)).match(/r player_.*?=(.*?)</)[1],html=JSON.parse(html),url=html.url,from=html.from,next=html.link_next,id=html.id,html=html.nid,from=await request(host+"/static/player/"+from+".js"),from=(from=await request((from=from.match(/ src="(.*?)'/)[1])+url+"&next="+next+"&id="+id+"&nid="+html)).match(/var .* = '(.*?)'/)[1];return JSON.stringify({parse:0,url:from})}async function search(wd,quick){var videos=[];for(const vod of JSON.parse(await request(host+"/index.php/ajax/suggest?mid=1&wd="+wd+"&limit=50")).list)videos.push({vod_id:vod.id,vod_name:vod.name,vod_pic:vod.pic,vod_remarks:""});return JSON.stringify({list:videos,limit:50})}function __jsEvalReturn(){return{init:init,home:home,homeVod:homeVod,category:category,detail:detail,play:play,search:search}}export{__jsEvalReturn};