mirror of
https://github.com/qist/tvbox.git
synced 2025-10-26 01:32:18 +00:00
update CAT
This commit is contained in:
@@ -485,7 +485,7 @@
|
||||
{
|
||||
"name": "live",
|
||||
"type": 0,
|
||||
"url": "https://agit.ai/fantaiying/0/raw/branch/main/tvlive.txt",
|
||||
"url": "https://gh.con.sh/https://github.com/jadehh/LiveSpider/blob/main/live/live.txt",
|
||||
"playerType": 1,
|
||||
"ua": "okhttp/3.15",
|
||||
"epg": "http://epg.112114.xyz/?ch={name}&date={date}",
|
||||
|
||||
@@ -10,11 +10,13 @@ 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 CNTVSpider extends Spider {
|
||||
constructor() {
|
||||
super();
|
||||
this.siteUrl = "https://tv.cctv.com/m/index.shtml"
|
||||
this.apiUrl = "https://api.app.cctv.com"
|
||||
this.liveJsonUrl = "https://gh.con.sh/https://github.com/jadehh/LiveSpider/blob/main/json/live.json"
|
||||
|
||||
}
|
||||
|
||||
@@ -34,6 +36,15 @@ class CNTVSpider extends Spider {
|
||||
return 3
|
||||
}
|
||||
|
||||
async spiderInit() {
|
||||
await super.spiderInit();
|
||||
this.liveJson = JSON.parse(await this.fetch(this.liveJsonUrl, null, null))
|
||||
}
|
||||
|
||||
async init(cfg) {
|
||||
await super.init(cfg);
|
||||
await this.spiderInit()
|
||||
}
|
||||
|
||||
async getFilterByLive(dataList) {
|
||||
let extend_list = []
|
||||
@@ -47,10 +58,10 @@ class CNTVSpider extends Spider {
|
||||
return extend_list
|
||||
}
|
||||
|
||||
arrayIsinclude(str,items){
|
||||
arrayIsinclude(str, items) {
|
||||
let isInclude = false
|
||||
for (const data of items){
|
||||
if (str === data["title"]){
|
||||
for (const data of items) {
|
||||
if (str === data["title"]) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -64,12 +75,12 @@ class CNTVSpider extends Spider {
|
||||
let extend_dic = {"key": data["classname"], "name": data["title"], "value": []}
|
||||
for (const extendData of data["items"]) {
|
||||
if (data["classname"] === "nianfen") {
|
||||
if (!this.arrayIsinclude("2024",data["items"]) && extendData["title"] !== "全部" && !add_year_status) {
|
||||
if (!this.arrayIsinclude("2024", data["items"]) && extendData["title"] !== "全部" && !add_year_status) {
|
||||
extend_dic["value"].push({"n": "2024", "v": "2024"})
|
||||
add_year_status = true
|
||||
}
|
||||
}
|
||||
extend_dic["value"].push({"n": extendData["title"], "v":extendData["title"]})
|
||||
extend_dic["value"].push({"n": extendData["title"], "v": extendData["title"]})
|
||||
}
|
||||
extend_list.push(extend_dic)
|
||||
}
|
||||
@@ -150,15 +161,23 @@ class CNTVSpider extends Spider {
|
||||
let liveResponse = await req(liveApiUrl, {"headers": this.getHeader()})
|
||||
let liveJson = JSON.parse(liveResponse["content"])
|
||||
let playList = {}
|
||||
playList["直播"] = ["点击播放$" + liveJson["hls_url"]["hls2"]]
|
||||
let channelName = obj["channelName"].split(" ")[0].replaceAll("-", "").toLowerCase()
|
||||
let liveUrl = this.liveJson[channelName] ?? liveJson["hls_url"]["hls2"]
|
||||
playList["直播"] = ["点击播放$" + liveUrl]
|
||||
await this.jadeLog.info(`liveJson:${JSON.stringify(liveJson)}`)
|
||||
let vod_items = []
|
||||
for (const data of obj["program"]) {
|
||||
let episodeName = data["showTime"] + "-" + data["t"]
|
||||
let episodeUrl = liveJson["hls_url"]["hls1"] + `?begintimeabs=${data["st"] * 1000}&endtimeabs=${data["et"] * 1000}`
|
||||
vod_items.push(episodeName + "$" + episodeUrl)
|
||||
if (this.liveJson[channelName] !== undefined) {
|
||||
|
||||
} else {
|
||||
for (const data of obj["program"]) {
|
||||
let episodeName = data["showTime"] + "-" + data["t"]
|
||||
let episodeUrl = liveUrl + `?begintimeabs=${data["st"] * 1000}&endtimeabs=${data["et"] * 1000}`
|
||||
vod_items.push(episodeName + "$" + episodeUrl)
|
||||
}
|
||||
}
|
||||
if (vod_items.length > 0){
|
||||
playList["点播"] = vod_items.join("#")
|
||||
}
|
||||
playList["点播"] = vod_items.join("#")
|
||||
return playList
|
||||
}
|
||||
|
||||
@@ -233,11 +252,11 @@ class CNTVSpider extends Spider {
|
||||
this.homeVodList = await this.parseVodShortListFromJson(resJson["data"]["templates"])
|
||||
}
|
||||
|
||||
getExtendValue(extend,key){
|
||||
if (extend[key] !== undefined && extend[key] !== "全部"){
|
||||
getExtendValue(extend, key) {
|
||||
if (extend[key] !== undefined && extend[key] !== "全部") {
|
||||
return extend[key]
|
||||
}
|
||||
return ""
|
||||
return ""
|
||||
}
|
||||
|
||||
async setCategory(tid, pg, filter, extend) {
|
||||
@@ -247,10 +266,10 @@ class CNTVSpider extends Spider {
|
||||
let response = JSON.parse(await this.fetch(url, null, this.getHeader()))
|
||||
this.vodList = this.parseVodShortByJson(response["data"]["templates"][0]["items"])
|
||||
} else {
|
||||
let letter = this.getExtendValue(extend,"zimu")
|
||||
let area = this.getExtendValue(extend,"diqu")
|
||||
let type = this.getExtendValue(extend,"leixing")
|
||||
let year = this.getExtendValue(extend,"nianfen")
|
||||
let letter = this.getExtendValue(extend, "zimu")
|
||||
let area = this.getExtendValue(extend, "diqu")
|
||||
let type = this.getExtendValue(extend, "leixing")
|
||||
let year = this.getExtendValue(extend, "nianfen")
|
||||
const limit = 12
|
||||
let url = "https://api.cntv.cn" + `/newVideoset/getCboxVideoAlbumList`
|
||||
let params = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {__jsEvalReturn} from './lovemovie18.js';
|
||||
import {__jsEvalReturn} from './cntv.js';
|
||||
|
||||
import * as Utils from "../lib/utils.js";
|
||||
|
||||
@@ -51,49 +51,36 @@ async function testMusicPlay(vodDetail) {
|
||||
}
|
||||
|
||||
async function test() {
|
||||
let siteKey = 'lovemovie18';
|
||||
let siteKey = 'cntv';
|
||||
let siteType = 3;
|
||||
await spider.init({
|
||||
skey: siteKey, stype: siteType, ext: {
|
||||
"token": "6827db23e5474d02a07fd7431d3d5a5a",
|
||||
"box": "TV",
|
||||
"code": "1",
|
||||
"from": "lovemovie18",
|
||||
"from": "cntv",
|
||||
"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"
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
let classes = JSON.parse(await spider.home(true));
|
||||
console.debug(JSON.stringify(classes))
|
||||
|
||||
// 测试详情
|
||||
let detail1 = JSON.parse(await spider.detail("/shechu/HODV21864binv1riSEXyoutiancaiyexiangqibing/"))
|
||||
await testPlay(detail1)
|
||||
|
||||
|
||||
// 测试搜索
|
||||
let search_page = JSON.parse(await spider.search("完美世界",false,1))
|
||||
console.debug(JSON.stringify(search_page))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 测试分类
|
||||
let catePage = JSON.parse(await spider.category("/tvb/", "2", undefined, {"class":"/guochan/"}));
|
||||
console.debug(JSON.stringify(catePage));
|
||||
|
||||
//测试首页列表
|
||||
let homeVod = JSON.parse(await spider.homeVod())
|
||||
console.debug(JSON.stringify(homeVod));
|
||||
// 测试分类
|
||||
let catePage = JSON.parse(await spider.category("72", "2", undefined, {"live":"101"}));
|
||||
console.debug(JSON.stringify(catePage))
|
||||
|
||||
// 测试详情
|
||||
let detail1 = JSON.parse(await spider.detail("live-cctv2-https://app.cctv.com/special/appchannellogo/rectangle/l/cctv1.png?q=75"))
|
||||
await testPlay(detail1)
|
||||
|
||||
|
||||
|
||||
|
||||
// 测试搜索
|
||||
let search_page = JSON.parse(await spider.search("完美世界", false, 1))
|
||||
console.debug(JSON.stringify(search_page))
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import {Spider} from "./spider.js";
|
||||
class WoggSpider extends Spider {
|
||||
constructor() {
|
||||
super();
|
||||
this.siteUrl = 'https://tvfan.xxooo.cf';
|
||||
this.siteUrl = 'https://www.wogg.xyz';
|
||||
this.woggTypeObj = {"玩偶电影":"电影","玩偶剧集":"电视剧"}
|
||||
}
|
||||
|
||||
|
||||
@@ -725,7 +725,7 @@
|
||||
{
|
||||
"name": "live",
|
||||
"type": 0,
|
||||
"url": "https://agit.ai/fantaiying/0/raw/branch/main/tvlive.txt",
|
||||
"url": "https://gh.con.sh/https://github.com/jadehh/LiveSpider/blob/main/live/live.txt",
|
||||
"playerType": 1,
|
||||
"ua": "okhttp/3.15",
|
||||
"epg": "http://epg.112114.xyz/?ch={name}&date={date}",
|
||||
|
||||
Reference in New Issue
Block a user