update CAT
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
|
||||
import {_, load} from "../lib/cat.js";
|
||||
import {Spider} from "./spider.js";
|
||||
import {detailContent, initAli, playContent} from "../lib/ali.js";
|
||||
import { detailContent,initCloud,playContent,getHeaders } from "../lib/cloud.js";
|
||||
import {VodDetail, VodShort} from "../lib/vod.js";
|
||||
import * as Utils from "../lib/utils.js";
|
||||
|
||||
@@ -64,7 +64,7 @@ class GitCafeSpider extends Spider {
|
||||
async init(cfg) {
|
||||
await this.spiderInit()
|
||||
await super.init(cfg);
|
||||
await initAli(this.cfgObj["token"]);
|
||||
await initCloud(this.cfgObj);
|
||||
}
|
||||
|
||||
async parseClassFromDoc($) {
|
||||
@@ -107,9 +107,9 @@ class GitCafeSpider extends Spider {
|
||||
let ali_url = await this.getAliUrl(obj["id"])
|
||||
await this.jadeLog.debug(`阿里分享链接为:${ali_url}`)
|
||||
if (!_.isEmpty(ali_url)) {
|
||||
let aliVodDetail = await detailContent([ali_url])
|
||||
vodDetail.vod_play_url = aliVodDetail.vod_play_url
|
||||
vodDetail.vod_play_from = aliVodDetail.vod_play_from
|
||||
let playVod = await detailContent([ali_url],vodDetail.type_name)
|
||||
vodDetail.vod_play_from = _.keys(playVod).join('$$$');
|
||||
vodDetail.vod_play_url = _.values(playVod).join('$$$');
|
||||
}
|
||||
return vodDetail
|
||||
}
|
||||
@@ -187,8 +187,8 @@ class GitCafeSpider extends Spider {
|
||||
}
|
||||
|
||||
async setPlay(flag, id, flags) {
|
||||
let playObjStr = await playContent(flag, id, flags);
|
||||
this.playUrl = JSON.parse(playObjStr)["url"]
|
||||
this.playUrl = await playContent(flag, id, flags);
|
||||
this.result.setHeader(getHeaders(flag))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,10 +8,9 @@
|
||||
*/
|
||||
import {_, load} from '../lib/cat.js';
|
||||
import {VodDetail, VodShort} from "../lib/vod.js"
|
||||
import {detailContent, initAli, playContent} from "../lib/ali.js";
|
||||
import { detailContent,initCloud,playContent,getHeaders} from "../lib/cloud.js";
|
||||
import * as Utils from "../lib/utils.js";
|
||||
import {Spider} from "./spider.js";
|
||||
import {patternAli} from "../lib/utils.js";
|
||||
|
||||
let remark_list = ["4k", "4K"]
|
||||
|
||||
@@ -23,7 +22,7 @@ class AliyunpanShare extends Spider {
|
||||
|
||||
async init(cfg) {
|
||||
await super.init(cfg);
|
||||
await initAli(this.cfgObj["token"]);
|
||||
await initCloud(this.cfgObj);
|
||||
}
|
||||
|
||||
getName() {
|
||||
@@ -129,10 +128,12 @@ class AliyunpanShare extends Spider {
|
||||
for (const share_url of share_url_list) {
|
||||
let matches = share_url.match(Utils.patternAli);
|
||||
if (!_.isEmpty(matches)) share_ali_url_list.push(matches[1])
|
||||
let quarkMatches = share_url.match(Utils.patternQuark);
|
||||
if (!_.isEmpty(quarkMatches)) share_ali_url_list.push(quarkMatches[1])
|
||||
}
|
||||
let aliVodDetail = await detailContent(share_ali_url_list)
|
||||
vodDetail.vod_play_url = aliVodDetail.vod_play_url
|
||||
vodDetail.vod_play_from = aliVodDetail.vod_play_from
|
||||
let playVod = await detailContent([share_ali_url_list])
|
||||
vodDetail.vod_play_from = _.keys(playVod).join('$$$');
|
||||
vodDetail.vod_play_url = _.values(playVod).join('$$$');
|
||||
vodDetail.type_name = Utils.getStrByRegex(/标签(.*?)\n/, articleContent).replaceAll(":", "")
|
||||
vodDetail.vod_content = Utils.getStrByRegex(/描述(.*?)\n/, articleContent).replaceAll(":", "")
|
||||
return vodDetail
|
||||
@@ -175,8 +176,8 @@ class AliyunpanShare extends Spider {
|
||||
}
|
||||
|
||||
async setPlay(flag, id, flags) {
|
||||
let playObjStr = await playContent(flag, id, flags);
|
||||
this.playUrl = JSON.parse(playObjStr)["url"]
|
||||
this.playUrl = await playContent(flag, id, flags);
|
||||
this.result.setHeader(getHeaders(flag))
|
||||
}
|
||||
|
||||
async setSearch(wd, quick) {
|
||||
|
||||
+14
-28
@@ -10,7 +10,7 @@ import {Spider} from "./spider.js";
|
||||
import {_, Crypto, load} from "../lib/cat.js";
|
||||
import {VodDetail, VodShort} from "../lib/vod.js";
|
||||
import * as Utils from "../lib/utils.js";
|
||||
import {detailContent, initAli, playContent} from "../lib/ali.js";
|
||||
import { aliName, detailContent,initCloud,playContent, quarkName } from "../lib/cloud.js";
|
||||
|
||||
function cryptJs(text, key, iv, type) {
|
||||
let key_value = Crypto.enc.Utf8.parse(key || 'PBfAUnTdMjNDe6pL');
|
||||
@@ -37,7 +37,7 @@ class ChangZhangSpider extends Spider {
|
||||
|
||||
async init(cfg) {
|
||||
await super.init(cfg);
|
||||
await initAli(this.cfgObj["token"]);
|
||||
await initCloud(this.cfgObj);
|
||||
}
|
||||
|
||||
|
||||
@@ -145,15 +145,16 @@ class ChangZhangSpider extends Spider {
|
||||
}
|
||||
vod_play_list.push(vodItems.join("#"))
|
||||
}
|
||||
let valify_formt_list = ["磁力链接", "阿里网盘"]
|
||||
let valify_formt_list = ["磁力链接", aliName]
|
||||
let otherPlayList = $("[class=\"ypbt_down_list\"]").find("li")
|
||||
let playVod = {}
|
||||
for (const otherPlay of otherPlayList) {
|
||||
let form_name = $(otherPlay).text()
|
||||
let is_valify = false
|
||||
for (const valify_format_name of valify_formt_list) {
|
||||
if (form_name.indexOf(valify_format_name) > -1) {
|
||||
is_valify = true
|
||||
if (form_name.indexOf("阿里网盘") === -1) {
|
||||
if (form_name.indexOf(aliName) === -1) {
|
||||
vod_play_from_list.push(valify_format_name)
|
||||
}
|
||||
}
|
||||
@@ -162,33 +163,18 @@ class ChangZhangSpider extends Spider {
|
||||
let vodItems = []
|
||||
for (const ciliPlayUrl of $(otherPlay).find("a")) {
|
||||
let episodeUrl = ciliPlayUrl.attribs.href
|
||||
if ($(otherPlay).text().indexOf("阿里网盘")) {
|
||||
let aliVodDetail = await detailContent([episodeUrl])
|
||||
let aliPlayUrlList = aliVodDetail.vod_play_url.split("$$$")
|
||||
let is_exists = false
|
||||
for (const aliPlayUrl of aliPlayUrlList) {
|
||||
if (!_.isEmpty(aliPlayUrl)) {
|
||||
is_exists = true
|
||||
vod_play_list.push(aliPlayUrl)
|
||||
}
|
||||
}
|
||||
if (is_exists) {
|
||||
for (const aliFormatName of aliVodDetail.vod_play_from.split("$$$")) {
|
||||
vod_play_from_list.push("阿里云盘-" + aliFormatName)
|
||||
}
|
||||
}
|
||||
|
||||
if ($(otherPlay).text().indexOf(aliName)) {
|
||||
playVod = await detailContent([episodeUrl])
|
||||
} else {
|
||||
let episodeName = Utils.getStrByRegex(/\[(.*?)]/, $(ciliPlayUrl).text())
|
||||
vodItems.push(episodeName + "$" + episodeUrl)
|
||||
vod_play_list.push(vodItems.join("#"))
|
||||
playVod["磁力链接"] = (vodItems.join("#"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
vodDetail.vod_play_url = vod_play_list.join("$$$")
|
||||
vodDetail.vod_play_from = vod_play_from_list.join("$$$")
|
||||
vodDetail.vod_play_from = _.keys(playVod).join('$$$');
|
||||
vodDetail.vod_play_url = _.values(playVod).join('$$$');
|
||||
return vodDetail
|
||||
}
|
||||
|
||||
@@ -267,9 +253,9 @@ class ChangZhangSpider extends Spider {
|
||||
}
|
||||
|
||||
async setPlay(flag, id, flags) {
|
||||
if (flag.indexOf("阿里云盘") > -1) {
|
||||
flag = flag.replaceAll("阿里云盘-","")
|
||||
this.playUrl = JSON.parse(await playContent(flag, id, flags))["url"];
|
||||
if (flag.indexOf(aliName) > -1 || flag.indexOf(quarkName) > -1) {
|
||||
this.playUrl = await playContent(flag, id, flags)
|
||||
this.result.setHeader(getHeaders(flag))
|
||||
} else {
|
||||
if (id.indexOf("magnet") > -1) {
|
||||
this.playUrl = id
|
||||
@@ -344,4 +330,4 @@ export function __jsEvalReturn() {
|
||||
search: search,
|
||||
};
|
||||
}
|
||||
export {spider}
|
||||
export {spider}
|
||||
+11
-8
@@ -9,7 +9,7 @@
|
||||
|
||||
import {_, load} from "../lib/cat.js";
|
||||
import {Spider} from "./spider.js";
|
||||
import {detailContent, initAli, playContent} from "../lib/ali.js";
|
||||
import { detailContent,initCloud,playContent,getHeaders} from "../lib/cloud.js";
|
||||
import * as Utils from "../lib/utils.js";
|
||||
import {VodDetail, VodShort} from "../lib/vod.js";
|
||||
|
||||
@@ -65,7 +65,7 @@ class GitCafeSpider extends Spider {
|
||||
async init(cfg) {
|
||||
await this.spiderInit()
|
||||
await super.init(cfg);
|
||||
await initAli(this.cfgObj["token"]);
|
||||
await initCloud(this.cfgObj);
|
||||
}
|
||||
|
||||
|
||||
@@ -102,9 +102,11 @@ class GitCafeSpider extends Spider {
|
||||
vodDetail.type_name = classNamesList[classIdList.indexOf(obj["cat"])]
|
||||
vodDetail.vod_content = obj["des"]
|
||||
let ali_url = "https://www.aliyundrive.com/s/" + obj["alikey"]
|
||||
let aliVodDetail = await detailContent([ali_url])
|
||||
vodDetail.vod_play_url = aliVodDetail.vod_play_url
|
||||
vodDetail.vod_play_from = aliVodDetail.vod_play_from
|
||||
let playVod = await detailContent([ali_url],vodDetail.type_name)
|
||||
vodDetail.vod_play_from = _.keys(playVod).join('$$$');
|
||||
vodDetail.vod_play_url = _.values(playVod).join('$$$');
|
||||
|
||||
|
||||
return vodDetail
|
||||
}
|
||||
|
||||
@@ -183,10 +185,11 @@ class GitCafeSpider extends Spider {
|
||||
return {"token": "", "date": ""}
|
||||
}
|
||||
}
|
||||
|
||||
async play(flag, id, flags) {
|
||||
return await playContent(flag, id, flags);
|
||||
async setPlay(flag, id, flags) {
|
||||
this.playUrl = await playContent(flag, id, flags);
|
||||
this.result.setHeader(getHeaders(flag))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
let spider = new GitCafeSpider()
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import {_, load} from "../lib/cat.js";
|
||||
import {Spider} from "./spider.js";
|
||||
import {VodDetail, VodShort} from "../lib/vod.js";
|
||||
import {detailContent, initAli, playContent} from "../lib/ali.js";
|
||||
import { detailContent,initCloud,playContent,getHeaders } from "../lib/cloud.js";
|
||||
|
||||
class PanSearchSpider extends Spider {
|
||||
constructor() {
|
||||
@@ -42,7 +42,7 @@ class PanSearchSpider extends Spider {
|
||||
|
||||
async init(cfg) {
|
||||
await super.init(cfg);
|
||||
await initAli(this.cfgObj["token"]);
|
||||
await initCloud(this.cfgObj);
|
||||
}
|
||||
|
||||
async parseVodDetailfromJson(obj) {
|
||||
@@ -65,13 +65,9 @@ class PanSearchSpider extends Spider {
|
||||
share_url = content.replaceAll(/<\\?[^>]+>/g, "").replace("链接:", "");
|
||||
}
|
||||
}
|
||||
try {
|
||||
let aliVodDetail = await detailContent([share_url])
|
||||
vodDetail.vod_play_url = aliVodDetail.vod_play_url
|
||||
vodDetail.vod_play_from = aliVodDetail.vod_play_from
|
||||
} catch (e) {
|
||||
await this.jadeLog.error(`获取阿里视频播放失败,失败原因为:${e}`)
|
||||
}
|
||||
let playVod = await detailContent([share_url])
|
||||
vodDetail.vod_play_from = _.keys(playVod).join('$$$');
|
||||
vodDetail.vod_play_url = _.values(playVod).join('$$$');
|
||||
return vodDetail
|
||||
}
|
||||
|
||||
@@ -109,8 +105,9 @@ class PanSearchSpider extends Spider {
|
||||
this.vodList = await this.parseVodShortListFromDocBySearch($, wd)
|
||||
}
|
||||
}
|
||||
async play(flag, id, flags) {
|
||||
return await playContent(flag, id, flags);
|
||||
async setPlay(flag, id, flags) {
|
||||
this.playUrl = await playContent(flag, id, flags);
|
||||
this.result.setHeader(getHeaders(flag))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,10 +6,11 @@
|
||||
* @Software : Samples
|
||||
* @Desc :
|
||||
*/
|
||||
import {_} from "../lib/cat.js";
|
||||
import {Spider} from "./spider.js";
|
||||
import {VodDetail} from "../lib/vod.js";
|
||||
import * as Utils from "../lib/utils.js";
|
||||
import {detailContent, initAli, playContent} from "../lib/ali.js";
|
||||
import { detailContent,initCloud,playContent,getHeaders} from "../lib/cloud.js";
|
||||
|
||||
class PushSpider extends Spider {
|
||||
constructor() {
|
||||
@@ -36,7 +37,7 @@ class PushSpider extends Spider {
|
||||
try {
|
||||
this.cfgObj = await this.SpiderInit(cfg)
|
||||
this.catOpenStatus = this.cfgObj.CatOpenStatus
|
||||
await initAli(this.cfgObj["token"]);
|
||||
await initCloud(this.cfgObj);
|
||||
} catch (e) {
|
||||
await this.jadeLog.error(`初始化失败,失败原因为:${e}`)
|
||||
}
|
||||
@@ -58,11 +59,16 @@ class PushSpider extends Spider {
|
||||
let vodDetail = new VodDetail()
|
||||
vodDetail.vod_pic = Utils.RESOURCEURL + "/resources/push.jpg"
|
||||
let mather = Utils.patternAli.exec(id)
|
||||
let quarkMatcher = Utils.patternQuark.exec(id)
|
||||
if (mather !== null && mather.length > 0) {
|
||||
let aliVodDetail = await detailContent([id])
|
||||
vodDetail.vod_play_url = aliVodDetail.vod_play_url
|
||||
vodDetail.vod_play_from = aliVodDetail.vod_play_from
|
||||
} else {
|
||||
let playVod = await detailContent([id])
|
||||
vodDetail.vod_play_from = _.keys(playVod).join('$$$');
|
||||
vodDetail.vod_play_url = _.values(playVod).join('$$$');
|
||||
} else if (quarkMatcher !== null && quarkMatcher.length > 0){
|
||||
let playVod = await detailContent([id])
|
||||
vodDetail.vod_play_from = _.keys(playVod).join('$$$');
|
||||
vodDetail.vod_play_url = _.values(playVod).join('$$$');
|
||||
}else {
|
||||
vodDetail.vod_play_from = '推送';
|
||||
vodDetail.vod_play_url = '推送$' + id;
|
||||
}
|
||||
@@ -77,7 +83,8 @@ class PushSpider extends Spider {
|
||||
if (flag === "推送"){
|
||||
this.playUrl = id
|
||||
}else{
|
||||
this.playUrl = JSON.parse(await playContent(flag, id, flags))["url"];
|
||||
this.playUrl = await playContent(flag, id, flags);
|
||||
this.result.setHeader(getHeaders(flag))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,7 @@ import {_, load, Uri} from "../lib/cat.js";
|
||||
import * as HLS from "../lib/hls.js";
|
||||
import {hlsCache, tsCache} from "../lib/ffm3u8_open.js";
|
||||
import {DanmuSpider} from "../lib/danmuSpider.js";
|
||||
import {initAli} from "../lib/ali.js";
|
||||
|
||||
import { initCloud } from "../lib/cloud.js";
|
||||
class Result {
|
||||
constructor() {
|
||||
this.class = []
|
||||
@@ -453,8 +452,8 @@ class Spider {
|
||||
|
||||
}
|
||||
|
||||
async initAli(token, db = null) {
|
||||
await initAli(token, db)
|
||||
async initCloud(token) {
|
||||
await initCloud(token)
|
||||
}
|
||||
|
||||
async spiderInit() {
|
||||
|
||||
@@ -55,21 +55,37 @@ async function test() {
|
||||
let siteType = 3;
|
||||
await spider.init({
|
||||
skey: siteKey, stype: siteType, ext: {
|
||||
"token": "51427b95ab9d47a6921a27951ebd3f1e",
|
||||
"aliToken": "51427b95ab9d47a6921a27951ebd3f1e",
|
||||
"box": "TV",
|
||||
"code": "1",
|
||||
"from": "star",
|
||||
"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"
|
||||
"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",
|
||||
"quarkCookie":"_UP_A4A_11_=wb965111521e45ffa80410c24a071a54; _UP_D_=pc; tfstk=fXFith4nnRk114LAjWc1TT-OQUXL5hGjqodxDjnVLDoBBchYujR4Drht3GaYxmqYlcPtWc34mknIMcFTB-Y_tuAv6G6_uIcxggIRw_U15jGV2EjCXmnslyoqlSMN9PGjgMEW0dR85uVOAjYmgwcEoqOqgIrqLyoIlq-ZuC738DgqgCJZgH8EuqxZNmAqqSPQTaC3h7bb2rFnSvW87D8jTW0iX0zasIR2zVDi4Poh2svabvzjnSTXixaaFogzbhS-Cry3xVcc9dlz--roR55Jj2wT8znUrEdYrfV3t-kh71znscDo-vYWpf24fSD_IE_78frQF0MNdMg367HmVvxFbyUnbY20XMOqX84UxYFpvQhbA-rqok-G4A9eUc4wG27YtK9jQ2gnVNJioG_mbu_h-wv5CAuIWgQh-K9jQ2gn2wbHFhMZRVIR.; __pus=c81f57897dafcb65d4ecb501bc299199AARcqF72zsatdbsCbiT3qVqsk36caaycoPQW7hz8rbEf+UY7f5aGgH1e90lsONAUwCAW8y27u5A/KXyYqkHCWgjS; __kp=99fa2760-1669-11ef-90cf-8f7a59c3b86e; __kps=AATSt4xuf6r6bqes3LdJvxvy; __ktd=c2e+aLICIvFoeklXXz36VA==; __uid=AATSt4xuf6r6bqes3LdJvxvy; Video-Auth=smob3MOUslklDq2MutANJYZCVo50sLv0GFelx3+cu1nK2fkdL2kvkdpT5yNOhNz0NLTyi5ThWRL47+ztJA4kXQ==; __puus=72f667c533c9a22496f88d2f1bb7ae71AAQ7mrvFw7s9AUPUXvnuGPkcDU3RRTVPdYaYQfsM9Cje2doYXgRZXbImg02EaUaEG+G9ikpo3xubGGdElArOuYvUtJzIXb6yHDnSZbtEUxkwvjfQRNEnDnVwLQ6LL2ORjRaxa9OUfwk/WppWvy6OcDqQtHYkaqB+Poxn5kFs7ZVdAtX7ZQks1czD+g9gAZjsbeBHxHQ1AP5MGc1s3M4RhwZQ"
|
||||
}
|
||||
});
|
||||
|
||||
let classes = JSON.parse(await spider.home(true));
|
||||
console.debug(JSON.stringify(classes))
|
||||
|
||||
// 测试详情
|
||||
let detail1 = JSON.parse(await spider.detail('/index.php/voddetail/84217.html'))
|
||||
await testPlay(detail1)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 测试搜索
|
||||
let search_page = JSON.parse(await spider.search("甄嬛传", false, 1))
|
||||
let search_page = JSON.parse(await spider.search("庆余年", false, 1))
|
||||
console.debug(JSON.stringify(search_page))
|
||||
|
||||
|
||||
|
||||
|
||||
//测试首页列表
|
||||
let homeVod = JSON.parse(await spider.homeVod())
|
||||
console.debug(JSON.stringify(homeVod));
|
||||
@@ -81,9 +97,6 @@ async function test() {
|
||||
|
||||
|
||||
|
||||
// 测试详情
|
||||
let detail1 = JSON.parse(await spider.detail("1872"))
|
||||
await testPlay(detail1)
|
||||
|
||||
|
||||
// 测试分类
|
||||
|
||||
+11
-16
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
import {_, load} from '../lib/cat.js';
|
||||
import {VodDetail, VodShort} from "../lib/vod.js"
|
||||
import {detailContent, initAli, playContent} from "../lib/ali.js";
|
||||
import {initCloud, detailContent,playContent,getHeaders} from '../lib/cloud.js';
|
||||
import * as Utils from "../lib/utils.js";
|
||||
import {Spider} from "./spider.js";
|
||||
|
||||
@@ -22,10 +22,11 @@ class WoggSpider extends Spider {
|
||||
|
||||
async init(cfg) {
|
||||
await super.init(cfg);
|
||||
await initAli(this.cfgObj["token"]);
|
||||
await initCloud(this.cfgObj)
|
||||
this.danmuStaus = true
|
||||
}
|
||||
|
||||
|
||||
getName() {
|
||||
return "💂┃阿里玩偶┃💂"
|
||||
}
|
||||
@@ -78,22 +79,16 @@ class WoggSpider extends Spider {
|
||||
vodDetail.vod_content = $(video_items[4]).find("p")[0].children[0].data
|
||||
|
||||
vodDetail.vod_content = vodDetail.vod_content.replace("[收起部分]", "").replace("[展开全部]", "")
|
||||
const share_url_list = [];
|
||||
const share_url_list = []
|
||||
let items = $('.module-row-info')
|
||||
for (const item of items) {
|
||||
let aliUrl = $(item).find("p")[0].children[0].data
|
||||
let matches = aliUrl.match(Utils.patternAli);
|
||||
if (!_.isEmpty(matches)) share_url_list.push(matches[1])
|
||||
}
|
||||
if (share_url_list.length > 0) {
|
||||
let aliVodDetail = await detailContent(share_url_list,vodDetail.type_name)
|
||||
vodDetail.vod_play_url = aliVodDetail.vod_play_url
|
||||
vodDetail.vod_play_from = aliVodDetail.vod_play_from
|
||||
} else {
|
||||
await this.jadeLog.warning(`获取详情界面失败,失败原因为:没有分享链接`)
|
||||
let shareUrl = $(item).find("p")[0].children[0].data
|
||||
share_url_list.push(shareUrl)
|
||||
}
|
||||
let playVod = await detailContent(share_url_list,vodDetail.type_name)
|
||||
vodDetail.vod_play_from = _.keys(playVod).join('$$$');
|
||||
vodDetail.vod_play_url = _.values(playVod).join('$$$');
|
||||
return vodDetail
|
||||
|
||||
}
|
||||
|
||||
async parseVodShortListFromDocBySearch($) {
|
||||
@@ -263,8 +258,8 @@ class WoggSpider extends Spider {
|
||||
}
|
||||
|
||||
async setPlay(flag, id, flags) {
|
||||
let playObjStr = await playContent(flag, id, flags);
|
||||
this.playUrl = JSON.parse(playObjStr)["url"]
|
||||
this.playUrl = await playContent(flag, id, flags);
|
||||
this.result.setHeader(getHeaders(flag))
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user