From d4c98c8b7d786b6760363ab7435ccb6e1f4ff4a7 Mon Sep 17 00:00:00 2001 From: XC-Pro <19840+xc-pro@noreply.example.org> Date: Fri, 14 Aug 2026 13:23:53 +0200 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=20py/=E8=A5=BF=E7=93=9C?= =?UTF-8?q?=E5=BD=B1=E8=A7=86.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- py/西瓜影视.py | 336 ------------------------------------------------- 1 file changed, 336 deletions(-) delete mode 100644 py/西瓜影视.py diff --git a/py/西瓜影视.py b/py/西瓜影视.py deleted file mode 100644 index f9db284..0000000 --- a/py/西瓜影视.py +++ /dev/null @@ -1,336 +0,0 @@ -# -*- coding: utf-8 -*- -# by @PyramidStore AutoGen -import re -import sys -sys.path.append('..') -import json -from urllib.parse import quote -from base.spider import Spider - - -class Spider(Spider): - - def init(self, extend=""): - self.nav_host = 'https://www.xiguadh.com' - 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', - 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', - 'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8', - } - self.host = self._get_host() - - def _get_host(self): - """获取视频站点 URL,失败时从导航页获取""" - default_host = 'https://www.bzzdyy.com' - try: - r = self.fetch(default_host, headers=self.headers, timeout=10, verify=False) - if r.status_code == 200: - return default_host - except Exception: - pass - try: - r = self.fetch(self.nav_host, headers=self.headers, timeout=15, verify=False) - html = r.text - urls = re.findall(r'url:\s*["\']([^"\']+)["\']', html) - for url in urls: - if url.startswith('http') and 'xiguadh' not in url: - return url.rstrip('/') - except Exception: - pass - return default_host - - def getName(self): - return '西瓜影院' - - def isVideoFormat(self, url): - return False - - def manualVideoCheck(self): - return True - - def homeContent(self, filter): - try: - r = self.fetch(self.host, headers=self.headers, timeout=15, verify=False) - html = r.text - # 提取主要分类 - nav_match = re.search(r'
', html, re.DOTALL) - if nav_match: - nav_html = nav_match.group(1) - categories = re.findall(r'