update CAT

This commit is contained in:
qist 2024-04-17 11:16:03 +08:00
parent 14f58c87f5
commit 4ce167269d
17 changed files with 855 additions and 369 deletions

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
d070e350bde0dedca01f15f421418c76
d80c5c5f48a2111372fc72c6e27bb531

454
cat/dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
e0fed13dde6b55b30f1ffb754630e27f
944282601a1c78f978b6e07949cb420c

View File

@ -99,7 +99,7 @@ class BilibiliSpider extends Spider {
for (const navElement of navElements) {
this.classes.push(this.getTypeDic($(navElement).text(), $(navElement).text()))
}
if (!_.isEmpty(this.bili_jct)) {
if (!_.isEmpty(this.bili_jct) && this.is_login) {
this.classes.push(this.getTypeDic("历史记录", "历史记录"))
}
}
@ -402,12 +402,19 @@ class BilibiliSpider extends Spider {
this.vodList = await this.parseVodShortListFromJson(items)
}
async setSearch(wd, quick) {
async setSearch(wd, quick, pg) {
const ext = {
duration: '0',
};
let resp = JSON.parse(await this.category(wd, 1, true, ext));
let page = parseInt(pg)
const limit = 20
let resp = JSON.parse(await this.category(wd, page, true, ext));
this.vodList = resp["list"]
let pageCount = page;
if (this.vodList.length === limit) {
pageCount = page + 1;
}
this.result.setPage(page, pageCount, limit, pageCount)
}
getDashMedia(dash) {

View File

@ -11,7 +11,6 @@ import {_, load} from '../lib/cat.js';
import {VodDetail, VodShort} from "../lib/vod.js"
import * as Utils from "../lib/utils.js";
import {Spider} from "./spider.js";
import {detailContent} from "../lib/ali.js";
class CiliDuoSpider extends Spider {

View File

@ -492,6 +492,7 @@ class DoubanSpider extends Spider {
let raw_sign = [method.toLocaleUpperCase(), url_path, ts.toString()].join("&")
return Crypto.HmacSHA1(raw_sign, _api_secret_key).toString(Crypto.enc.Base64)
}
async setHomeVod() {
let url = this.siteUrl + "/subject_collection/subject_real_time_hotest/items"
let content = await this.fetch(url, {"apikey": this.apiKey}, this.getHeader())
@ -510,8 +511,8 @@ class DoubanSpider extends Spider {
this.limit = 20;
this.total = 0;
let start = 0
if (parseInt(pg) > 1){
start = (parseInt(pg) - 1) * this.limit
if (parseInt(pg) > 1) {
start = (parseInt(pg) - 1) * this.limit
}
let cateUrl = ""
let params = {"start": start.toString(), "count": this.limit.toString()}
@ -565,25 +566,33 @@ class DoubanSpider extends Spider {
this.vodList = await this.parseVodShortListFromJson(items)
}
}
async setSearch(wd, quick) {
async setSearch(wd, quick, pg) {
let _api_url = "https://frodo.douban.com/api/v2"
let _api_key = "0dad551ec0f84ed02907ff5c42e8ec70"
let url = _api_url + "/search/movie"
let date = new Date()
let ts = date.getFullYear().toString() + (date.getMonth() + 1).toString() + date.getDate().toString()
let ts = date.getFullYear().toString() + ('0' + (date.getMonth() + 1)).slice(-2).toString() + date.getDate().toString()
const limit = 20
let params = {
'_sig': this.sign(url, ts),
'_ts': ts,
'apiKey': _api_key,
'count': 20,
'count': limit,
'os_rom': 'android',
'q': encodeURIComponent(wd),
'start': 0
'start': parseInt(pg)
}
let content = await this.fetch(url, params, this.getSearchHeader())
if (!_.isEmpty(content)) {
let content_json = JSON.parse(content)
this.vodList = await this.parseVodShortListFromJson(content_json["items"])
const page = parseInt(pg);
let pageCount = page;
if (this.vodList.length === limit) {
pageCount = page + 1;
}
this.result.setPage(page, pageCount, limit, pageCount)
}
}
}
@ -623,4 +632,5 @@ export function __jsEvalReturn() {
init: init, home: home, homeVod: homeVod, category: category, detail: detail, play: play, search: search,
};
}
export {spider}

75
cat/tjs/js/dubo.js Normal file
View File

@ -0,0 +1,75 @@
/*
* @File : dubo.js
* @Author : jade
* @Date : 2024/4/16 18:46
* @Email : jadehh@1ive.com
* @Software : Samples
* @Desc :
*/
import {TianTianSpider} from "./tiantian.js"
class DuboSpider extends TianTianSpider {
constructor() {
super();
this.siteUrl = "http://v.rbotv.cn"
this.cookie = ""
this.extendObj = {"extend": "类型", "area": "地区", "lang": "语言", "year": "年代"}
this.parseMap = {};
}
getName() {
return "🛶┃独播影视┃🛶"
}
getAppName() {
return "独播影视"
}
getJSName() {
return "dubo"
}
getType() {
return 3
}
async init(cfg) {
await super.init(cfg);
this.danmuStaus = false
}
}
let spider = new DuboSpider()
async function init(cfg) {
await spider.init(cfg)
}
async function home(filter) {
return await spider.home(filter)
}
async function homeVod() {
return await spider.homeVod()
}
async function category(tid, pg, filter, extend) {
return await spider.category(tid, pg, filter, extend)
}
async function detail(id) {
return await spider.detail(id)
}
async function play(flag, id, flags) {
return await spider.play(flag, id, flags)
}
async function search(wd, quick) {
return await spider.search(wd, quick)
}
export function __jsEvalReturn() {
return {
init: init, home: home, homeVod: homeVod, category: category, detail: detail, play: play, search: search,
};
}
export {spider}

View File

@ -9,7 +9,7 @@
import {Crypto, jinja2, _} from "../lib/cat.js";
import {Spider} from "./spider.js";
import {VodDetail, VodShort} from "../lib/vod.js";
import * as Utils from "../lib/utils.js";
function stripHtmlTag(src) {
return src
.replace(/<\/?[^>]+(>|$)/g, '')
@ -89,7 +89,10 @@ class NanGuaSpider extends Spider {
}, {
"key": "year",
"name": "年份",
"value": [{"n": "全部", "v": "年份"}, {"n": "2024", "v": "2024"}, {"n": "2023", "v": "2023"}, {"n": "2022", "v": "2022"}, {
"value": [{"n": "全部", "v": "年份"}, {"n": "2024", "v": "2024"}, {
"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"
@ -117,7 +120,10 @@ class NanGuaSpider extends Spider {
}, {
"key": "year",
"name": "年份",
"value": [{"n": "全部", "v": "年份"}, {"n": "2024", "v": "2024"}, {"n": "2023", "v": "2023"}, {"n": "2022", "v": "2022"}, {
"value": [{"n": "全部", "v": "年份"}, {"n": "2024", "v": "2024"}, {
"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"
@ -141,7 +147,10 @@ class NanGuaSpider extends Spider {
}, {
"key": "year",
"name": "年份",
"value": [{"n": "全部", "v": "年份"}, {"n": "2024", "v": "2024"}, {"n": "2023", "v": "2023"}, {"n": "2022", "v": "2022"}, {
"value": [{"n": "全部", "v": "年份"}, {"n": "2024", "v": "2024"}, {
"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"
@ -169,7 +178,10 @@ class NanGuaSpider extends Spider {
}, {
"key": "year",
"name": "年份",
"value": [{"n": "全部", "v": "年份"}, {"n": "2024", "v": "2024"}, {"n": "2023", "v": "2023"}, {"n": "2022", "v": "2022"}, {
"value": [{"n": "全部", "v": "年份"}, {"n": "2024", "v": "2024"}, {
"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"
@ -193,7 +205,10 @@ class NanGuaSpider extends Spider {
}, {
"key": "year",
"name": "年份",
"value": [{"n": "全部", "v": "年份"}, {"n": "2024", "v": "2024"}, {"n": "2023", "v": "2023"}, {"n": "2022", "v": "2022"}, {
"value": [{"n": "全部", "v": "年份"}, {"n": "2024", "v": "2024"}, {
"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"
@ -208,9 +223,9 @@ class NanGuaSpider extends Spider {
};
}
async parseVodShortListFromJSONByHome(obj){
async parseVodShortListFromJSONByHome(obj) {
let vod_list = []
for (const data of obj["video"]){
for (const data of obj["video"]) {
let video_vod_list = await this.parseVodShortListFromJson(data["data"])
vod_list.push(...video_vod_list)
}
@ -219,13 +234,13 @@ class NanGuaSpider extends Spider {
async parseVodShortListFromJson(obj) {
let vod_list = []
for (const data of obj){
for (const data of obj) {
let vodShort = new VodShort()
vodShort.vod_id = data["id"]
vodShort.vod_name = data["name"]
vodShort.vod_pic = data["img"]
vodShort.vod_remarks = data["remarks"]
if (_.isEmpty(vodShort.vod_remarks)){
if (_.isEmpty(vodShort.vod_remarks)) {
vodShort.vod_remarks = data["msg"]
}
vod_list.push(vodShort)
@ -236,11 +251,15 @@ class NanGuaSpider extends Spider {
async parseVodShortListFromJsonBySearch(obj) {
let videos = [];
obj.forEach(function (it) {
videos.push({
vod_id: it.id, vod_name: it["video_name"], vod_pic: it.img, vod_remarks: it["qingxidu"] + '/' + it.category,
});
});
for (const data of obj){
let vodShort = new VodShort()
vodShort.vod_id = data["id"]
vodShort.vod_name = data["video_name"]
vodShort.vod_remarks = data["qingxidu"]
vodShort.vod_pic = Utils.formatUrl(data["img"])
videos.push(vodShort)
}
return videos
}
@ -299,9 +318,16 @@ class NanGuaSpider extends Spider {
this.vodDetail = await this.parseVodDetailfromJson(data)
}
async setSearch(wd, quick) {
let data = JSON.parse(await this.fetch(this.siteUrl + '/api.php/provide/search_result_more?app=ylys&video_name=' + wd + '&pageSize=20&tid=0&imei=c431ea542cee9679&page=0', null, this.getHeader())).data;
async setSearch(wd, quick, pg) {
let page = parseInt(pg)
const limit = 20
let data = JSON.parse(await this.fetch(this.siteUrl + '/api.php/provide/search_result_more?app=ylys&video_name=' + wd + `&pageSize=${limit}&tid=0&imei=c431ea542cee9679&page=${pg}`, null, this.getHeader())).data;
this.vodList = await this.parseVodShortListFromJsonBySearch(data)
let pageCount = page;
if (this.vodList.length === limit) {
pageCount = page + 1;
}
this.result.setPage(page, pageCount, limit, pageCount)
}
async setPlay(flag, id, flags) {
@ -359,4 +385,5 @@ export function __jsEvalReturn() {
init: init, home: home, homeVod: homeVod, category: category, detail: detail, play: play, search: search,
};
}
export {spider}

View File

@ -681,7 +681,7 @@ class Spider {
async search(wd, quick) {
this.vodList = []
await this.jadeLog.info(`正在解析搜索页面,关键词为 = ${wd},quick = ${quick}`)
await this.setSearch(wd, quick)
await this.setSearch(wd, quick,1)
if (this.vodList.length === 0) {
if (wd.indexOf(" ") > -1) {
await this.jadeLog.debug(`搜索关键词为:${wd},其中有空格,去除空格在搜索一次`)

View File

@ -55,9 +55,9 @@ async function test() {
await spider.init({
skey: siteKey, stype: siteType, ext: {
"token": "6827db23e5474d02a07fd7431d3d5a5a",
"box": "bilibili",
"box": "TV",
"code": "1",
"from": "justlive1",
"from": "bilibili",
"danmu": true,
"cookie": "buvid3=02675249-8ED3-C418-87F5-59E18316459714816infoc; b_nut=1704421014; _uuid=5D435F74-F574-D9AB-62C1-B9294DE465D913102infoc; buvid_fp=e8c5650c749398e9b5cad3f3ddb5081e; buvid4=007E85D1-52C1-7E6E-07CF-837FFBC9349516677-024010502-J5vTDSZDCw4fNnXRejbSVg%3D%3D; rpdid=|()kYJmulRu0J'u~|RRJl)JR; PVID=1; SESSDATA=3be091d3%2C1720332009%2C699ed%2A11CjAcCdwXG5kY1umhCOpQHOn_WP7L9xFBfWO7KKd4BPweodpR6VyIfeNyPiRmkr5jCqsSVjg0R0dZOVVHRUo3RnhPRTZFc3JPbGdiUjFCdHpiRDhiTkticmdKTjVyS1VhbDdvNjFMSDJlbUJydUlRdjFUNGFBNkJlV2ZTa0N1Q1BEVi1QYTQzTUh3IIEC; bili_jct=b0ee7b5d3f27df893545d811d95506d4; DedeUserID=78014638; DedeUserID__ckMd5=4c8c5d65065e468a; enable_web_push=DISABLE; header_theme_version=CLOSE; home_feed_column=5; CURRENT_BLACKGAP=0; CURRENT_FNVAL=4048; b_lsid=75E916AA_18EA1A8D995; bsource=search_baidu; FEED_LIVE_VERSION=V_HEADER_LIVE_NO_POP; browser_resolution=1507-691; bili_ticket=eyJhbGciOiJIUzI1NiIsImtpZCI6InMwMyIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MTIzNjk5MTMsImlhdCI6MTcxMjExMDY1MywicGx0IjotMX0.8zQW_fNTCSBlK_JkHnzu3gDw62wuTK1qgKcbGec3swM; bili_ticket_expires=171236985"
}
@ -68,25 +68,30 @@ async function test() {
console.debug(JSON.stringify(classes))
// //测试首页列表
let homeVod = JSON.parse(await spider.homeVod())
console.debug(JSON.stringify(homeVod));
// 测试搜索
let search_page = JSON.parse(await spider.search("王牌",false,2))
console.debug(JSON.stringify(search_page))
// 测试详情
let detail1 = JSON.parse(await spider.detail("BV1Pp421R7pn"))
let detail1 = JSON.parse(await spider.detail("86534"))
await testPlay(detail1)
;
let catePage = JSON.parse(await spider.category("2", "1", undefined, {}));
console.debug(JSON.stringify(catePage));
// 测试搜索
let search_page = JSON.parse(await spider.search("王牌"))
console.debug(JSON.stringify(search_page));

277
cat/tjs/js/tiantian.js Normal file
View File

@ -0,0 +1,277 @@
/*
* @File : tiantian.js
* @Author : jade
* @Date : 2024/04/15 10:48
* @Email : jadehh@1ive.com
* @Software : Samples
* @Desc : 天天影视
*/
import {Spider} from "./spider.js";
import {_} from "../lib/cat.js";
import * as Utils from "../lib/utils.js";
import {VodDetail, VodShort} from "../lib/vod.js";
class TianTianSpider extends Spider {
constructor() {
super();
this.siteUrl = "http://op.ysdqjs.cn"
this.cookie = ""
this.extendObj = {"extend": "类型", "area": "地区", "lang": "语言", "year": "年代"}
this.parseMap = {};
}
async request(reqUrl, method, data) {
const headers = {
'User-Agent': Utils.CHROME,
};
if (!_.isEmpty(this.cookie)) {
headers['Cookie'] = this.cookie;
}
const postType = method === 'post' ? 'form-data' : '';
let res = await req(reqUrl, {
method: method || 'get', headers: headers, data: data, postType: postType,
});
if (res.code === 403) {
const path = res.data.match(/window\.location\.href ="(.*?)"/)[1];
this.cookie = _.isArray(res.headers['set-cookie']) ? res.headers['set-cookie'].join(';') : res.headers['set-cookie'];
headers['Cookie'] = this.cookie;
res = await req(this.siteUrl + path, {
method: method || 'get', headers: headers, data: data, postType: postType,
});
}
return res.content;
}
async postData(url, data) {
const timestamp = Math.floor(new Date().getTime() / 1000);
const key = 'kj5649ertj84ks89r4jh8s45hf84hjfds04k';
const sign = md5X(key + timestamp).toString();
let defaultData = {
sign: sign, timestamp: timestamp,
};
const reqData = data ? _.merge(defaultData, data) : defaultData;
return await this.request(url, 'post', reqData);
}
getName() {
return "⛄┃天天影视┃⛄"
}
getAppName() {
return "天天影视"
}
getJSName() {
return "tiantian"
}
getType() {
return 3
}
async init(cfg) {
await super.init(cfg);
this.danmuStaus = false
}
generateParam(tid, pg, extend, limit) {
const param = {
type_id: tid, page: pg, limit: limit,
};
if (extend.class) {
param.class = extend.class;
}
if (extend.area) {
param.area = extend.area;
}
if (extend.lang) {
param.lang = extend.lang;
}
if (extend.year) {
param.year = extend.year;
}
// if (extend.order) {
// param.order = extend.order;
// }
return param;
}
async getFilter(data) {
let extend_list = []
Object.keys(data).forEach(key => {
if (Array.isArray(data[key])) {
let extend_dic = {"key": key, "name": this.extendObj[key], "value": []}
for (const extend_data of data[key]) {
extend_dic["value"].push({"n": extend_data, "v": extend_data})
}
extend_list.push(extend_dic)
}
})
return extend_list
}
async setClasses() {
let resJson = JSON.parse(await this.postData(this.siteUrl + '/v2/type/top_type'))
for (const data of resJson["data"]["list"]) {
let type_name = data["type_name"]
let type_id = data["type_id"].toString()
this.classes.push(this.getTypeDic(type_name, type_id))
this.filterObj[type_id] = await this.getFilter(data)
}
}
async parseVodShortListFromJson(vodList) {
let vod_list = []
for (const vodData of vodList) {
let vodShort = new VodShort()
vodShort.load_data(vodData)
if (_.isEmpty(vodShort.vod_pic) && vodData["vod_pic_thumb"] !== undefined){
vodShort.vod_pic = vodData["vod_pic_thumb"]
}
if (vodShort.vod_name !== "首页轮播"){
vod_list.push(vodShort)
}
}
return vod_list
}
async parseVodDetailfromJson(detailObj) {
let vodDetail = new VodDetail()
vodDetail.load_data(detailObj)
vodDetail.vod_content = Utils.formatContent(vodDetail.vod_content)
const playInfo = detailObj["vod_play_list"];
const playVod = {};
_.each(playInfo, (obj) => {
const sourceName = obj.name;
let playList = '';
const videoInfo = obj.urls;
const parse = obj["parse_urls"];
if (!_.isEmpty(parse)) this.parseMap[sourceName] = parse;
const vodItems = _.map(videoInfo, (epObj) => {
const epName = epObj.name;
const playUrl = epObj.url;
return epName + '$' + playUrl;
});
if (_.isEmpty(vodItems)) return;
playList = vodItems.join('#');
playVod[sourceName] = playList;
});
vodDetail.vod_play_from = _.keys(playVod).join('$$$');
vodDetail.vod_play_url = _.values(playVod).join('$$$');
return vodDetail
}
async setHomeVod() {
let resJson = JSON.parse(await this.postData(this.siteUrl + '/v2/type/tj_vod'))
let vod_list = []
for (const data of resJson["data"]["type_vod"]) {
if (data["type_name"] !== "广告") {
vod_list = await this.parseVodShortListFromJson(data["vod"])
this.homeVodList = [...this.homeVodList,...vod_list]
}
}
vod_list = await this.parseVodShortListFromJson(resJson["data"]["loop"])
this.homeVodList = [...this.homeVodList,...vod_list]
vod_list = await this.parseVodShortListFromJson(resJson["data"]["cai"])
this.homeVodList = [...this.homeVodList,...vod_list]
}
async setCategory(tid, pg, filter, extend) {
const limit = 12;
const param = this.generateParam(tid, pg, extend, limit);
const resJson = JSON.parse(await this.postData(this.siteUrl + '/v2/home/type_search', param));
this.vodList = await this.parseVodShortListFromJson(resJson["data"]["list"])
}
async setDetail(id) {
const param = {
vod_id: id,
}
const resJson = JSON.parse(await this.postData(this.siteUrl + '/v2/home/vod_details', param));
this.vodDetail = await this.parseVodDetailfromJson(resJson["data"])
}
async setPlay(flag, id, flags) {
const parsers = this.parseMap[flag];
if (flag.indexOf("芒果") > -1 || flag.indexOf("腾讯") > -1 || flag.indexOf("爱奇艺") > -1) {
this.danmuStaus = true
if (!this.catOpenStatus) {
this.danmuUrl = await this.danmuSpider.downloadDanmu("https://dmku.thefilehosting.com/?ac=dm&url=" + id)
}
}
if (!_.isEmpty(parsers)) {
for (const parser of parsers) {
if (_.isEmpty(parser)) continue;
try {
const resp = await this.request(parser + id);
const json = JSON.parse(resp);
if (!_.isEmpty(json.url)) {
this.playUrl = json.url;
break;
}
} catch (e) {
}
}
}
}
async setSearch(wd, quick, pg) {
const limit = 12;
const param = {
keyword: wd, page: pg, limit: limit,
};
const resJson = JSON.parse(await this.postData(this.siteUrl + '/v2/home/search', param));
this.vodList = await this.parseVodShortListFromJson(resJson["data"]["list"])
const page = parseInt(pg);
let pageCount = page;
if (this.vodList.length === limit) {
pageCount = page + 1;
}
this.result.setPage(page, pageCount, limit, pageCount)
}
}
let spider = new TianTianSpider()
async function init(cfg) {
await spider.init(cfg)
}
async function home(filter) {
return await spider.home(filter)
}
async function homeVod() {
return await spider.homeVod()
}
async function category(tid, pg, filter, extend) {
return await spider.category(tid, pg, filter, extend)
}
async function detail(id) {
return await spider.detail(id)
}
async function play(flag, id, flags) {
return await spider.play(flag, id, flags)
}
async function search(wd, quick) {
return await spider.search(wd, quick)
}
export function __jsEvalReturn() {
return {
init: init, home: home, homeVod: homeVod, category: category, detail: detail, play: play, search: search,
};
}
export {spider, TianTianSpider}

View File

@ -69,8 +69,16 @@ class VodSpider extends Spider {
vodDetail.vod_director = vod_data["vod_director"]
let $ = load(vod_data['vod_content'])
vodDetail.vod_content = $.text()
vodDetail.vod_play_from = vod_data["vod_play_from"]
vodDetail.vod_play_url = vod_data["vod_play_url"]
if (vod_data["vod_down_url"] !== undefined) {
if (vod_data["vod_down_url"].length > 0) {
vodDetail.vod_play_from = "直链播放$$$"
vodDetail.vod_play_url = vod_data["vod_down_url"] + "$$$"
}
}
vodDetail.vod_play_from = vodDetail.vod_play_from + vod_data["vod_play_from"]
vodDetail.vod_play_url = vodDetail.vod_play_url + vod_data["vod_play_url"]
vodDetail.type_name = vod_data["type_name"]
return vodDetail
}

View File

@ -8,7 +8,15 @@
*/
import {Crypto} from "./cat.js";
import {TextDecoder} from "./TextDecoder.js";
;
// import {TextDecoder} from "text-decoding";
const deviceBrands = ['Huawei', 'Xiaomi'];
const deviceModels = [
['MHA-AL00', 'HUAWEI Mate 9', 'MHA-TL00', 'HUAWEI Mate 9', 'LON-AL00', 'HUAWEI Mate 9 Pro', 'ALP-AL00', 'HUAWEI Mate 10', 'ALP-TL00', 'HUAWEI Mate 10', 'BLA-AL00', 'HUAWEI Mate 10 Pro', 'BLA-TL00', 'HUAWEI Mate 10 Pro', 'HMA-AL00', 'HUAWEI Mate 20', 'HMA-TL00', 'HUAWEI Mate 20', 'LYA-AL00', 'HUAWEI Mate 20 Pro', 'LYA-AL10', 'HUAWEI Mate 20 Pro', 'LYA-TL00', 'HUAWEI Mate 20 Pro', 'EVR-AL00', 'HUAWEI Mate 20 X', 'EVR-TL00', 'HUAWEI Mate 20 X', 'EVR-AN00', 'HUAWEI Mate 20 X', 'TAS-AL00', 'HUAWEI Mate 30', 'TAS-TL00', 'HUAWEI Mate 30', 'TAS-AN00', 'HUAWEI Mate 30', 'TAS-TN00', 'HUAWEI Mate 30', 'LIO-AL00', 'HUAWEI Mate 30 Pro', 'LIO-TL00', 'HUAWEI Mate 30 Pro', 'LIO-AN00', 'HUAWEI Mate 30 Pro', 'LIO-TN00', 'HUAWEI Mate 30 Pro', 'LIO-AN00m', 'HUAWEI Mate 30E Pro', 'OCE-AN10', 'HUAWEI Mate 40', 'OCE-AN50', 'HUAWEI Mate 40E', 'OCE-AL50', 'HUAWEI Mate 40E', 'NOH-AN00', 'HUAWEI Mate 40 Pro', 'NOH-AN01', 'HUAWEI Mate 40 Pro', 'NOH-AL00', 'HUAWEI Mate 40 Pro', 'NOH-AL10', 'HUAWEI Mate 40 Pro', 'NOH-AN50', 'HUAWEI Mate 40E Pro', 'NOP-AN00', 'HUAWEI Mate 40 Pro', 'CET-AL00', 'HUAWEI Mate 50', 'CET-AL60', 'HUAWEI Mate 50E', 'DCO-AL00', 'HUAWEI Mate 50 Pro', 'TAH-AN00', 'HUAWEI Mate X', 'TAH-AN00m', 'HUAWEI Mate Xs', 'TET-AN00', 'HUAWEI Mate X2', 'TET-AN10', 'HUAWEI Mate X2', 'TET-AN50', 'HUAWEI Mate X2', 'TET-AL00', 'HUAWEI Mate X2', 'PAL-AL00', 'HUAWEI Mate Xs 2', 'PAL-AL10', 'HUAWEI Mate Xs 2', 'EVA-AL00', 'HUAWEI P9', 'EVA-AL10', 'HUAWEI P9', 'EVA-TL00', 'HUAWEI P9', 'EVA-DL00', 'HUAWEI P9', 'EVA-CL00', 'HUAWEI P9', 'VIE-AL10', 'HUAWEI P9 Plus', 'VTR-AL00', 'HUAWEI P10', 'VTR-TL00', 'HUAWEI P10', 'VKY-AL00', 'HUAWEI P10 Plus', 'VKY-TL00', 'HUAWEI P10 Plus', 'EML-AL00', 'HUAWEI P20', 'EML-TL00', 'HUAWEI P20', 'CLT-AL00', 'HUAWEI P20 Pro', 'CLT-AL01', 'HUAWEI P20 Pro', 'CLT-AL00l', 'HUAWEI P20 Pro', 'CLT-TL00', 'HUAWEI P20 Pro', 'CLT-TL01', 'HUAWEI P20 Pro', 'ELE-AL00', 'HUAWEI P30', 'ELE-TL00', 'HUAWEI P30', 'VOG-AL00', 'HUAWEI P30 Pro', 'VOG-AL10', 'HUAWEI P30 Pro', 'VOG-TL00', 'HUAWEI P30 Pro', 'ANA-AL00', 'HUAWEI P40', 'ANA-AN00', 'HUAWEI P40', 'ANA-TN00', 'HUAWEI P40', 'ELS-AN00', 'HUAWEI P40 Pro', 'ELS-TN00', 'HUAWEI P40 Pro', 'ELS-AN10', 'HUAWEI P40 Pro', 'ELS-TN10', 'HUAWEI P40 Pro', 'ABR-AL00', 'HUAWEI P50', 'ABR-AL80', 'HUAWEI P50', 'ABR-AL60', 'HUAWEI P50E', 'ABR-AL90', 'HUAWEI P50E', 'JAD-AL00', 'HUAWEI P50 Pro', 'JAD-AL80', 'HUAWEI P50 Pro', 'JAD-AL50', 'HUAWEI P50 Pro', 'JAD-AL60', 'HUAWEI P50 Pro', 'BAL-AL00', 'HUAWEI P50 Pocket', 'BAL-AL60', 'HUAWEI Pocket S', 'PIC-AL00', 'HUAWEI nova 2', 'PIC-TL00', 'HUAWEI nova 2', 'BAC-AL00', 'HUAWEI nova 2 Plus', 'BAC-TL00', 'HUAWEI nova 2 Plus', 'HWI-AL00', 'HUAWEI nova 2s', 'HWI-TL00', 'HUAWEI nova 2s', 'ANE-AL00', 'HUAWEI nova 3e', 'ANE-TL00', 'HUAWEI nova 3e', 'PAR-AL00', 'HUAWEI nova 3', 'PAR-TL00', 'HUAWEI nova 3', 'INE-AL00', 'HUAWEI nova 3i', 'INE-TL00', 'HUAWEI nova 3i', 'VCE-AL00', 'HUAWEI nova 4', 'VCE-TL00', 'HUAWEI nova 4', 'MAR-AL00', 'HUAWEI nova 4e', 'MAR-TL00', 'HUAWEI nova 4e', 'SEA-AL00', 'HUAWEI nova 5', 'SEA-TL00', 'HUAWEI nova 5', 'SEA-AL10', 'HUAWEI nova 5 Pro', 'SEA-TL10', 'HUAWEI nova 5 Pro', 'GLK-AL00', 'HUAWEI nova 5i', 'GLK-TL00', 'HUAWEI nova 5i', 'GLK-LX1U', 'HUAWEI nova 5i', 'SPN-TL00', 'HUAWEI nova 5i Pro', 'SPN-AL00', 'HUAWEI nova 5z', 'WLZ-AL10', 'HUAWEI nova 6', 'WLZ-AN00', 'HUAWEI nova 6', 'JNY-AL10', 'HUAWEI nova 6 SE', 'JNY-TL10', 'HUAWEI nova 6 SE', 'JEF-AN00', 'HUAWEI nova 7', 'JEF-AN20', 'HUAWEI nova 7', 'JEF-TN00', 'HUAWEI nova 7', 'JEF-TN20', 'HUAWEI nova 7', 'JER-AN10', 'HUAWEI nova 7 Pro', 'JER-AN20', 'HUAWEI nova 7 Pro', 'JER-TN10', 'HUAWEI nova 7 Pro', 'JER-TN20', 'HUAWEI nova 7 Pro', 'CDY-AN00', 'HUAWEI nova 7 SE', 'CDY-AN20', 'HUAWEI nova 7 SE', 'CDY-TN00', 'HUAWEI nova 7 SE', 'CDY-TN20', 'HUAWEI nova 7 SE', 'ANG-AN00', 'HUAWEI nova 8', 'BRQ-AN00', 'HUAWEI nova 8 Pro', 'BRQ-AL00', 'HUAWEI nova 8 Pro', 'JSC-AN00', 'HUAWEI nova 8 SE', 'JSC-TN00', 'HUAWEI nova 8 SE', 'JSC-AL50', 'HUAWEI nova 8 SE', 'NAM-AL00', 'HUAWEI nova 9', 'RTE-AL00', 'HUAWEI nova 9 Pro', 'JLN-AL00', 'HUAWEI nova 9 SE', 'NCO-AL00', 'HUAWEI nova 10', 'GLA-AL00', 'HUAWEI nova 10 Pro', 'CHA-AL80', 'HUAWEI nova 10z'],
['M2001J2C', 'Xiaomi 10', 'M2001J2G', 'Xiaomi 10', 'M2001J2I', 'Xiaomi 10', 'M2011K2C', 'Xiaomi 11', 'M2011K2G', 'Xiaomi 11', '2201123C', 'Xiaomi 12', '2201123G', 'Xiaomi 12', '2112123AC', 'Xiaomi 12X', '2112123AG', 'Xiaomi 12X', '2201122C', 'Xiaomi 12 Pro', '2201122G', 'Xiaomi 12 Pro'],
];
var charStr = 'abacdefghjklmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ0123456789';
let CHROME = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36";
const MOBILEUA = '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';
@ -190,12 +198,78 @@ function getPropertiesAndMethods(obj) {
if (typeof obj[key] === 'function') {
str = str + "方法名:" + key + '()' + "\n";
} else {
str = str + "属性名:"+(key + ': ' + obj[key]) + "\n";
str = str + "属性名:" + (key + ': ' + obj[key]) + "\n";
}
}
return str
}
function formatPlayUrl(src, name) {
return name
.trim()
.replaceAll(src, '')
.replace(/<|>|《|》/g, '')
.replace(/\$|#/g, ' ')
.trim();
}
function rand(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
function randDevice() {
let brandIdx = rand(0, deviceBrands.length - 1);
let brand = deviceBrands[brandIdx];
let modelIdx = rand(0, deviceModels[brandIdx].length / 2 - 1);
let model = deviceModels[brandIdx][modelIdx * 2 + 1];
let release = rand(8, 13);
let buildId = randStr(3, false).toUpperCase() + rand(11, 99) + randStr(1, false).toUpperCase();
return {
brand: brand,
model: model,
release: release,
buildId: buildId,
};
}
function randStr(len, withNum, onlyNum) {
let _str = '';
let containsNum = withNum === undefined ? true : withNum;
for (let i = 0; i < len; i++) {
let idx = onlyNum ? rand(charStr.length - 10, charStr.length - 1) : rand(0, containsNum ? charStr.length - 1 : charStr.length - 11);
_str += charStr[idx];
}
return _str;
}
function randDeviceWithId(len) {
let device = randDevice();
device['id'] = randStr(len);
return device;
}
function randUUID() {
return randStr(8).toLowerCase() + '-' + randStr(4).toLowerCase() + '-' + randStr(4).toLowerCase() + '-' + randStr(4).toLowerCase() + '-' + randStr(12).toLowerCase();
}
function formatUrl(url) {
if (url.indexOf("https:////") > -1) {
url = "https://" + url.replaceAll("https:////", "")
}
if (url.indexOf("http:////") > -1) {
url = "http://" + url.replaceAll("http:////", "")
}
return url
}
function formatContent(content) {
return content.replaceAll('&amp;', '&')
.replaceAll('&lt;', '<')
.replaceAll('&gt;', '>')
.replaceAll('&quot;', '\"')
.replaceAll(/<\/?[^>]+>/g, '');
}
let patternAli = /(https:\/\/www\.aliyundrive\.com\/s\/[^"]+|https:\/\/www\.alipan\.com\/s\/[^"]+)/
export {
@ -224,5 +298,11 @@ export {
getStrByRegexDefault,
getUUID,
objToList,
getPropertiesAndMethods
getPropertiesAndMethods,
formatPlayUrl,
randDeviceWithId,
randStr,
randUUID,
formatContent,
formatUrl
};

View File

@ -1,5 +1,6 @@
// LocalAddress = "http://192.168.29.156:8099"
import * as Utils from "./utils.js";
export class VodShort {
constructor() {
this.vod_id = "" //id
@ -19,6 +20,13 @@ export class VodShort {
}
}
load_data(data) {
for (let propName in JSON.parse(this.to_dict())) {
this[propName] = data[propName];
}
}
}
export class VodDetail extends VodShort {
@ -42,10 +50,12 @@ export class VodDetail extends VodShort {
load_dic(json_str) {
let obj = JSON.parse(json_str)
for (let propName in JSON.parse(this.to_dict())) {
for (let propName in JSON.parse(this.to_dict())) {
this[propName] = obj[propName];
}
}
}

View File

@ -19,6 +19,15 @@
"timeout": 30,
"ext": "{\"box\": \"CatOpen\", \"danmu\": false}"
},
{
"key": "dubo",
"name": "🛶┃独播影视┃🛶",
"playerType": 0,
"type": 3,
"api": "./js/dubo.js",
"timeout": 30,
"ext": "{\"box\": \"CatOpen\", \"danmu\": false}"
},
{
"key": "gitcafe",
"name": "🦊┃阿里纸条┃🦊",
@ -100,6 +109,15 @@
"timeout": 30,
"ext": "{\"box\": \"CatOpen\", \"danmu\": false}"
},
{
"key": "tiantian",
"name": "⛄┃天天影视┃⛄",
"playerType": 0,
"type": 3,
"api": "./js/tiantian.js",
"timeout": 30,
"ext": "{\"box\": \"CatOpen\", \"danmu\": false}"
},
{
"key": "douban",
"name": "🍥┃豆瓣┃🍥",

View File

@ -18,6 +18,15 @@
"timeout": 30,
"ext": "{\"box\": \"TVBox\", \"danmu\": false}"
},
{
"key": "dubo",
"name": "🛶┃独播影视┃🛶",
"playerType": 0,
"type": 3,
"api": "./js/dubo.js",
"timeout": 30,
"ext": "{\"box\": \"TVBox\", \"danmu\": false}"
},
{
"key": "gitcafe",
"name": "🦊┃阿里纸条┃🦊",
@ -99,6 +108,15 @@
"timeout": 30,
"ext": "{\"box\": \"TVBox\", \"danmu\": false}"
},
{
"key": "tiantian",
"name": "⛄┃天天影视┃⛄",
"playerType": 0,
"type": 3,
"api": "./js/tiantian.js",
"timeout": 30,
"ext": "{\"box\": \"TVBox\", \"danmu\": false}"
},
{
"key": "douban",
"name": "🍥┃豆瓣┃🍥",