Files
tvbox/js/adult/色播.js
Wang.Luo 3572e29279 ```
feat(PyramidStore): 初始化项目并添加基础配置文件

添加 .gitignore 忽略子仓库的 .git 目录
添加 LICENSE 文件,使用 GNU General Public License v3.0
添加 README.md 说明文档,包含调试示例、免责声明和配置说明
添加 base/localProxy.py 基础代理配置文件
添加版本控制图片文件(二进制差异)
```
2025-10-23 02:14:43 +08:00

98 lines
2.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { Crypto, load, _ } from 'assets://js/lib/cat.js';
/**
* 直播源
* authorLeospring
*/
let siteUrl = 'http://api.maiyoux.com:81/mf/';
let siteKey = '';
let siteType = 0;
let cateList = {};
async function request(reqUrl, postData, post) {
let res = await req(reqUrl, {
method: post ? 'post' : 'get',
data: postData || {},
postType: post ? 'form' : '',
});
let content = res.content;
return content;
}
async function init(cfg) {
siteKey = cfg.skey;
siteType = cfg.stype;
if (cfg.ext) {
siteUrl = cfg.ext;
}
cateList = JSON.parse(await request(siteUrl + 'json.txt'));
}
async function home(filter) {
let classes = [];
Object.keys(cateList).forEach(function(key) {
classes.push({
type_id: key,
type_name: key,
});
});
return JSON.stringify({
class: classes,
// filters: filterObj
});
}
async function category(tid, pg, filter, ext) {
let videos = _.map(cateList[tid], (item) => {
return {
vod_id: item['address'],
vod_name: item['title'],
vod_pic: item['xinimg'],
vod_remarks: item['Number']
}
})
return JSON.stringify({
list: videos,
page: pg,
pagecount: 1,
total: videos.length
});
}
async function detail(id) {
try {
const res = JSON.parse(await request(siteUrl + id))['zhubo'];
let playUrls = _.map(res, (vod) => {
return vod.title + '$' + vod.address;
}).join('#');
const video = {
vod_play_from: 'Leospring',
vod_play_url: playUrls,
vod_content: '作者Leospring 公众号:蚂蚁科技杂谈',
};
const list = [video];
const result = { list };
return JSON.stringify(result);
} catch (e) {
console.log('err', e);
}
return null;
}
async function play(flag, id, flags) {
let playUrl = id;
return JSON.stringify({
parse: 0,
url: playUrl,
});
}
export function __jsEvalReturn() {
return {
init: init,
home: home,
category: category,
detail: detail,
play: play,
};
}