mirror of
https://github.com/ls125781003/tvboxtg.git
synced 2025-10-29 04:42:17 +00:00
Pending changes exported from your codespace
This commit is contained in:
621
骚零/api/bili_open.js
Normal file
621
骚零/api/bili_open.js
Normal file
@@ -0,0 +1,621 @@
|
||||
import { Crypto, jinja2, _ } from 'assets://js/lib/cat.js';
|
||||
|
||||
let siteKey = '';
|
||||
let siteType = 0;
|
||||
|
||||
let cookie = '';
|
||||
let login = '';
|
||||
let vip = false;
|
||||
let extendObj = {};
|
||||
let bili_jct = '';
|
||||
let vod_audio_id = {
|
||||
30280: 192000,
|
||||
30232: 132000,
|
||||
30216: 64000,
|
||||
};
|
||||
|
||||
let vod_codec = {
|
||||
// 13: 'AV1',
|
||||
12: 'HEVC',
|
||||
7: 'AVC',
|
||||
};
|
||||
|
||||
const UA = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36';
|
||||
|
||||
async function request(reqUrl, ua, buffer) {
|
||||
let res = await req(reqUrl, {
|
||||
method: 'get',
|
||||
headers: ua ? ua : { 'User-Agent': UA },
|
||||
timeout: 60000,
|
||||
buffer: buffer ? 1 : 0,
|
||||
});
|
||||
return res.content;
|
||||
}
|
||||
|
||||
async function post(reqUrl, postData, ua, posttype) {
|
||||
let res = await req(reqUrl, {
|
||||
method: 'post',
|
||||
headers: ua ? ua : { 'User-Agent': UA },
|
||||
data: postData,
|
||||
timeout: 60000,
|
||||
postType: posttype,
|
||||
});
|
||||
return res.content;
|
||||
}
|
||||
|
||||
function getHeaders() {
|
||||
const headers = {
|
||||
'User-Agent': UA,
|
||||
};
|
||||
if (!_.isEmpty(cookie)) {
|
||||
headers.cookie = cookie;
|
||||
}
|
||||
return headers;
|
||||
}
|
||||
|
||||
async function getCookie() {
|
||||
let result = await req('https://www.bilibili.com', {
|
||||
method: 'get',
|
||||
headers: { 'User-Agent': UA },
|
||||
timeout: 60000,
|
||||
});
|
||||
const setCookieHeaders = result.headers['set-cookie'];
|
||||
cookie = setCookieHeaders.map((kk) => kk.split(';')[0] + ';').join('');
|
||||
}
|
||||
|
||||
async function init(cfg) {
|
||||
siteKey = cfg.skey;
|
||||
siteType = cfg.stype;
|
||||
let extend = cfg.ext;
|
||||
|
||||
if (cfg.ext.hasOwnProperty('categories')) extend = cfg.ext.categories;
|
||||
if (cfg.ext.hasOwnProperty('cookie')) cookie = cfg.ext.cookie;
|
||||
// 获取csrf
|
||||
const cookies = cookie.split(';');
|
||||
cookies.forEach(cookie => {
|
||||
if (cookie.includes('bili_jct')) {
|
||||
bili_jct = cookie.split('=')[1];
|
||||
}
|
||||
});
|
||||
|
||||
if (_.isEmpty(cookie)) await getCookie();
|
||||
let result = JSON.parse(await request('https://api.bilibili.com/x/web-interface/nav', getHeaders()));
|
||||
login = result.data.isLogin;
|
||||
vip = result.data.vipStatus;
|
||||
const ext = extend.split('#');
|
||||
const jsonData = [
|
||||
{
|
||||
key: 'order',
|
||||
name: '排序',
|
||||
value: [
|
||||
{ n: '综合排序', v: '0' },
|
||||
{ n: '最多点击', v: 'click' },
|
||||
{ n: '最新发布', v: 'pubdate' },
|
||||
{ n: '最多弹幕', v: 'dm' },
|
||||
{ n: '最多收藏', v: 'stow' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'duration',
|
||||
name: '时长',
|
||||
value: [
|
||||
{ n: '全部时长', v: '0' },
|
||||
{ n: '60分钟以上', v: '4' },
|
||||
{ n: '30~60分钟', v: '3' },
|
||||
{ n: '10~30分钟', v: '2' },
|
||||
{ n: '10分钟以下', v: '1' },
|
||||
],
|
||||
},
|
||||
];
|
||||
const newarr = [];
|
||||
const d = {};
|
||||
const sc = {
|
||||
type_name: "首页",
|
||||
type_id: "首页",
|
||||
land: 1,
|
||||
ratio: 1.33,
|
||||
}
|
||||
newarr.push(sc);
|
||||
for (const kk of ext) {
|
||||
const c = {
|
||||
type_name: kk,
|
||||
type_id: kk,
|
||||
land: 1,
|
||||
ratio: 1.33,
|
||||
};
|
||||
newarr.push(c);
|
||||
d[kk] = jsonData;
|
||||
}
|
||||
if (!_.isEmpty(bili_jct)) {
|
||||
const hc = {
|
||||
type_name: "历史记录",
|
||||
type_id: "历史记录",
|
||||
land: 1,
|
||||
ratio: 1.33,
|
||||
}
|
||||
newarr.push(hc);
|
||||
}
|
||||
extendObj = {
|
||||
classes: newarr,
|
||||
filter: d,
|
||||
};
|
||||
}
|
||||
|
||||
function home(filter) {
|
||||
try {
|
||||
const jSONObject = {
|
||||
class: extendObj.classes,
|
||||
};
|
||||
if (filter) {
|
||||
jSONObject.filters = extendObj.filter;
|
||||
}
|
||||
return JSON.stringify(jSONObject);
|
||||
} catch (e) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
async function homeVod() {
|
||||
try {
|
||||
const list = [];
|
||||
const url = 'https://api.bilibili.com/x/web-interface/index/top/rcmd?ps=14&fresh_idx=1&fresh_idx_1h=1';
|
||||
|
||||
const response = await request(url, getHeaders());
|
||||
const responseData = JSON.parse(response);
|
||||
const vods = responseData.data.item;
|
||||
|
||||
for (const item of vods) {
|
||||
const vod = {};
|
||||
let imageUrl = item.pic;
|
||||
if (imageUrl.startsWith('//')) {
|
||||
imageUrl = 'https:' + imageUrl;
|
||||
}
|
||||
let cd = getFullTime(item.duration);
|
||||
|
||||
vod.vod_id = item.bvid;
|
||||
vod.vod_name = removeTags(item.title);
|
||||
vod.vod_pic = imageUrl;
|
||||
vod.vod_remarks = cd;
|
||||
vod.style = {
|
||||
type: 'rect',
|
||||
ratio: 1.33,
|
||||
},
|
||||
list.push(vod);
|
||||
}
|
||||
|
||||
const result = { list: list };
|
||||
return JSON.stringify(result);
|
||||
} catch (e) { }
|
||||
}
|
||||
|
||||
async function category(tid, page, filter, ext) {
|
||||
if (page < 1) page = 1;
|
||||
try {
|
||||
if (Object.keys(ext).length > 0 && ext.hasOwnProperty('tid') && ext['tid'].length > 0) {
|
||||
tid = ext['tid'];
|
||||
}
|
||||
let url = '';
|
||||
url = `https://api.bilibili.com/x/web-interface/search/type?search_type=video&keyword=${encodeURIComponent(tid)}`;
|
||||
|
||||
if (Object.keys(ext).length > 0) {
|
||||
for (const k in ext) {
|
||||
if (k == 'tid') {
|
||||
continue;
|
||||
}
|
||||
url += `&${encodeURIComponent(k)}=${encodeURIComponent(ext[k])}`;
|
||||
}
|
||||
}
|
||||
|
||||
url += `&page=${encodeURIComponent(page)}`;
|
||||
|
||||
if (tid == "首页") {
|
||||
url = "https://api.bilibili.com/x/web-interface/index/top/rcmd?ps=14&fresh_idx=" + page + "&fresh_idx_1h=" + page;
|
||||
} else if (tid == "历史记录") {
|
||||
url = "https://api.bilibili.com/x/v2/history?pn=" + page;
|
||||
}
|
||||
|
||||
const data = JSON.parse(await request(url, getHeaders())).data;
|
||||
let items = data.result;
|
||||
if (tid == "首页") {
|
||||
items = data.item;
|
||||
} else if (tid == "历史记录") {
|
||||
items = data;
|
||||
}
|
||||
|
||||
const videos = [];
|
||||
for (const item of items) {
|
||||
const video = {};
|
||||
let pic = item.pic;
|
||||
if (pic.startsWith('//')) {
|
||||
pic = 'https:' + pic;
|
||||
}
|
||||
let cd = getFullTime(item.duration);
|
||||
|
||||
video.vod_remarks = cd;
|
||||
video.vod_id = item.bvid;
|
||||
video.vod_name = removeTags(item.title);
|
||||
video.vod_pic = pic;
|
||||
|
||||
video.style = {
|
||||
type: 'rect',
|
||||
ratio: 1.33,
|
||||
},
|
||||
videos.push(video);
|
||||
}
|
||||
|
||||
const result = {
|
||||
page: page,
|
||||
pagecount: data.numPages ?? (page + 1),
|
||||
limit: videos.length,
|
||||
total: videos.length * (page + 1),
|
||||
list: videos,
|
||||
};
|
||||
|
||||
return JSON.stringify(result);
|
||||
} catch (e) { }
|
||||
return null;
|
||||
}
|
||||
|
||||
async function detail(ids) {
|
||||
try {
|
||||
const bvid = ids;
|
||||
const detailUrl = `https://api.bilibili.com/x/web-interface/view?bvid=${bvid}`;
|
||||
|
||||
const detailData = JSON.parse(await request(detailUrl, getHeaders())).data;
|
||||
// 记录历史
|
||||
if (!_.isEmpty(bili_jct)) {
|
||||
const historyReport = 'https://api.bilibili.com/x/v2/history/report';
|
||||
let dataPost = {
|
||||
aid: detailData.aid,
|
||||
cid: detailData.cid,
|
||||
csrf: bili_jct,
|
||||
}
|
||||
await post(historyReport, dataPost, getHeaders(), 'form');
|
||||
}
|
||||
let cd = getFullTime(detailData.duration);
|
||||
const aid = detailData.aid;
|
||||
const video = {
|
||||
vod_id: bvid,
|
||||
vod_name: detailData.title,
|
||||
vod_pic: detailData.pic,
|
||||
type_name: detailData.tname,
|
||||
vod_year: '',
|
||||
vod_area: '',
|
||||
vod_remarks: cd,
|
||||
vod_actor: '',
|
||||
vod_director: '',
|
||||
vod_content: detailData.desc,
|
||||
};
|
||||
|
||||
const playurldata = 'https://api.bilibili.com/x/player/playurl?avid=' + aid + '&cid=' + detailData.cid + '&qn=127&fnval=4048&fourk=1';
|
||||
const playurldatas = JSON.parse(await request(playurldata, getHeaders()));
|
||||
|
||||
const playurldatalist = playurldatas.data;
|
||||
const accept_quality = playurldatalist.accept_quality;
|
||||
const accept_description = playurldatalist.accept_description;
|
||||
const qualitylist = [];
|
||||
const descriptionList = [];
|
||||
|
||||
for (let i = 0; i < accept_quality.length; i++) {
|
||||
if (!vip) {
|
||||
if (!login) {
|
||||
if (accept_quality[i] > 32) continue;
|
||||
} else {
|
||||
if (accept_quality[i] > 80) continue;
|
||||
}
|
||||
}
|
||||
descriptionList.push(base64Encode(accept_description[i]));
|
||||
qualitylist.push(accept_quality[i]);
|
||||
}
|
||||
|
||||
let treeMap = {};
|
||||
const jSONArray = detailData.pages;
|
||||
let playList = [];
|
||||
for (let j = 0; j < jSONArray.length; j++) {
|
||||
const jSONObject6 = jSONArray[j];
|
||||
const cid = jSONObject6.cid;
|
||||
const playUrl = j + '$' + aid + '+' + cid + '+' + qualitylist.join(':') + '+' + descriptionList.join(':');
|
||||
playList.push(playUrl);
|
||||
}
|
||||
treeMap['dash'] = playList.join('#');
|
||||
treeMap['mp4'] = playList.join('#');
|
||||
|
||||
const relatedUrl = 'https://api.bilibili.com/x/web-interface/archive/related?bvid=' + bvid;
|
||||
const relatedData = JSON.parse(await request(relatedUrl, getHeaders())).data;
|
||||
playList = [];
|
||||
for (let j = 0; j < relatedData.length; j++) {
|
||||
const jSONObject6 = relatedData[j];
|
||||
const cid = jSONObject6.cid;
|
||||
const title = jSONObject6.title;
|
||||
const aaid = jSONObject6.aid;
|
||||
const playUrl = title + '$' + aaid + '+' + cid + '+' + qualitylist.join(':') + '+' + descriptionList.join(':');
|
||||
playList.push(playUrl);
|
||||
}
|
||||
treeMap['相关'] = playList.join('#');
|
||||
|
||||
video.vod_play_from = Object.keys(treeMap).join("$$$");
|
||||
video.vod_play_url = Object.values(treeMap).join("$$$");
|
||||
|
||||
const list = [video];
|
||||
const result = { list };
|
||||
return JSON.stringify(result);
|
||||
} catch (e) { }
|
||||
return null;
|
||||
}
|
||||
|
||||
async function play(flag, id, flags) {
|
||||
try {
|
||||
const playHeaders = { Referer: 'https://www.bilibili.com', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36' };
|
||||
const ids = id.split('+');
|
||||
const aid = ids[0];
|
||||
const cid = ids[1];
|
||||
const qualityIds = ids[2].split(':');
|
||||
const qualityName = ids[3].split(':');
|
||||
const dan = 'https://api.bilibili.com/x/v1/dm/list.so?oid=' + cid;
|
||||
if (flag == 'dash' || flag == '相关') {
|
||||
// dash mpd 代理
|
||||
const js2Base = await js2Proxy(true, siteType, siteKey, 'dash/', {});
|
||||
let urls = [];
|
||||
for (let i = 0; i < qualityIds.length; i++) {
|
||||
urls.push(base64Decode(qualityName[i]), js2Base + base64Encode(aid + '+' + cid + '+' + qualityIds[i]));
|
||||
}
|
||||
return JSON.stringify({
|
||||
parse: 0,
|
||||
url: urls,
|
||||
danmaku: dan,
|
||||
header: playHeaders,
|
||||
});
|
||||
} else if (flag == 'mp4') {
|
||||
// 直链
|
||||
let urls = [];
|
||||
for (let i = 0; i < qualityIds.length; i++) {
|
||||
const url = `https://api.bilibili.com/x/player/playurl?avid=${aid}&cid=${cid}&qn=${qualityIds[i]}&fourk=1`;
|
||||
const resp = JSON.parse(await request(url, getHeaders()));
|
||||
const data = resp.data;
|
||||
if (data.quality != qualityIds[i]) continue;
|
||||
let durl = data.durl[0].url;
|
||||
urls.push(base64Decode(qualityName[i]), durl);
|
||||
}
|
||||
|
||||
return JSON.stringify({
|
||||
parse: 0,
|
||||
url: urls,
|
||||
danmaku: dan,
|
||||
header: playHeaders,
|
||||
});
|
||||
} else {
|
||||
// 音频外挂
|
||||
let urls = [];
|
||||
let audios = [];
|
||||
for (let i = 0; i < qualityIds.length; i++) {
|
||||
const url = `https://api.bilibili.com/x/player/playurl?avid=${aid}&cid=${cid}&qn=${qualityIds[i]}&fnval=4048&fourk=1`;
|
||||
let resp = JSON.parse(await request(url, getHeaders()));
|
||||
const dash = resp.data.dash;
|
||||
const video = dash.video;
|
||||
const audio = dash.audio;
|
||||
for (let j = 0; j < video.length; j++) {
|
||||
const dashjson = video[j];
|
||||
if (dashjson.id == qualityIds[i]) {
|
||||
for (const key in vod_codec) {
|
||||
if (dashjson.codecid == key) {
|
||||
urls.push(base64Decode(qualityName[i]) + ' ' + vod_codec[key], dashjson.baseUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (audios.length == 0) {
|
||||
for (let j = 0; j < audio.length; j++) {
|
||||
const dashjson = audio[j];
|
||||
for (const key in vod_audio_id) {
|
||||
if (dashjson.id == key) {
|
||||
audios.push({
|
||||
title: _.floor(parseInt(vod_audio_id[key]) / 1024) + 'Kbps',
|
||||
bit: vod_audio_id[key],
|
||||
url: dashjson.baseUrl,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
audios = _.sortBy(audios, 'bit');
|
||||
}
|
||||
}
|
||||
|
||||
return JSON.stringify({
|
||||
parse: 0,
|
||||
url: urls,
|
||||
extra: {
|
||||
audio: audios,
|
||||
},
|
||||
header: playHeaders,
|
||||
});
|
||||
}
|
||||
} catch (e) { }
|
||||
return null;
|
||||
}
|
||||
|
||||
async function search(key, quick, pg) {
|
||||
let page = pg || 1;
|
||||
if (page == 0) page = 1;
|
||||
try {
|
||||
const ext = {
|
||||
duration: '0',
|
||||
};
|
||||
let resp = JSON.parse(await category(key, page, true, ext));
|
||||
const catVideos = resp.list;
|
||||
const pageCount = resp.pagecount;
|
||||
const videos = [];
|
||||
for (let i = 0; i < catVideos.length; ++i) {
|
||||
videos.push(catVideos[i]);
|
||||
}
|
||||
const result = {
|
||||
page: page,
|
||||
pagecount: pageCount,
|
||||
land: 1,
|
||||
ratio: 1.33,
|
||||
list: videos,
|
||||
};
|
||||
return JSON.stringify(result);
|
||||
} catch (e) { }
|
||||
return null;
|
||||
}
|
||||
|
||||
async function proxy(segments, headers) {
|
||||
let what = segments[0];
|
||||
let url = base64Decode(segments[1]);
|
||||
if (what == 'dash') {
|
||||
const ids = url.split('+');
|
||||
const aid = ids[0];
|
||||
const cid = ids[1];
|
||||
const str5 = ids[2];
|
||||
const urls = `https://api.bilibili.com/x/player/playurl?avid=${aid}&cid=${cid}&qn=${str5}&fnval=4048&fourk=1`;
|
||||
let videoList = '';
|
||||
let audioList = '';
|
||||
|
||||
let resp = JSON.parse(await request(urls, getHeaders()));
|
||||
const dash = resp.data.dash;
|
||||
const video = dash.video;
|
||||
const audio = dash.audio;
|
||||
|
||||
for (let i = 0; i < video.length; i++) {
|
||||
// if (i > 0) continue; // 只取一个
|
||||
const dashjson = video[i];
|
||||
if (dashjson.id == str5) {
|
||||
videoList += getDashMedia(dashjson);
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = 0; i < audio.length; i++) {
|
||||
// if (i > 0) continue;
|
||||
const ajson = audio[i];
|
||||
for (const key in vod_audio_id) {
|
||||
if (ajson.id == key) {
|
||||
audioList += getDashMedia(ajson);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let mpd = getDash(resp, videoList, audioList);
|
||||
|
||||
return JSON.stringify({
|
||||
code: 200,
|
||||
content: mpd,
|
||||
headers: {
|
||||
'Content-Type': 'application/dash+xml',
|
||||
},
|
||||
});
|
||||
}
|
||||
return JSON.stringify({
|
||||
code: 500,
|
||||
content: '',
|
||||
});
|
||||
}
|
||||
|
||||
function getDashMedia(dash) {
|
||||
try {
|
||||
let qnid = dash.id;
|
||||
const codecid = dash.codecid;
|
||||
const media_codecs = dash.codecs;
|
||||
const media_bandwidth = dash.bandwidth;
|
||||
const media_startWithSAP = dash.startWithSap;
|
||||
const media_mimeType = dash.mimeType;
|
||||
const media_BaseURL = dash.baseUrl.replace(/&/g, '&');
|
||||
const media_SegmentBase_indexRange = dash.SegmentBase.indexRange;
|
||||
const media_SegmentBase_Initialization = dash.SegmentBase.Initialization;
|
||||
const mediaType = media_mimeType.split('/')[0];
|
||||
let media_type_params = '';
|
||||
|
||||
if (mediaType == 'video') {
|
||||
const media_frameRate = dash.frameRate;
|
||||
const media_sar = dash.sar;
|
||||
const media_width = dash.width;
|
||||
const media_height = dash.height;
|
||||
media_type_params = `height='${media_height}' width='${media_width}' frameRate='${media_frameRate}' sar='${media_sar}'`;
|
||||
} else if (mediaType == 'audio') {
|
||||
for (const key in vod_audio_id) {
|
||||
if (qnid == key) {
|
||||
const audioSamplingRate = vod_audio_id[key];
|
||||
media_type_params = `numChannels='2' sampleRate='${audioSamplingRate}'`;
|
||||
}
|
||||
}
|
||||
}
|
||||
qnid += '_' + codecid;
|
||||
|
||||
return `<AdaptationSet lang="chi">
|
||||
<ContentComponent contentType="${mediaType}"/>
|
||||
<Representation id="${qnid}" bandwidth="${media_bandwidth}" codecs="${media_codecs}" mimeType="${media_mimeType}" ${media_type_params} startWithSAP="${media_startWithSAP}">
|
||||
<BaseURL>${media_BaseURL}</BaseURL>
|
||||
<SegmentBase indexRange="${media_SegmentBase_indexRange}">
|
||||
<Initialization range="${media_SegmentBase_Initialization}"/>
|
||||
</SegmentBase>
|
||||
</Representation>
|
||||
</AdaptationSet>`;
|
||||
} catch (e) {
|
||||
// Handle exceptions here
|
||||
}
|
||||
}
|
||||
|
||||
function getDash(ja, videoList, audioList) {
|
||||
const duration = ja.data.dash.duration;
|
||||
const minBufferTime = ja.data.dash.minBufferTime;
|
||||
return `<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd" type="static" mediaPresentationDuration="PT${duration}S" minBufferTime="PT${minBufferTime}S" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011">
|
||||
<Period duration="PT${duration}S" start="PT0S">
|
||||
${videoList}
|
||||
${audioList}
|
||||
</Period>
|
||||
</MPD>`;
|
||||
}
|
||||
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
|
||||
|
||||
function removeTags(input) {
|
||||
return input.replace(/<[^>]*>/g, '');
|
||||
}
|
||||
|
||||
function getFullTime(numberSec) {
|
||||
let totalSeconds = '';
|
||||
try {
|
||||
var timeParts = numberSec.split(":");
|
||||
var min = parseInt(timeParts[0]);
|
||||
var sec = parseInt(timeParts[1]);
|
||||
totalSeconds = min * 60 + sec;
|
||||
} catch (e) {
|
||||
totalSeconds = parseInt(numberSec);
|
||||
}
|
||||
if (isNaN(totalSeconds)) {
|
||||
return '无效输入';
|
||||
}
|
||||
if (totalSeconds >= 3600) {
|
||||
const hours = Math.floor(totalSeconds / 3600);
|
||||
const remainingSecondsAfterHours = totalSeconds % 3600;
|
||||
const minutes = Math.floor(remainingSecondsAfterHours / 60);
|
||||
const seconds = remainingSecondsAfterHours % 60;
|
||||
return `${hours}小时 ${minutes}分钟 ${seconds}秒`;
|
||||
} else {
|
||||
const minutes = Math.floor(totalSeconds / 60);
|
||||
const seconds = totalSeconds % 60;
|
||||
return `${minutes}分钟 ${seconds}秒`;
|
||||
}
|
||||
}
|
||||
|
||||
export function __jsEvalReturn() {
|
||||
return {
|
||||
init: init,
|
||||
home: home,
|
||||
homeVod: homeVod,
|
||||
category: category,
|
||||
detail: detail,
|
||||
play: play,
|
||||
proxy: proxy,
|
||||
search: search,
|
||||
};
|
||||
}
|
||||
|
||||
1
骚零/api/drpy2.min.js
vendored
Normal file
1
骚零/api/drpy2.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
68
骚零/api/gbk.js
Normal file
68
骚零/api/gbk.js
Normal file
File diff suppressed because one or more lines are too long
222
骚零/api/ggys_open.js
Normal file
222
骚零/api/ggys_open.js
Normal file
@@ -0,0 +1,222 @@
|
||||
import { Crypto, load, _ } from 'assets://js/lib/cat.js';
|
||||
|
||||
const key = 'ggys';
|
||||
const HOST = 'https://ggys.me';
|
||||
const TYPE_MOVIE = 'movie';
|
||||
const TYPE_TVSHOW = 'tv-show';
|
||||
let siteKey = '';
|
||||
let siteType = 0;
|
||||
|
||||
const 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, method, data) {
|
||||
const res = await req(reqUrl, {
|
||||
method: method || 'get',
|
||||
headers: {
|
||||
'User-Agent': UA,
|
||||
'Referer': HOST,
|
||||
},
|
||||
data: data,
|
||||
postType: method === 'post' ? 'form' : '',
|
||||
});
|
||||
return res.content;
|
||||
}
|
||||
|
||||
// cfg = {skey: siteKey, ext: extend}
|
||||
async function init(cfg) {
|
||||
siteKey = cfg.skey;
|
||||
siteType = cfg.stype;
|
||||
if (cfg.hasOwnProperty('ext')) {
|
||||
if (cfg.ext.hasOwnProperty('host')) {
|
||||
HOST = cfg.ext.host;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function home(filter) {
|
||||
const classes = [{'type_id':'movies','type_name':'电影'},{'type_id':'tv-shows','type_name':'剧集'}];
|
||||
const filterObj = {
|
||||
'movies':[{'key':'class','name':'类型','init':'','value':[{'n':'全部','v':''},{'n':'欧美电影','v':'tag/欧美电影'},{'n':'华语电影','v':'tag/华语电影'},{'n':'日韩电影','v':'tag/日韩电影'},{'n':'其他地区','v':'tag/其他地区'},{'n':'冒险','v':'genre/冒险'},{'n':'剧情','v':'genre/剧情'},{'n':'动作','v':'genre/动作'},{'n':'动画','v':'genre/动画'},{'n':'历史','v':'genre/历史'},{'n':'喜剧','v':'genre/喜剧'},{'n':'奇幻','v':'genre/奇幻'},{'n':'家庭','v':'genre/家庭'},{'n':'恐怖','v':'genre/恐怖'},{'n':'悬疑','v':'genre/悬疑'},{'n':'惊悚','v':'genre/惊悚'},{'n':'战争','v':'genre/战争'},{'n':'爱情','v':'genre/爱情'},{'n':'犯罪','v':'genre/犯罪'},{'n':'科幻','v':'genre/科幻'},{'n':'纪录','v':'genre/纪录'},{'n':'音乐','v':'genre/音乐'}]}],
|
||||
'tv-shows':[{'key':'class','name':'类型','init':'','value':[{'n':'全部','v':''},{'n':'欧美剧','v':'tag/欧美剧'},{'n':'日韩剧','v':'tag/日韩剧'},{'n':'国产剧','v':'tag/国产剧'},{'n':'其他地区','v':'tag/其他地区'},{'n':'剧情','v':'genre/剧情'},{'n':'动作','v':'genre/动作'},{'n':'动画','v':'genre/动画'},{'n':'喜剧','v':'genre/喜剧'},{'n':'家庭','v':'genre/家庭'},{'n':'悬疑','v':'genre/悬疑'},{'n':'犯罪','v':'genre/犯罪'},{'n':'科幻','v':'genre/科幻'},{'n':'西部','v':'genre/西部'}]}],
|
||||
};
|
||||
return JSON.stringify({
|
||||
class: classes,
|
||||
filters: filterObj,
|
||||
});
|
||||
}
|
||||
|
||||
async function homeVod() {}
|
||||
|
||||
async function category(tid, pg, filter, extend) {
|
||||
if (pg <= 0) pg = 1;
|
||||
let path = '';
|
||||
const prefixMap = {
|
||||
'movies': TYPE_MOVIE,
|
||||
'tv-shows': TYPE_TVSHOW,
|
||||
}
|
||||
const prefix = prefixMap[tid];
|
||||
if (extend.class) {
|
||||
path = '/' + prefix + '-' + extend.class;
|
||||
} else {
|
||||
path = '/' + tid;
|
||||
}
|
||||
let page = '';
|
||||
if (pg > 1) {
|
||||
page = 'page/' + pg + '/';
|
||||
}
|
||||
const link = HOST + path + '/' + page;
|
||||
const html = await request(link);
|
||||
const $ = load(html);
|
||||
const videos = [];
|
||||
parseVideoList($, prefix, false, videos);
|
||||
const limit = 20;
|
||||
const hasMore = $('.page-numbers a.next').length > 0;
|
||||
const pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
|
||||
return JSON.stringify({
|
||||
page: parseInt(pg),
|
||||
pagecount: pgCount,
|
||||
limit: limit,
|
||||
total: limit * pgCount,
|
||||
list: videos,
|
||||
});
|
||||
}
|
||||
|
||||
function parseVideoList($, prefix, imgSrc, videos) {
|
||||
const items = $('.' + prefix);
|
||||
_.each(items, (item) => {
|
||||
const $item = $(item);
|
||||
const title = $item.find('.' + prefix + '__title:first').text();
|
||||
const url = $item.find('.' + prefix + '__actions a:first').attr('href');
|
||||
const imgAttr = imgSrc ? 'src' : 'data-lazy-src';
|
||||
const image = $item.find('.' + prefix + '__poster img:first').attr(imgAttr);
|
||||
const remarks = $item.find('.' + prefix + '__meta span:last').text();
|
||||
if (!url) return;
|
||||
const videoItem = {
|
||||
vod_id: decodeURIComponent(url.replace(/.*\/\/.*\/(.*\/.*)\//g, '$1')),
|
||||
vod_name: title,
|
||||
vod_pic: image,
|
||||
vod_remarks: remarks,
|
||||
};
|
||||
videos.push(videoItem);
|
||||
});
|
||||
}
|
||||
|
||||
async function detail(id) {
|
||||
const isMovieType = id.startsWith(TYPE_MOVIE);
|
||||
const html = await request(HOST + '/' + id + '/');
|
||||
const $ = load(html);
|
||||
const prefix = isMovieType ? TYPE_MOVIE : TYPE_TVSHOW;
|
||||
const vod = {
|
||||
vod_id: id,
|
||||
vod_name: $('.' + prefix + '_title').text(),
|
||||
vod_actor: $('.' + prefix + '-casts').text().trim().substring(3).replace(/\s+\/\s+/g, '/'),
|
||||
vod_pic: $('.' + prefix + '__poster img:first').attr('data-lazy-src'),
|
||||
vod_remarks: $('.' + prefix + '__meta span:last').text(),
|
||||
};
|
||||
if (isMovieType) {
|
||||
vod.vod_type = $('.' + prefix + '__meta span:last').text();
|
||||
vod.vod_year = $('.' + prefix + '__meta span:first').text();
|
||||
vod.vod_content = $('.movie__description').text();
|
||||
} else {
|
||||
vod.vod_type = $('.' + prefix + '__meta span:first').text();
|
||||
vod.vod_content = $('.tv-show__info--body').text();
|
||||
}
|
||||
const from = 'ggys';
|
||||
const playMap = {};
|
||||
if (isMovieType) {
|
||||
const playId = $('.ggys-video-player').attr('data-source-id');
|
||||
const playCfg = playId + '@' + TYPE_MOVIE;
|
||||
playMap[from] = [ '全$' + playCfg ];
|
||||
} else {
|
||||
const tabs = $('.tv_show__season-tabs-wrap .nav-item');
|
||||
const episodes = $('.episodes');
|
||||
_.each(tabs, (tab, i) => {
|
||||
const titlePrefix = $(tab).text().trim();
|
||||
const episodeList = $(episodes[i]).find('.episode__body');
|
||||
_.each(episodeList, (episode) => {
|
||||
const $episode = $(episode);
|
||||
const title = titlePrefix + ' ' + $episode.text().trim();
|
||||
const url = $episode.find('a').attr('href');
|
||||
const playCfg = url + '@' + TYPE_TVSHOW;
|
||||
if (!playMap.hasOwnProperty(from)) {
|
||||
playMap[from] = [];
|
||||
}
|
||||
playMap[from].push(title + '$' + playCfg);
|
||||
});
|
||||
});
|
||||
}
|
||||
vod.vod_play_from = _.keys(playMap).join('$$$');
|
||||
const urls = _.values(playMap);
|
||||
const vod_play_url = _.map(urls, (urlist) => {
|
||||
return urlist.join('#');
|
||||
});
|
||||
vod.vod_play_url = vod_play_url.join('$$$');
|
||||
return JSON.stringify({
|
||||
list: [vod],
|
||||
});
|
||||
}
|
||||
|
||||
async function play(flag, id, flags) {
|
||||
const playCfg = id.split('@');
|
||||
const playType = playCfg[1];
|
||||
let playId = playCfg[0];
|
||||
let playUrl;
|
||||
if (playType == TYPE_TVSHOW) {
|
||||
const html = await request(playId);
|
||||
const $ = load(html);
|
||||
playId = $('.ggys-video-player').attr('data-source-id');
|
||||
}
|
||||
const param = {
|
||||
video_id: playId,
|
||||
};
|
||||
const resp = await request(HOST + '/wp-json/get_addr/v1/get_video_url', 'post', param);
|
||||
playUrl = JSON.parse(resp).video_url;
|
||||
const headers = {
|
||||
'User-Agent': UA,
|
||||
'Referer': HOST,
|
||||
};
|
||||
return JSON.stringify({
|
||||
parse: 0,
|
||||
url: playUrl,
|
||||
header: headers,
|
||||
});
|
||||
}
|
||||
|
||||
async function search(wd, quick, pg) {
|
||||
let page = '';
|
||||
if (pg > 1) {
|
||||
page = '/page/' + pg;
|
||||
}
|
||||
const url = HOST + '/search/' + wd + page + '/?post_type=';
|
||||
const videos = [];
|
||||
let html = await request(url + 'movie');
|
||||
let $ = load(html);
|
||||
parseVideoList($, TYPE_MOVIE, true, videos);
|
||||
const hasMoreMovie = $('.page-numbers a.next').length > 0;
|
||||
html = await request(url + 'tv_show');
|
||||
$ = load(html);
|
||||
parseVideoList($, TYPE_TVSHOW, true, videos);
|
||||
const hasMoreTVShow = $('.page-numbers a.next').length > 0;
|
||||
const limit = 40;
|
||||
const hasMore = hasMoreMovie || hasMoreTVShow;
|
||||
const pgCount = hasMore ? parseInt(pg) + 1 : parseInt(pg);
|
||||
return JSON.stringify({
|
||||
page: parseInt(pg),
|
||||
pagecount: pgCount,
|
||||
limit: limit,
|
||||
total: limit * pgCount,
|
||||
list: videos,
|
||||
});
|
||||
}
|
||||
|
||||
export function __jsEvalReturn() {
|
||||
return {
|
||||
init: init,
|
||||
home: home,
|
||||
homeVod: homeVod,
|
||||
category: category,
|
||||
detail: detail,
|
||||
play: play,
|
||||
search: search,
|
||||
};
|
||||
}
|
||||
1
骚零/api/lf_p2p1_min.js
Normal file
1
骚零/api/lf_p2p1_min.js
Normal file
File diff suppressed because one or more lines are too long
304
骚零/api/模板.js
Normal file
304
骚零/api/模板.js
Normal file
@@ -0,0 +1,304 @@
|
||||
if (typeof Object.assign != 'function') {
|
||||
Object.assign = function () {
|
||||
var target = arguments[0];
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i];
|
||||
for (var key in source) {
|
||||
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
||||
target[key] = source[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
return target;
|
||||
};
|
||||
}
|
||||
function getMubans() {
|
||||
var mubanDict = { // 模板字典
|
||||
mxpro: {
|
||||
title: '',
|
||||
host: '',
|
||||
// homeUrl:'/',
|
||||
url: '/vodshow/fyclass--------fypage---.html',
|
||||
searchUrl: '/vodsearch/**----------fypage---.html',
|
||||
searchable: 2,//是否启用全局搜索,
|
||||
quickSearch: 0,//是否启用快速搜索,
|
||||
filterable: 0,//是否启用分类筛选,
|
||||
headers: {//网站的请求头,完整支持所有的,常带ua和cookies
|
||||
'User-Agent': 'MOBILE_UA',
|
||||
// "Cookie": "searchneed=ok"
|
||||
},
|
||||
class_parse: '.navbar-items li:gt(2):lt(8);a&&Text;a&&href;/(\\d+).html',
|
||||
play_parse: true,
|
||||
lazy: '',
|
||||
limit: 6,
|
||||
推荐: '.tab-list.active;a.module-poster-item.module-item;.module-poster-item-title&&Text;.lazyload&&data-original;.module-item-note&&Text;a&&href',
|
||||
double: true, // 推荐内容是否双层定位
|
||||
一级: 'body a.module-poster-item.module-item;a&&title;.lazyload&&data-original;.module-item-note&&Text;a&&href',
|
||||
二级: {
|
||||
"title": "h1&&Text;.module-info-tag&&Text",
|
||||
"img": ".lazyload&&data-original",
|
||||
"desc": ".module-info-item:eq(1)&&Text;.module-info-item:eq(2)&&Text;.module-info-item:eq(3)&&Text",
|
||||
"content": ".module-info-introduction&&Text",
|
||||
"tabs": ".module-tab-item",
|
||||
"lists": ".module-play-list:eq(#id) a"
|
||||
},
|
||||
搜索: 'body .module-item;.module-card-item-title&&Text;.lazyload&&data-original;.module-item-note&&Text;a&&href;.module-info-item-content&&Text',
|
||||
},
|
||||
mxone5: {
|
||||
title: '',
|
||||
host: '',
|
||||
url: '/show/fyclass--------fypage---.html',
|
||||
searchUrl: '/search/**----------fypage---.html',
|
||||
searchable: 2,//是否启用全局搜索,
|
||||
quickSearch: 0,//是否启用快速搜索,
|
||||
filterable: 0,//是否启用分类筛选,
|
||||
class_parse: '.nav-menu-items&&li;a&&Text;a&&href;.*/(.*?).html',
|
||||
play_parse: true,
|
||||
lazy: '',
|
||||
limit: 6,
|
||||
推荐: '.module-list;.module-items&&.module-item;a&&title;img&&data-src;.module-item-text&&Text;a&&href',
|
||||
double: true, // 推荐内容是否双层定位
|
||||
一级: '.module-items .module-item;a&&title;img&&data-src;.module-item-text&&Text;a&&href',
|
||||
二级: {
|
||||
"title": "h1&&Text;.tag-link&&Text",
|
||||
"img": ".module-item-pic&&img&&data-src",
|
||||
"desc": ".video-info-items:eq(0)&&Text;.video-info-items:eq(1)&&Text;.video-info-items:eq(2)&&Text;.video-info-items:eq(3)&&Text",
|
||||
"content": ".vod_content&&Text",
|
||||
"tabs": ".module-tab-item",
|
||||
"lists": ".module-player-list:eq(#id)&&.scroll-content&&a"
|
||||
},
|
||||
搜索: '.module-items .module-search-item;a&&title;img&&data-src;.video-serial&&Text;a&&href',
|
||||
},
|
||||
首图: {
|
||||
title: '',
|
||||
host: '',
|
||||
url: '/vodshow/fyclass--------fypage---/',
|
||||
searchUrl: '/vodsearch/**----------fypage---.html',
|
||||
searchable: 2,//是否启用全局搜索,
|
||||
quickSearch: 0,//是否启用快速搜索,
|
||||
filterable: 0,//是否启用分类筛选,
|
||||
headers: {//网站的请求头,完整支持所有的,常带ua和cookies
|
||||
'User-Agent': 'MOBILE_UA',
|
||||
// "Cookie": "searchneed=ok"
|
||||
},
|
||||
class_parse: '.myui-header__menu li.hidden-sm:gt(0):lt(5);a&&Text;a&&href;/(\\d+).html',
|
||||
play_parse: true,
|
||||
lazy: '',
|
||||
limit: 6,
|
||||
推荐: 'ul.myui-vodlist.clearfix;li;a&&title;a&&data-original;.pic-text&&Text;a&&href',
|
||||
double: true, // 推荐内容是否双层定位
|
||||
一级: '.myui-vodlist li;a&&title;a&&data-original;.pic-text&&Text;a&&href',
|
||||
二级: {
|
||||
"title": ".myui-content__detail .title&&Text;.myui-content__detail p:eq(-2)&&Text",
|
||||
"img": ".myui-content__thumb .lazyload&&data-original",
|
||||
"desc": ".myui-content__detail p:eq(0)&&Text;.myui-content__detail p:eq(1)&&Text;.myui-content__detail p:eq(2)&&Text",
|
||||
"content": ".content&&Text",
|
||||
"tabs": ".nav-tabs:eq(0) li",
|
||||
"lists": ".myui-content__list:eq(#id) li"
|
||||
},
|
||||
搜索: '#searchList li;a&&title;.lazyload&&data-original;.text-muted&&Text;a&&href;.text-muted:eq(-1)&&Text',
|
||||
},
|
||||
首图2: {
|
||||
title: '',
|
||||
host: '',
|
||||
url: '/list/fyclass-fypage.html',
|
||||
searchUrl: '/vodsearch/**----------fypage---.html',
|
||||
searchable: 2,//是否启用全局搜索,
|
||||
quickSearch: 0,//是否启用快速搜索,
|
||||
filterable: 0,//是否启用分类筛选,
|
||||
headers: {
|
||||
'User-Agent': 'UC_UA',
|
||||
// "Cookie": ""
|
||||
},
|
||||
// class_parse:'.stui-header__menu li:gt(0):lt(7);a&&Text;a&&href;/(\\d+).html',
|
||||
class_parse: '.stui-header__menu li:gt(0):lt(7);a&&Text;a&&href;.*/(.*?).html',
|
||||
play_parse: true,
|
||||
lazy: '',
|
||||
limit: 6,
|
||||
推荐: 'ul.stui-vodlist.clearfix;li;a&&title;.lazyload&&data-original;.pic-text&&Text;a&&href',
|
||||
double: true, // 推荐内容是否双层定位
|
||||
一级: '.stui-vodlist li;a&&title;a&&data-original;.pic-text&&Text;a&&href',
|
||||
二级: {
|
||||
"title": ".stui-content__detail .title&&Text;.stui-content__detail p:eq(-2)&&Text",
|
||||
"img": ".stui-content__thumb .lazyload&&data-original",
|
||||
"desc": ".stui-content__detail p:eq(0)&&Text;.stui-content__detail p:eq(1)&&Text;.stui-content__detail p:eq(2)&&Text",
|
||||
"content": ".detail&&Text",
|
||||
"tabs": ".stui-vodlist__head h3",
|
||||
"lists": ".stui-content__playlist:eq(#id) li"
|
||||
},
|
||||
搜索: 'ul.stui-vodlist__media:eq(0) li,ul.stui-vodlist:eq(0) li,#searchList li;a&&title;.lazyload&&data-original;.text-muted&&Text;a&&href;.text-muted:eq(-1)&&Text',
|
||||
搜索1: 'ul.stui-vodlist&&li;a&&title;.lazyload&&data-original;.text-muted&&Text;a&&href;.text-muted:eq(-1)&&Text',
|
||||
搜索2: 'ul.stui-vodlist__media&&li;a&&title;.lazyload&&data-original;.text-muted&&Text;a&&href;.text-muted:eq(-1)&&Text',
|
||||
},
|
||||
默认: {
|
||||
title: '',
|
||||
host: '',
|
||||
url: '/vodshow/fyclass--------fypage---.html',
|
||||
searchUrl: '/vodsearch/-------------.html?wd=**',
|
||||
searchable: 2,//是否启用全局搜索,
|
||||
quickSearch: 0,//是否启用快速搜索,
|
||||
filterable: 0,//是否启用分类筛选,
|
||||
headers: {
|
||||
'User-Agent': 'MOBILE_UA',
|
||||
},
|
||||
play_parse: true,
|
||||
lazy: '',
|
||||
limit: 6,
|
||||
double: true, // 推荐内容是否双层定位
|
||||
},
|
||||
vfed: {
|
||||
title: '',
|
||||
host: '',
|
||||
url: '/index.php/vod/show/id/fyclass/page/fypage.html',
|
||||
searchUrl: '/index.php/vod/search/page/fypage/wd/**.html',
|
||||
searchable: 2,//是否启用全局搜索,
|
||||
quickSearch: 0,//是否启用快速搜索,
|
||||
filterable: 0,//是否启用分类筛选,
|
||||
headers: {
|
||||
'User-Agent': 'UC_UA',
|
||||
},
|
||||
// class_parse:'.fed-pops-navbar&&ul.fed-part-rows&&a.fed-part-eone:gt(0):lt(5);a&&Text;a&&href;.*/(.*?).html',
|
||||
class_parse: '.fed-pops-navbar&&ul.fed-part-rows&&a;a&&Text;a&&href;.*/(.*?).html',
|
||||
play_parse: true,
|
||||
lazy: '',
|
||||
limit: 6,
|
||||
推荐: 'ul.fed-list-info.fed-part-rows;li;a.fed-list-title&&Text;a&&data-original;.fed-list-remarks&&Text;a&&href',
|
||||
double: true, // 推荐内容是否双层定位
|
||||
一级: '.fed-list-info&&li;a.fed-list-title&&Text;a&&data-original;.fed-list-remarks&&Text;a&&href',
|
||||
二级: {
|
||||
"title": "h1.fed-part-eone&&Text;.fed-deta-content&&.fed-part-rows&&li&&Text",
|
||||
"img": ".fed-list-info&&a&&data-original",
|
||||
"desc": ".fed-deta-content&&.fed-part-rows&&li:eq(1)&&Text;.fed-deta-content&&.fed-part-rows&&li:eq(2)&&Text;.fed-deta-content&&.fed-part-rows&&li:eq(3)&&Text",
|
||||
"content": ".fed-part-esan&&Text",
|
||||
"tabs": ".fed-drop-boxs&&.fed-part-rows&&li",
|
||||
"lists": ".fed-play-item:eq(#id)&&ul:eq(1)&&li"
|
||||
},
|
||||
搜索: '.fed-deta-info;h1&&Text;.lazyload&&data-original;.fed-list-remarks&&Text;a&&href;.fed-deta-content&&Text',
|
||||
},
|
||||
海螺3: {
|
||||
title: '',
|
||||
host: '',
|
||||
searchUrl: '/v_search/**----------fypage---.html',
|
||||
url: '/vod_____show/fyclass--------fypage---.html',
|
||||
headers: {
|
||||
'User-Agent': 'MOBILE_UA'
|
||||
},
|
||||
timeout: 5000,
|
||||
class_parse: 'body&&.hl-nav li:gt(0);a&&Text;a&&href;.*/(.*?).html',
|
||||
cate_exclude: '明星|专题|最新|排行',
|
||||
limit: 40,
|
||||
play_parse: true,
|
||||
lazy: '',
|
||||
推荐: '.hl-vod-list;li;a&&title;a&&data-original;.remarks&&Text;a&&href',
|
||||
double: true,
|
||||
一级: '.hl-vod-list&&.hl-list-item;a&&title;a&&data-original;.remarks&&Text;a&&href',
|
||||
二级: {
|
||||
"title": ".hl-infos-title&&Text;.hl-text-conch&&Text",
|
||||
"img": ".hl-lazy&&data-original",
|
||||
"desc": ".hl-infos-content&&.hl-text-conch&&Text",
|
||||
"content": ".hl-content-text&&Text",
|
||||
"tabs": ".hl-tabs&&a",
|
||||
"lists": ".hl-plays-list:eq(#id)&&li"
|
||||
},
|
||||
搜索: '.hl-list-item;a&&title;a&&data-original;.remarks&&Text;a&&href',
|
||||
searchable: 2,//是否启用全局搜索,
|
||||
quickSearch: 0,//是否启用快速搜索,
|
||||
filterable: 0,//是否启用分类筛选,
|
||||
},
|
||||
海螺2: {
|
||||
title: '',
|
||||
host: '',
|
||||
searchUrl: '/index.php/vod/search/page/fypage/wd/**/',
|
||||
url: '/index.php/vod/show/id/fyclass/page/fypage/',
|
||||
headers: {
|
||||
'User-Agent': 'MOBILE_UA'
|
||||
},
|
||||
timeout: 5000,
|
||||
class_parse: '#nav-bar li;a&&Text;a&&href;id/(.*?)/',
|
||||
limit: 40,
|
||||
play_parse: true,
|
||||
lazy: '',
|
||||
推荐: '.list-a.size;li;a&&title;.lazy&&data-original;.bt&&Text;a&&href',
|
||||
double: true,
|
||||
一级: '.list-a&&li;a&&title;.lazy&&data-original;.list-remarks&&Text;a&&href',
|
||||
二级: {
|
||||
"title": "h2&&Text;.deployment&&Text",
|
||||
"img": ".lazy&&data-original",
|
||||
"desc": ".deployment&&Text",
|
||||
"content": ".ec-show&&Text",
|
||||
"tabs": "#tag&&a",
|
||||
"lists": ".play_list_box:eq(#id)&&li"
|
||||
},
|
||||
搜索: '.search-list;a&&title;.lazy&&data-original;.deployment&&Text;a&&href',
|
||||
searchable: 2,//是否启用全局搜索,
|
||||
quickSearch: 0,//是否启用快速搜索,
|
||||
filterable: 0,//是否启用分类筛选,
|
||||
},
|
||||
短视: {
|
||||
title: '',
|
||||
host: '',
|
||||
// homeUrl:'/',
|
||||
url: '/channel/fyclass-fypage.html',
|
||||
searchUrl: '/search.html?wd=**',
|
||||
searchable: 2,//是否启用全局搜索,
|
||||
quickSearch: 0,//是否启用快速搜索,
|
||||
filterable: 0,//是否启用分类筛选,
|
||||
headers: {//网站的请求头,完整支持所有的,常带ua和cookies
|
||||
'User-Agent': 'MOBILE_UA',
|
||||
// "Cookie": "searchneed=ok"
|
||||
},
|
||||
class_parse: '.menu_bottom ul li;a&&Text;a&&href;.*/(.*?).html',
|
||||
cate_exclude: '解析|动态',
|
||||
play_parse: true,
|
||||
lazy: '',
|
||||
limit: 6,
|
||||
推荐: '.indexShowBox;ul&&li;a&&title;img&&data-src;.s1&&Text;a&&href',
|
||||
double: true, // 推荐内容是否双层定位
|
||||
一级: '.pic-list&&li;a&&title;img&&data-src;.s1&&Text;a&&href',
|
||||
二级: {
|
||||
"title": "h1&&Text;.content-rt&&p:eq(0)&&Text",
|
||||
"img": ".img&&img&&data-src",
|
||||
"desc": ".content-rt&&p:eq(1)&&Text;.content-rt&&p:eq(2)&&Text;.content-rt&&p:eq(3)&&Text;.content-rt&&p:eq(4)&&Text;.content-rt&&p:eq(5)&&Text",
|
||||
"content": ".zkjj_a&&Text",
|
||||
"tabs": ".py-tabs&&option",
|
||||
"lists": ".player:eq(#id) li"
|
||||
},
|
||||
搜索: '.sr_lists&&ul&&li;h3&&Text;img&&data-src;.int&&p:eq(0)&&Text;a&&href',
|
||||
},
|
||||
短视2:{
|
||||
title: '',
|
||||
host: '',
|
||||
class_name:'电影&电视剧&综艺&动漫',
|
||||
class_url:'1&2&3&4',
|
||||
searchUrl: '/index.php/ajax/suggest?mid=1&wd=**&limit=50',
|
||||
searchable: 2,
|
||||
quickSearch: 0,
|
||||
headers:{'User-Agent':'MOBILE_UA'},
|
||||
url: '/index.php/api/vod#type=fyclass&page=fypage',
|
||||
filterable:0,//是否启用分类筛选,
|
||||
filter_url:'',
|
||||
filter: {},
|
||||
filter_def:{},
|
||||
detailUrl:'/index.php/vod/detail/id/fyid.html',
|
||||
play_parse: true,
|
||||
lazy: '',
|
||||
limit: 6,
|
||||
推荐:'.list-vod.flex .public-list-box;a&&title;.lazy&&data-original;.public-list-prb&&Text;a&&href',
|
||||
一级:'js:let body=input.split("#")[1];let t=Math.round(new Date/1e3).toString();let key=md5("DS"+t+"DCC147D11943AF75");let url=input.split("#")[0];body=body+"&time="+t+"&key="+key;print(body);fetch_params.body=body;let html=post(url,fetch_params);let data=JSON.parse(html);VODS=data.list.map(function(it){it.vod_pic=urljoin2(input.split("/i")[0],it.vod_pic);return it});',
|
||||
二级:{
|
||||
"title":".slide-info-title&&Text;.slide-info:eq(3)--strong&&Text",
|
||||
"img":".detail-pic&&data-original",
|
||||
"desc":".fraction&&Text;.slide-info-remarks:eq(1)&&Text;.slide-info-remarks:eq(2)&&Text;.slide-info:eq(2)--strong&&Text;.slide-info:eq(1)--strong&&Text",
|
||||
"content":"#height_limit&&Text",
|
||||
"tabs":".anthology.wow.fadeInUp.animated&&.swiper-wrapper&&a",
|
||||
"tab_text":".swiper-slide&&Text",
|
||||
"lists":".anthology-list-box:eq(#id) li"
|
||||
},
|
||||
搜索:'json:list;name;pic;;id',
|
||||
}
|
||||
};
|
||||
return JSON.parse(JSON.stringify(mubanDict));
|
||||
}
|
||||
var mubanDict = getMubans();
|
||||
var muban = getMubans();
|
||||
export default {muban,getMubans};
|
||||
Reference in New Issue
Block a user