/* * @Author: samples jadehh@live.com * @Date: 2023-12-14 11:03:04 * @LastEditors: samples jadehh@live.com * @LastEditTime: 2023-12-14 11:03:04 * @FilePath: js/asianx.js * @Description: asianx */ 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 AsianXSpider extends Spider { constructor() { super(); this.siteUrl = "https://cn.asianx.tube/" } getName() { return "🔞┃海外宅┃🔞" } getAppName() { return "海外宅" } getJSName() { return "asianx" } getType() { return 3 } async getFilter($) { let navElements = $($("[class=\"menu m-0 mb-2 mb-lg-0\"]")).find("a").slice(6) let extend_dic = {"key": "1", "name": "分类", "value": [{"n": "全部", "v": "全部"}]} for (const navElement of navElements) { let type_name = $($(navElement).find("span")).text() let type_id = navElement.attribs["href"] extend_dic["value"].push({"n": type_name, "v": type_id}) } return [extend_dic] } async parseVodShortListFromDoc($,is_home=false) { let vod_list = [] let vodShortElements; if (is_home){ vodShortElements = $($("[class=\"gal-box\"]")).slice(12) }else{ vodShortElements = $($("[class=\"gal-box\"]")) } for (const vodShortElement of vodShortElements) { let vodShort = new VodShort() let vodElements = $(vodShortElement).find("a") vodShort.vod_id = vodElements[0].attribs["href"] vodShort.vod_pic = $(vodElements[0]).find("img")[0].attribs["data-src"] vodShort.vod_name = vodElements[1].attribs["title"] vodShort.vod_remarks = $($(vodShortElement).find("[class=\"meta text-muted text-truncate\"]")).text() vod_list.push(vodShort) } return vod_list } async parseVodDetailFromDoc(html) { let vodDetail = new VodDetail(); let content = Utils.getStrByRegex(/