# -*- coding: utf-8 -*- # TVBox Python Spider for https://www.fqdm.cc # 适用于 FongMi 版本 import requests import re import json from urllib.parse import urljoin, quote class Spider: def __init__(self): self.siteUrl = "https://www.fqdm.cc" self.headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36", "Referer": self.siteUrl } # ---------- 必需接口 ---------- def getDependence(self): return "" def init(self, ext=""): pass def homeContent(self, filter=None): categories = self._getCategories() html = self._fetch(self.siteUrl) videos = self._parseVideoList(html) return json.dumps({"class": categories, "list": videos}, ensure_ascii=False) def homeVideoContent(self, filter=None): html = self._fetch(self.siteUrl) videos = self._parseVideoList(html) return json.dumps({"list": videos}, ensure_ascii=False) def categoryContent(self, tid, pg, filter=False, extend=""): url = f"{self.siteUrl}/vodshow/{tid}--------{pg}---/" html = self._fetch(url) videos = self._parseVideoList(html) pagecount = self._getPageCount(html) or 999 return json.dumps({ "page": pg, "pagecount": pagecount, "limit": 24, "total": pagecount * 24, "list": videos }, ensure_ascii=False) def detailContent(self, ids): vid = ids[0] html = self._fetch(f"{self.siteUrl}/voddetail/{vid}.html") name = self._extract(html, r'