/* * @File : doll.js * @Author : jade * @Date : 2024/1/4 14:15 * @Email : jadehh@1ive.com * @Software : Samples * @Desc : doll */ 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"; class Doll extends Spider { constructor() { super(); this.siteUrl = "https://hongkongdollvideo.com" } getImgHeader(){ let headers = this.getHeader() headers["Proxy"] = true return headers } async spiderInit(inReq = null) { if (inReq !== null) { this.jsBase = await js2Proxy(inReq, "img", this.getImgHeader()); } else { this.jsBase = await js2Proxy(true, this.siteType, this.siteKey, 'img/', this.getImgHeader()); } } async init(cfg) { await super.init(cfg); await this.spiderInit(null) } async getHtml(url = this.siteUrl, proxy = false, headers = this.getHeader()) { return super.getHtml(url, true, headers); } getName() { return "🔞┃玩偶姐姐┃🔞" } getAppName() { return "玩偶姐姐" } getJSName() { return "doll" } getType() { return 3 } async parseVodShortListFromDoc($) { let vod_list = [] let vodElements = $("[class=\"row\"]").find("[class=\"video-detail\"]") for (const vodElement of vodElements) { let vodShort = new VodShort() vodShort.vod_id = $(vodElement).find("a")[0].attribs["href"] let videoInfoElements = $($(vodElement).find("[class=\"video-info\"]")).find("a") vodShort.vod_name = videoInfoElements[0].attribs["title"] vodShort.vod_remarks = $(videoInfoElements[1]).text() let pic = $(vodElement).find("img")[0].attribs["data-src"] // if (this.catOpenStatus) { // vodShort.vod_pic = this.jsBase + Utils.base64Encode(pic) // } else { // vodShort.vod_pic = pic // } vodShort.vod_pic = pic vod_list.push(vodShort) } return vod_list } async parseVodDetailFromDoc($, key) { let vodDetail = new VodDetail() let vodElement = $("[class=\"container-fluid\"]") vodDetail.vod_name = $($(vodElement).find("[class=\"page-title\"]")[0]).text() vodDetail.vod_remarks = $(vodElement).find("[class=\"tag my-1 text-center\"]")[0].attribs["href"].replaceAll("/", "") let pic = $(vodElement).find("video")[0].attribs["poster"] // if (this.catOpenStatus) { // vodDetail.vod_pic = this.jsBase + Utils.base64Encode(pic) // } else { // vodDetail.vod_pic = pic // } vodDetail.vod_pic = pic let html = $.html() let voteTag = Utils.getStrByRegex(/var voteTag="(.*?)";/g, html) // let videoInfoStr = Utils.getStrByRegex(/