update FM
This commit is contained in:
parent
16369876c7
commit
bd601203bb
147
0827.json
147
0827.json
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"spider": "./jar/custom_spider.jar;md5;8f735b6bf0cda5984e8ec2c184fa9cd07",
|
"spider": "./jar/custom_spider.jar;md5;a2204506315000174d11fe509f88259c",
|
||||||
"wallpaper": "http://饭太硬.top/深色壁纸/api.php",
|
"wallpaper": "http://饭太硬.top/深色壁纸/api.php",
|
||||||
"sites": [
|
"sites": [
|
||||||
{
|
{
|
||||||
@ -32,7 +32,7 @@
|
|||||||
"key": "bili_open",
|
"key": "bili_open",
|
||||||
"name": "哔哩(open)",
|
"name": "哔哩(open)",
|
||||||
"type": 3,
|
"type": 3,
|
||||||
"api": "https://raw.githubusercontent.com/FongMi/CatVodOpen/main/open/bili_open.js",
|
"api": "./js/bili_open.js",
|
||||||
"searchable": 1,
|
"searchable": 1,
|
||||||
"changeable": 0,
|
"changeable": 0,
|
||||||
"ext": {
|
"ext": {
|
||||||
@ -49,7 +49,7 @@
|
|||||||
"changeable": 0,
|
"changeable": 0,
|
||||||
"style": {
|
"style": {
|
||||||
"type": "rect",
|
"type": "rect",
|
||||||
"ratio": 1.597
|
"ratio": 1.433
|
||||||
},
|
},
|
||||||
"ext": {
|
"ext": {
|
||||||
"json": "./json/chuqiuyu1.json",
|
"json": "./json/chuqiuyu1.json",
|
||||||
@ -64,6 +64,18 @@
|
|||||||
"searchable": 1,
|
"searchable": 1,
|
||||||
"changeable": 1
|
"changeable": 1
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"key": "玩偶",
|
||||||
|
"name": "玩偶",
|
||||||
|
"type": 3,
|
||||||
|
"api": "csp_Wogg",
|
||||||
|
"searchable": 1,
|
||||||
|
"changeable": 0,
|
||||||
|
"ext": {
|
||||||
|
"token": "http://127.0.0.1:9978/file/tvfan/token.txt",
|
||||||
|
"filter": "./json/wogg.json"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"key": "星星",
|
"key": "星星",
|
||||||
"name": "星星",
|
"name": "星星",
|
||||||
@ -85,7 +97,7 @@
|
|||||||
"key": "廠長",
|
"key": "廠長",
|
||||||
"name": "廠長",
|
"name": "廠長",
|
||||||
"type": 3,
|
"type": 3,
|
||||||
"api": "https://fongmi.cachefly.net/FongMi/CatVodOpen/main/open/czzy_open.js",
|
"api": "./js/czzy_open.js",
|
||||||
"searchable": 1,
|
"searchable": 1,
|
||||||
"changeable": 1
|
"changeable": 1
|
||||||
},
|
},
|
||||||
@ -93,7 +105,7 @@
|
|||||||
"key": "愛看",
|
"key": "愛看",
|
||||||
"name": "愛看",
|
"name": "愛看",
|
||||||
"type": 3,
|
"type": 3,
|
||||||
"api": "https://fongmi.cachefly.net/FongMi/CatVodOpen/main/open/ikanbot_open.js",
|
"api": "./js/ikanbot_open.js",
|
||||||
"searchable": 1,
|
"searchable": 1,
|
||||||
"changeable": 1
|
"changeable": 1
|
||||||
},
|
},
|
||||||
@ -101,7 +113,15 @@
|
|||||||
"key": "快看",
|
"key": "快看",
|
||||||
"name": "快看",
|
"name": "快看",
|
||||||
"type": 3,
|
"type": 3,
|
||||||
"api": "https://fongmi.cachefly.net/FongMi/CatVodOpen/main/open/kkys_open.js",
|
"api": "./js/kkys_open.js",
|
||||||
|
"searchable": 1,
|
||||||
|
"changeable": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "暴風",
|
||||||
|
"name": "暴風",
|
||||||
|
"type": 1,
|
||||||
|
"api": "https://bfzyapi.com/api.php/provide/vod/?ac=list",
|
||||||
"searchable": 1,
|
"searchable": 1,
|
||||||
"changeable": 1
|
"changeable": 1
|
||||||
},
|
},
|
||||||
@ -111,82 +131,7 @@
|
|||||||
"type": 0,
|
"type": 0,
|
||||||
"api": "https://cj.lziapi.com/api.php/provide/vod/at/xml/",
|
"api": "https://cj.lziapi.com/api.php/provide/vod/at/xml/",
|
||||||
"searchable": 1,
|
"searchable": 1,
|
||||||
"changeable": 1,
|
"changeable": 1
|
||||||
"categories": [
|
|
||||||
"国产动漫",
|
|
||||||
"日韩动漫",
|
|
||||||
"国产剧",
|
|
||||||
"韩国剧",
|
|
||||||
"日本剧",
|
|
||||||
"电影片",
|
|
||||||
"连续剧",
|
|
||||||
"综艺片",
|
|
||||||
"动漫片",
|
|
||||||
"动作片",
|
|
||||||
"喜剧片",
|
|
||||||
"爱情片",
|
|
||||||
"科幻片",
|
|
||||||
"恐怖片",
|
|
||||||
"剧情片",
|
|
||||||
"战争片",
|
|
||||||
"台湾剧",
|
|
||||||
"香港剧",
|
|
||||||
"欧美剧",
|
|
||||||
"记录片",
|
|
||||||
"海外剧",
|
|
||||||
"泰国剧",
|
|
||||||
"大陆综艺",
|
|
||||||
"港台综艺",
|
|
||||||
"日韩综艺",
|
|
||||||
"欧美综艺",
|
|
||||||
"欧美动漫",
|
|
||||||
"港台动漫",
|
|
||||||
"海外动漫",
|
|
||||||
"体育",
|
|
||||||
"足球",
|
|
||||||
"篮球",
|
|
||||||
"网球",
|
|
||||||
"斯诺克"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "非凡",
|
|
||||||
"name": "非凡",
|
|
||||||
"type": 0,
|
|
||||||
"api": "http://cj.ffzyapi.com/api.php/provide/vod/at/xml/",
|
|
||||||
"searchable": 1,
|
|
||||||
"changeable": 1,
|
|
||||||
"categories": [
|
|
||||||
"国产动漫",
|
|
||||||
"日韩动漫",
|
|
||||||
"国产剧",
|
|
||||||
"韩国剧",
|
|
||||||
"日本剧",
|
|
||||||
"电影片",
|
|
||||||
"连续剧",
|
|
||||||
"综艺片",
|
|
||||||
"动漫片",
|
|
||||||
"动作片",
|
|
||||||
"喜剧片",
|
|
||||||
"爱情片",
|
|
||||||
"科幻片",
|
|
||||||
"恐怖片",
|
|
||||||
"剧情片",
|
|
||||||
"战争片",
|
|
||||||
"香港剧",
|
|
||||||
"欧美剧",
|
|
||||||
"记录片",
|
|
||||||
"台湾剧",
|
|
||||||
"海外剧",
|
|
||||||
"泰国剧",
|
|
||||||
"大陆综艺",
|
|
||||||
"港台综艺",
|
|
||||||
"日韩综艺",
|
|
||||||
"欧美综艺",
|
|
||||||
"欧美动漫",
|
|
||||||
"港台动漫",
|
|
||||||
"海外动漫"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "櫻花",
|
"key": "櫻花",
|
||||||
@ -212,21 +157,14 @@
|
|||||||
"searchable": 1,
|
"searchable": 1,
|
||||||
"changeable": 1
|
"changeable": 1
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"key": "玩偶",
|
|
||||||
"name": "玩偶",
|
|
||||||
"type": 3,
|
|
||||||
"api": "csp_Wogg",
|
|
||||||
"searchable": 1,
|
|
||||||
"changeable": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"key": "七夜",
|
"key": "七夜",
|
||||||
"name": "七夜",
|
"name": "七夜",
|
||||||
"type": 3,
|
"type": 3,
|
||||||
"api": "csp_Dovx",
|
"api": "csp_Dovx",
|
||||||
"searchable": 1,
|
"searchable": 1,
|
||||||
"changeable": 0
|
"changeable": 0,
|
||||||
|
"ext": "http://127.0.0.1:9978/file/tvfan/token.txt"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "雲搜",
|
"key": "雲搜",
|
||||||
@ -234,7 +172,8 @@
|
|||||||
"type": 3,
|
"type": 3,
|
||||||
"api": "csp_UpYun",
|
"api": "csp_UpYun",
|
||||||
"searchable": 1,
|
"searchable": 1,
|
||||||
"changeable": 0
|
"changeable": 0,
|
||||||
|
"ext": "http://127.0.0.1:9978/file/tvfan/token.txt"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "盤搜",
|
"key": "盤搜",
|
||||||
@ -242,7 +181,8 @@
|
|||||||
"type": 3,
|
"type": 3,
|
||||||
"api": "csp_PanSou",
|
"api": "csp_PanSou",
|
||||||
"searchable": 1,
|
"searchable": 1,
|
||||||
"changeable": 0
|
"changeable": 0,
|
||||||
|
"ext": "http://127.0.0.1:9978/file/tvfan/token.txt"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "盤搜索",
|
"key": "盤搜索",
|
||||||
@ -250,7 +190,8 @@
|
|||||||
"type": 3,
|
"type": 3,
|
||||||
"api": "csp_PanSearch",
|
"api": "csp_PanSearch",
|
||||||
"searchable": 1,
|
"searchable": 1,
|
||||||
"changeable": 0
|
"changeable": 0,
|
||||||
|
"ext": "http://127.0.0.1:9978/file/tvfan/token.txt"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "找資源",
|
"key": "找資源",
|
||||||
@ -259,7 +200,7 @@
|
|||||||
"api": "csp_Zhaozy",
|
"api": "csp_Zhaozy",
|
||||||
"searchable": 1,
|
"searchable": 1,
|
||||||
"changeable": 0,
|
"changeable": 0,
|
||||||
"ext": "影視天下第一$$$test2$$$test2"
|
"ext": "http://127.0.0.1:9978/file/tvfan/token.txt$$$test2$$$test2"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "push_agent",
|
"key": "push_agent",
|
||||||
@ -267,7 +208,8 @@
|
|||||||
"type": 3,
|
"type": 3,
|
||||||
"api": "csp_Push",
|
"api": "csp_Push",
|
||||||
"searchable": 1,
|
"searchable": 1,
|
||||||
"changeable": 0
|
"changeable": 0,
|
||||||
|
"ext": "http://127.0.0.1:9978/file/tvfan/token.txt"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"doh": [
|
"doh": [
|
||||||
@ -315,6 +257,15 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"rules": [
|
"rules": [
|
||||||
|
{
|
||||||
|
"name": "暴風",
|
||||||
|
"hosts": [
|
||||||
|
"bfzy"
|
||||||
|
],
|
||||||
|
"regex": [
|
||||||
|
"#EXT-X-DISCONTINUITY\\r*\\n*#EXTINF:3,[\\s\\S]*?#EXT-X-DISCONTINUITY"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "星星",
|
"name": "星星",
|
||||||
"hosts": [
|
"hosts": [
|
||||||
@ -325,7 +276,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "量子廣告",
|
"name": "量子",
|
||||||
"hosts": [
|
"hosts": [
|
||||||
"vip.lz",
|
"vip.lz",
|
||||||
"hd.lz"
|
"hd.lz"
|
||||||
@ -336,7 +287,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "非凡廣告",
|
"name": "非凡",
|
||||||
"hosts": [
|
"hosts": [
|
||||||
"vip.ffzy",
|
"vip.ffzy",
|
||||||
"hd.ffzy"
|
"hd.ffzy"
|
||||||
|
|||||||
Binary file not shown.
@ -1,13 +1,12 @@
|
|||||||
// 自动从 地址发布页 获取&跳转url地址
|
|
||||||
import { Crypto, load, _ } from './lib/cat.js';
|
import { Crypto, load, _ } from './lib/cat.js';
|
||||||
|
|
||||||
let key = 'czzy';
|
let key = 'czzy';
|
||||||
let host = 'https://www.czzy.site'; // 厂长地址发布页
|
let url = 'https://cz01.cc';
|
||||||
// let url = 'https://cz01.cc';
|
|
||||||
let url = '';
|
|
||||||
let siteKey = '';
|
let siteKey = '';
|
||||||
let siteType = 0;
|
let siteType = 0;
|
||||||
|
|
||||||
const UA = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1';
|
const UA = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1';
|
||||||
|
|
||||||
const cookie = {};
|
const cookie = {};
|
||||||
|
|
||||||
async function request(reqUrl, referer, mth, data, hd) {
|
async function request(reqUrl, referer, mth, data, hd) {
|
||||||
@ -49,15 +48,13 @@ async function request(reqUrl, referer, mth, data, hd) {
|
|||||||
async function init(cfg) {
|
async function init(cfg) {
|
||||||
siteKey = cfg.skey;
|
siteKey = cfg.skey;
|
||||||
siteType = cfg.stype;
|
siteType = cfg.stype;
|
||||||
let html = await request(host);
|
|
||||||
url = html.match(/推荐访问<a href="(.*)"/)[1];
|
|
||||||
console.debug('厂长跳转地址 =====>' + url); // js_debug.log
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function home(filter) {
|
async function home(filter) {
|
||||||
let filterObj = {};
|
let filterObj = {};
|
||||||
const html = await request(url + '/movie_bt');
|
const html = await request(url + '/movie_bt');
|
||||||
const $ = load(html);
|
const $ = load(html);
|
||||||
|
const series = $('div#beautiful-taxonomy-filters-tax-movie_bt_series > a[cat-url*=movie_bt_series]');
|
||||||
const tags = $('div#beautiful-taxonomy-filters-tax-movie_bt_tags > a');
|
const tags = $('div#beautiful-taxonomy-filters-tax-movie_bt_tags > a');
|
||||||
let tag = {
|
let tag = {
|
||||||
key: 'tag',
|
key: 'tag',
|
||||||
@ -69,7 +66,6 @@ async function home(filter) {
|
|||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
tag['init'] = tag.value[0].v;
|
tag['init'] = tag.value[0].v;
|
||||||
const series = $('div#beautiful-taxonomy-filters-tax-movie_bt_series > a[cat-url*=movie_bt_series]');
|
|
||||||
let classes = _.map(series, (s) => {
|
let classes = _.map(series, (s) => {
|
||||||
let typeId = s.attribs['cat-url'];
|
let typeId = s.attribs['cat-url'];
|
||||||
typeId = typeId.substring(typeId.lastIndexOf('/') + 1);
|
typeId = typeId.substring(typeId.lastIndexOf('/') + 1);
|
||||||
@ -137,6 +133,7 @@ async function detail(id) {
|
|||||||
const detail = $('ul.moviedteail_list > li');
|
const detail = $('ul.moviedteail_list > li');
|
||||||
let vod = {
|
let vod = {
|
||||||
vod_id: id,
|
vod_id: id,
|
||||||
|
vod_name: $('div.moviedteail_tt > h1').text().trim(),
|
||||||
vod_pic: $('div.dyimg img:first').attr('src'),
|
vod_pic: $('div.dyimg img:first').attr('src'),
|
||||||
vod_remarks: '',
|
vod_remarks: '',
|
||||||
vod_content: stripHtmlTag($('div.yp_context').html()).trim(),
|
vod_content: stripHtmlTag($('div.yp_context').html()).trim(),
|
||||||
|
|||||||
@ -12,7 +12,6 @@ async function request(reqUrl, agentSp) {
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
headers: {
|
headers: {
|
||||||
'User-Agent': agentSp || UA,
|
'User-Agent': agentSp || UA,
|
||||||
'referer': url
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return res.content;
|
return res.content;
|
||||||
@ -55,22 +54,7 @@ async function home(filter) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function homeVod() {
|
async function homeVod() {
|
||||||
const html = await request(url);
|
return '{}';
|
||||||
const $ = load(html);
|
|
||||||
const items = $('div.v-list a.item');
|
|
||||||
var jsBase = await js2Proxy(true, siteType, siteKey, 'img/', {});
|
|
||||||
let videos = _.map(items, (item) => {
|
|
||||||
const img = $(item).find('img:first')[0];
|
|
||||||
return {
|
|
||||||
vod_id: item.attribs.href,
|
|
||||||
vod_name: img.attribs.alt,
|
|
||||||
vod_pic: jsBase + base64Encode(img.attribs['data-src']),
|
|
||||||
vod_remarks: '',
|
|
||||||
};
|
|
||||||
});
|
|
||||||
return JSON.stringify({
|
|
||||||
list: videos,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function category(tid, pg, filter, extend) {
|
async function category(tid, pg, filter, extend) {
|
||||||
@ -101,85 +85,50 @@ async function category(tid, pg, filter, extend) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function detail(id) {
|
async function detail(id) {
|
||||||
const html = await request(url + id);
|
const html = await request(url + id);
|
||||||
const $ = load(html);
|
const $ = load(html);
|
||||||
var jsBase = await js2Proxy(true, siteType, siteKey, 'img/', {});
|
var jsBase = await js2Proxy(true, siteType, siteKey, 'img/', {});
|
||||||
const detail = $('div.detail');
|
const detail = $('div.detail > .meta');
|
||||||
const remarks = $('span#line-tips').text();
|
let vod = {
|
||||||
let vod = {
|
vod_id: id,
|
||||||
vod_id: id,
|
vod_pic: jsBase + base64Encode($('div.item-root > img')[0].attribs['data-src']),
|
||||||
vod_pic: jsBase + base64Encode($('div.item-root > img')[0].attribs['data-src']),
|
vod_remarks: '',
|
||||||
vod_remarks: '',
|
};
|
||||||
vod_content: remarks || '',
|
for (const info of detail) {
|
||||||
vod_name: $(detail).find('h2').text().trim(),
|
if ($(info).hasClass('title')) {
|
||||||
vod_year: $(detail).find('h3:nth-child(3)').text(),
|
vod.vod_name = info.children[0].data;
|
||||||
vod_area: $(detail).find('h3:nth-child(4)').text(),
|
} else if ($(info).hasClass('year')) {
|
||||||
vod_actor: $(detail).find('h3:nth-child(5)').text(),
|
vod.vod_area = info.children[0].data;
|
||||||
};
|
} else if ($(info).hasClass('country')) {
|
||||||
const res = await req(url + '/api/getResN?videoId=' + id.substring(id.lastIndexOf('/') + 1) + '&mtype=2', {
|
vod.vod_area = info.children[0].data;
|
||||||
headers: {
|
} else if ($(info).hasClass('celebrity')) {
|
||||||
Referer: 'play',
|
vod.vod_actor = info.children[0].data;
|
||||||
'User-Agent': UA,
|
}
|
||||||
},
|
}
|
||||||
});
|
|
||||||
const list = JSON.parse(res.content).data.list;
|
const res = await req(url + '/api/getResN?videoId=' + id.substring(id.lastIndexOf('/') + 1) + '&mtype=2', {
|
||||||
let playlist = {};
|
headers: {
|
||||||
let arr = []
|
Referer: url,
|
||||||
for (const l of list) {
|
'User-Agent': UA,
|
||||||
const flagData = JSON.parse(l.resData);
|
},
|
||||||
for (const f of flagData) {
|
});
|
||||||
const from = f.flag;
|
const list = JSON.parse(res.content).data.list;
|
||||||
const urls = f.url;
|
let playlist = {};
|
||||||
if (!from || !urls) continue;
|
for (const l of list) {
|
||||||
if (playlist[from]) continue;
|
const flagData = JSON.parse(l.resData);
|
||||||
playlist[from] = urls;
|
for (const f of flagData) {
|
||||||
}
|
const from = f.flag;
|
||||||
}
|
const urls = f.url;
|
||||||
for (var key in playlist) {
|
if (!from || !urls) continue;
|
||||||
if ('kuaikan' == key) {
|
if (playlist[from]) continue;
|
||||||
arr.push({
|
playlist[from] = urls;
|
||||||
flag: '快看',
|
}
|
||||||
url: playlist[key],
|
}
|
||||||
sort: 1
|
vod.vod_play_from = _.keys(playlist).join('$$$');
|
||||||
})
|
vod.vod_play_url = _.values(playlist).join('$$$');
|
||||||
} else if ('bfzym3u8' == key) {
|
return JSON.stringify({
|
||||||
arr.push({
|
list: [vod],
|
||||||
flag: '暴风',
|
});
|
||||||
url: playlist[key],
|
|
||||||
sort: 2
|
|
||||||
})
|
|
||||||
} else if ('ffm3u8' == key) {
|
|
||||||
arr.push({
|
|
||||||
flag: '非凡',
|
|
||||||
url: playlist[key],
|
|
||||||
sort: 3
|
|
||||||
})
|
|
||||||
} else if ('lzm3u8' == key) {
|
|
||||||
arr.push({
|
|
||||||
flag: '量子',
|
|
||||||
url: playlist[key],
|
|
||||||
sort: 4
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
arr.push({
|
|
||||||
flag: key,
|
|
||||||
url: playlist[key],
|
|
||||||
sort: 5
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
arr.sort((a, b) => a.sort - b.sort);
|
|
||||||
let playFrom = [];
|
|
||||||
let playList = [];
|
|
||||||
arr.map(val => {
|
|
||||||
playFrom.push(val.flag);
|
|
||||||
playList.push(val.url);
|
|
||||||
})
|
|
||||||
vod.vod_play_from = playFrom.join("$$$");
|
|
||||||
vod.vod_play_url = playList.join("$$$");
|
|
||||||
return JSON.stringify({
|
|
||||||
list: [vod],
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function base64Encode(text) {
|
function base64Encode(text) {
|
||||||
@ -221,28 +170,21 @@ async function play(flag, id, flags) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function search(wd, quick, pg) {
|
async function search(wd, quick) {
|
||||||
if (pg <= 0 || typeof(pg) == 'undefined') pg = 1;
|
const html = await request(url + '/search?q=' + wd);
|
||||||
const html = await request(url + '/search?q=' + wd + '&p=' + pg);
|
|
||||||
const $ = load(html);
|
const $ = load(html);
|
||||||
const items = $('div.media');
|
const items = $('div.media > div.media-left > a');
|
||||||
var jsBase = await js2Proxy(true, siteType, siteKey, 'img/', {});
|
var jsBase = await js2Proxy(true, siteType, siteKey, 'img/', {});
|
||||||
let videos = _.map(items, (item) => {
|
let videos = _.map(items, (item) => {
|
||||||
const a = $(item).find('a:first')[0];
|
|
||||||
const img = $(item).find('img:first')[0];
|
const img = $(item).find('img:first')[0];
|
||||||
const remarks = $($(item).find('span.label')[0]).text().trim();
|
|
||||||
return {
|
return {
|
||||||
vod_id: a.attribs.href,
|
vod_id: item.attribs.href,
|
||||||
vod_name: img.attribs.alt,
|
vod_name: img.attribs.alt,
|
||||||
vod_pic: jsBase + base64Encode(img.attribs['data-src']),
|
vod_pic: jsBase + base64Encode(img.attribs['data-src']),
|
||||||
vod_remarks: remarks || '',
|
vod_remarks: '',
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
const hasMore = $('div.page-more > a:contains(下一页)').length > 0;
|
|
||||||
const pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
|
|
||||||
return JSON.stringify({
|
return JSON.stringify({
|
||||||
page: parseInt(pg),
|
|
||||||
pagecount: pgCount,
|
|
||||||
list: videos,
|
list: videos,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -259,6 +259,10 @@ async function play(flag, id, flags) {
|
|||||||
var result = jsonParse(id, JSON.parse(res).data);
|
var result = jsonParse(id, JSON.parse(res).data);
|
||||||
if (result.url) {
|
if (result.url) {
|
||||||
result.parse = 0;
|
result.parse = 0;
|
||||||
|
// demo of block hls ads
|
||||||
|
if (/vip\.lz|hd\.lz/.test(result.url)) {
|
||||||
|
result.url = await js2Proxy(true, siteType, siteKey, 'lzm3u8/' + base64Encode(result.url), {});
|
||||||
|
}
|
||||||
return JSON.stringify(result);
|
return JSON.stringify(result);
|
||||||
}
|
}
|
||||||
return JSON.stringify({
|
return JSON.stringify({
|
||||||
@ -275,6 +279,41 @@ async function play(flag, id, flags) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function proxy(segments, headers) {
|
||||||
|
let what = segments[0];
|
||||||
|
let url = base64Decode(segments[1]);
|
||||||
|
if (what == 'lzm3u8') {
|
||||||
|
const resp = await req(url, {});
|
||||||
|
let hls = resp.content;
|
||||||
|
const jsBase = await js2Proxy(false, siteType, siteKey, 'lzm3u8/', {});
|
||||||
|
const baseUrl = url.substr(0, url.lastIndexOf('/') + 1);
|
||||||
|
console.log(hls.length);
|
||||||
|
hls = hls.replace(/#EXT-X-DISCONTINUITY\r*\n*#EXTINF:6.433333,[\s\S]*?#EXT-X-DISCONTINUITY/, '');
|
||||||
|
console.log(hls.length);
|
||||||
|
hls = hls.replace(/(#EXT-X-KEY\S+URI=")(\S+)("\S+)/g, function (match, p1, p2, p3) {
|
||||||
|
let up = (!p2.startsWith('http') ? baseUrl : '') + p2;
|
||||||
|
return p1 + up + p3;
|
||||||
|
});
|
||||||
|
hls = hls.replace(/(#EXT-X-STREAM-INF:.*\n)(.*)/g, function (match, p1, p2) {
|
||||||
|
let up = (!p2.startsWith('http') ? baseUrl : '') + p2;
|
||||||
|
return p1 + jsBase + base64Encode(up);
|
||||||
|
});
|
||||||
|
hls = hls.replace(/(#EXTINF:.*\n)(.*)/g, function (match, p1, p2) {
|
||||||
|
let up = (!p2.startsWith('http') ? baseUrl : '') + p2;
|
||||||
|
return p1 + up;
|
||||||
|
});
|
||||||
|
return JSON.stringify({
|
||||||
|
code: resp.code,
|
||||||
|
content: hls,
|
||||||
|
headers: resp.headers,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return JSON.stringify({
|
||||||
|
code: 500,
|
||||||
|
content: '',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async function search(wd, quick) {
|
async function search(wd, quick) {
|
||||||
let data = JSON.parse(await request(url + '/api.php/Search/getSearch', { key: wd, type_id: 0, p: 1 })).data;
|
let data = JSON.parse(await request(url + '/api.php/Search/getSearch', { key: wd, type_id: 0, p: 1 })).data;
|
||||||
let videos = [];
|
let videos = [];
|
||||||
@ -291,6 +330,14 @@ async function search(wd, quick) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function base64Encode(text) {
|
||||||
|
return Crypto.enc.Base64.stringify(Crypto.enc.Utf8.parse(text));
|
||||||
|
}
|
||||||
|
|
||||||
|
function base64Decode(text) {
|
||||||
|
return Crypto.enc.Utf8.stringify(Crypto.enc.Base64.parse(text));
|
||||||
|
}
|
||||||
|
|
||||||
const charStr = 'abacdefghjklmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ0123456789';
|
const charStr = 'abacdefghjklmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ0123456789';
|
||||||
function randStr(len, withNum) {
|
function randStr(len, withNum) {
|
||||||
var _str = '';
|
var _str = '';
|
||||||
@ -359,6 +406,7 @@ export function __jsEvalReturn() {
|
|||||||
category: category,
|
category: category,
|
||||||
detail: detail,
|
detail: detail,
|
||||||
play: play,
|
play: play,
|
||||||
|
proxy: proxy,
|
||||||
search: search,
|
search: search,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
1318
json/wogg.json
Normal file
1318
json/wogg.json
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user