Sync all projects
This commit is contained in:
@@ -0,0 +1,426 @@
|
||||
{
|
||||
"spider": "",
|
||||
"logo": "https://img.freepik.com/free-vector/cute-dolphin-swimming-cartoon-vector-icon-illustration-animal-nature-icon-isolated-flat-vector_138676-12582.jpg?semt=ais_hybrid&w=740&q=80",
|
||||
"wallpaper":"http://tool.teyonds.com/api",
|
||||
"warningText": "注意:如果别人倒卖海豚影视接口收费的都是骗子,没有qq群微信群,只有tg官方交流群 TG:@hshsjk",
|
||||
"sites": [
|
||||
{
|
||||
"key": "男同网",
|
||||
"name": "🐬男同网",
|
||||
"type": 3,
|
||||
"api": "https://ghfast.top/https://raw.githubusercontent.com/FGBLH/HKL/refs/heads/main/py/男同网.py"
|
||||
}
|
||||
],
|
||||
"parses": [
|
||||
{
|
||||
"name": "盘古",
|
||||
"type": 0,
|
||||
"url": "https://www.playm3u8.cn/jiexi.php?url=",
|
||||
"ext": {
|
||||
"header": {
|
||||
"user-agent": "Mozilla/5.0 (Linux; Android 13; V2049A Build/TP1A.220624.014; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/116.0.0.0 Mobile Safari/537.36"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "789解析1",
|
||||
"type": 0,
|
||||
"url": "https://jiexi.789jiexi.icu:4433/?url="
|
||||
},
|
||||
{
|
||||
"name": "789解析2",
|
||||
"type": 0,
|
||||
"url": "https://jiexi.789jiexi.com/?url="
|
||||
},
|
||||
{
|
||||
"name": "虾米解析",
|
||||
"type": 0,
|
||||
"url": "https://jx.xmflv.com/?url="
|
||||
},
|
||||
{
|
||||
"name": "淘片解析",
|
||||
"type": 0,
|
||||
"url": "https://jx.yparse.com/index.php?url="
|
||||
},
|
||||
{
|
||||
"name": "解析1",
|
||||
"type": 0,
|
||||
"url": "https://huayong.net/999/?v="
|
||||
},
|
||||
{
|
||||
"name": "解析2",
|
||||
"type": 0,
|
||||
"url": "https://jx.m3u8.tv/jiexi/?url="
|
||||
},
|
||||
{
|
||||
"name": "解析3",
|
||||
"type": 0,
|
||||
"url": "https://t2.qlplayer.cyou/player/analysis.php?v="
|
||||
},
|
||||
|
||||
{
|
||||
"name": "解析4",
|
||||
"type": 0,
|
||||
"url": "https://www.ckplayer.vip/jiexi/?url="
|
||||
},
|
||||
{
|
||||
"name": "解析5",
|
||||
"type": 0,
|
||||
"url": "https://nm.xxxc137.top/static/player/artplayer.html?url="
|
||||
},
|
||||
{
|
||||
"name": "解析6",
|
||||
"type": 0,
|
||||
"url": "https://www.yemu.xyz/?url="
|
||||
},
|
||||
{
|
||||
"name": "冰豆",
|
||||
"type": 0,
|
||||
"url": "https://bd.jx.cn/?url="
|
||||
},
|
||||
{
|
||||
"name":"爱酷",
|
||||
"type":0,
|
||||
"url":"https://jx.zhanlangbu.com/?url="
|
||||
},
|
||||
{"name":"云解析","type":0,"url":"https://jx.yparse.com/index.php?url=","ext":{"header":{"user-agent":"Mozilla/5.0 (Linux; Android 13; V2049A Build/TP1A.220624.014; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/116.0.0.0 Mobile Safari/537.36"}}},
|
||||
{"name":"777","type":0,"url":"https://jx.jsonplayer.com/player/?url=","ext":{"header":{"user-agent":"Mozilla/5.0 (Linux; Android 13; V2049A Build/TP1A.220624.014; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/116.0.0.0 Mobile Safari/537.36"}}},
|
||||
{"name":"-剖云-","type":0,"url":"https://www.kkvip2022.com/vip/jiexi1/?url=","ext":{"header":{"user-agent":"Mozilla/5.0 (Linux; Android 13; V2049A Build/TP1A.220624.014; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/116.0.0.0 Mobile Safari/537.36"}}},
|
||||
{"name":"-全看-","type":0,"url":"https://jx.quankan.app/?url=","ext":{"header":{"user-agent":"Mozilla/5.0 (Linux; Android 13; V2049A Build/TP1A.220624.014; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/116.0.0.0 Mobile Safari/537.36"}}}
|
||||
],
|
||||
"doh": [
|
||||
{
|
||||
"name": "Google",
|
||||
"url": "https://dns.google/dns-query",
|
||||
"ips": [
|
||||
"8.8.4.4",
|
||||
"8.8.8.8"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Cloudflare",
|
||||
"url": "https://cloudflare-dns.com/dns-query",
|
||||
"ips": [
|
||||
"1.1.1.1",
|
||||
"1.0.0.1",
|
||||
"2606:4700:4700::1111",
|
||||
"2606:4700:4700::1001"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "AdGuard",
|
||||
"url": "https://dns.adguard.com/dns-query",
|
||||
"ips": [
|
||||
"94.140.14.140",
|
||||
"94.140.14.141"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "DNSWatch",
|
||||
"url": "https://resolver2.dns.watch/dns-query",
|
||||
"ips": [
|
||||
"84.200.69.80",
|
||||
"84.200.70.40"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Quad9",
|
||||
"url": "https://dns.quad9.net/dns-quer",
|
||||
"ips": [
|
||||
"9.9.9.9",
|
||||
"149.112.112.112"
|
||||
]
|
||||
}
|
||||
],
|
||||
"ads": [
|
||||
"mozai.4gtv.tv",
|
||||
"static-mozai.4gtv.tv"
|
||||
],
|
||||
"lives": [
|
||||
{
|
||||
"name": "🐬海豚佬🔞午夜剧场(挂梯)",
|
||||
"type": 0,
|
||||
"playerType": 2,
|
||||
"epg": "https://epg.112114.xyz/?ch={name}&date={date}",
|
||||
"logo": "https://epg.112114.xyz/logo/{name}.png",
|
||||
"url": "https://gh-proxy.com/https://raw.githubusercontent.com/FGBLH/HKL/refs/heads/main/午夜剧场.txt",
|
||||
"header": {
|
||||
"X-Api-key": "8692bd33270440d4d2941b814b81a25a1eb84a7205532971714c4299c57449e0..0..1738210005..5cf2c4ad-043b-4234-83a2-e84ae917"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "🐬海豚佬xxx视频资源🔞",
|
||||
"type": 0,
|
||||
"ua": "okhttp",
|
||||
"url": "https://ghfast.top/https://raw.githubusercontent.com/FGBLH/HKL/refs/heads/main/xxx视频资源.txt"
|
||||
}
|
||||
],
|
||||
"ijk": [
|
||||
{
|
||||
"group": "软解码",
|
||||
"options": [
|
||||
{
|
||||
"category": 4,
|
||||
"name": "opensles",
|
||||
"value": "0"
|
||||
},
|
||||
{
|
||||
"category": 4,
|
||||
"name": "overlay-format",
|
||||
"value": "842225234"
|
||||
},
|
||||
{
|
||||
"category": 4,
|
||||
"name": "framedrop",
|
||||
"value": "1"
|
||||
},
|
||||
{
|
||||
"category": 4,
|
||||
"name": "soundtouch",
|
||||
"value": "1"
|
||||
},
|
||||
{
|
||||
"category": 4,
|
||||
"name": "start-on-prepared",
|
||||
"value": "1"
|
||||
},
|
||||
{
|
||||
"category": 1,
|
||||
"name": "http-detect-range-support",
|
||||
"value": "0"
|
||||
},
|
||||
{
|
||||
"category": 1,
|
||||
"name": "fflags",
|
||||
"value": "fastseek"
|
||||
},
|
||||
{
|
||||
"category": 2,
|
||||
"name": "skip_loop_filter",
|
||||
"value": "48"
|
||||
},
|
||||
{
|
||||
"category": 4,
|
||||
"name": "reconnect",
|
||||
"value": "1"
|
||||
},
|
||||
{
|
||||
"category": 4,
|
||||
"name": "enable-accurate-seek",
|
||||
"value": "0"
|
||||
},
|
||||
{
|
||||
"category": 4,
|
||||
"name": "mediacodec",
|
||||
"value": "0"
|
||||
},
|
||||
{
|
||||
"category": 4,
|
||||
"name": "mediacodec-auto-rotate",
|
||||
"value": "0"
|
||||
},
|
||||
{
|
||||
"category": 4,
|
||||
"name": "mediacodec-handle-resolution-change",
|
||||
"value": "0"
|
||||
},
|
||||
{
|
||||
"category": 4,
|
||||
"name": "mediacodec-hevc",
|
||||
"value": "0"
|
||||
},
|
||||
{
|
||||
"category": 1,
|
||||
"name": "dns_cache_timeout",
|
||||
"value": "600000000"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "硬解码",
|
||||
"options": [
|
||||
{
|
||||
"category": 4,
|
||||
"name": "opensles",
|
||||
"value": "0"
|
||||
},
|
||||
{
|
||||
"category": 4,
|
||||
"name": "overlay-format",
|
||||
"value": "842225234"
|
||||
},
|
||||
{
|
||||
"category": 4,
|
||||
"name": "framedrop",
|
||||
"value": "1"
|
||||
},
|
||||
{
|
||||
"category": 4,
|
||||
"name": "soundtouch",
|
||||
"value": "1"
|
||||
},
|
||||
{
|
||||
"category": 4,
|
||||
"name": "start-on-prepared",
|
||||
"value": "1"
|
||||
},
|
||||
{
|
||||
"category": 1,
|
||||
"name": "http-detect-range-support",
|
||||
"value": "0"
|
||||
},
|
||||
{
|
||||
"category": 1,
|
||||
"name": "fflags",
|
||||
"value": "fastseek"
|
||||
},
|
||||
{
|
||||
"category": 2,
|
||||
"name": "skip_loop_filter",
|
||||
"value": "48"
|
||||
},
|
||||
{
|
||||
"category": 4,
|
||||
"name": "reconnect",
|
||||
"value": "1"
|
||||
},
|
||||
{
|
||||
"category": 4,
|
||||
"name": "enable-accurate-seek",
|
||||
"value": "0"
|
||||
},
|
||||
{
|
||||
"category": 4,
|
||||
"name": "mediacodec",
|
||||
"value": "1"
|
||||
},
|
||||
{
|
||||
"category": 4,
|
||||
"name": "mediacodec-auto-rotate",
|
||||
"value": "1"
|
||||
},
|
||||
{
|
||||
"category": 4,
|
||||
"name": "mediacodec-handle-resolution-change",
|
||||
"value": "1"
|
||||
},
|
||||
{
|
||||
"category": 4,
|
||||
"name": "mediacodec-hevc",
|
||||
"value": "1"
|
||||
},
|
||||
{
|
||||
"category": 1,
|
||||
"name": "dns_cache_timeout",
|
||||
"value": "600000000"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"proxy": [
|
||||
"file://TV/proxy.json"
|
||||
],
|
||||
"rules": [
|
||||
{
|
||||
"name": "cl",
|
||||
"hosts": [
|
||||
"magnet"
|
||||
],
|
||||
"regex": [
|
||||
"最 新",
|
||||
"直 播",
|
||||
"更 新"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "火山嗅探",
|
||||
"hosts": [
|
||||
"huoshan.com"
|
||||
],
|
||||
"regex": [
|
||||
"item_id="
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "抖音嗅探",
|
||||
"hosts": [
|
||||
"douyin.com"
|
||||
],
|
||||
"regex": [
|
||||
"is_play_url="
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "农民嗅探",
|
||||
"hosts": [
|
||||
"toutiaovod.com"
|
||||
],
|
||||
"regex": [
|
||||
"video/tos/cn"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "七新嗅探",
|
||||
"hosts": [
|
||||
"api.52wyb.com"
|
||||
],
|
||||
"regex": [
|
||||
"m3u8?pt=m3u8"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "夜市",
|
||||
"hosts": [
|
||||
"yeslivetv.com"
|
||||
],
|
||||
"script": [
|
||||
"document.getElementsByClassName('vjs-big-play-button')[0].click()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "毛驴",
|
||||
"hosts": [
|
||||
"www.maolvys.com"
|
||||
],
|
||||
"script": [
|
||||
"document.getElementsByClassName('swal-button swal-button--confirm')[0].click()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "czzy",
|
||||
"hosts": [
|
||||
"10086.cn"
|
||||
],
|
||||
"regex": [
|
||||
"/storageWeb/servlet/downloadServlet"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "bdys",
|
||||
"hosts": [
|
||||
"bytetos.com",
|
||||
"byteimg.com",
|
||||
"bytednsdoc.com",
|
||||
"pstatp.com"
|
||||
],
|
||||
"regex": [
|
||||
"/tos-cn"
|
||||
],
|
||||
"exclude": [
|
||||
".m3u8"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "bdys10",
|
||||
"hosts": [
|
||||
"bdys10.com"
|
||||
],
|
||||
"regex": [
|
||||
"/obj/"
|
||||
],
|
||||
"exclude": [
|
||||
".m3u8"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -802,6 +802,12 @@
|
||||
"type": 3,
|
||||
"api": "https://ghfast.top/https://raw.githubusercontent.com/FGBLH/HKL/refs/heads/main/py/黑料网.py"
|
||||
},
|
||||
{
|
||||
"key": "MoTV",
|
||||
"name": "🐬MoTV.py|🔞[成人]",
|
||||
"type": 3,
|
||||
"api": "https://ghfast.top/https://raw.githubusercontent.com/FGBLH/HKL/refs/heads/main/py/MoTV.py"
|
||||
},
|
||||
{
|
||||
"key": "真实人妻",
|
||||
"name": "🐬真实人妻.py|🔞[成人]",
|
||||
|
||||
@@ -545,6 +545,12 @@
|
||||
"type": 3,
|
||||
"api": "https://ghfast.top/https://raw.githubusercontent.com/FGBLH/HKL/refs/heads/main/py/黑料网.py"
|
||||
},
|
||||
{
|
||||
"key": "MoTV",
|
||||
"name": "🐬MoTV.py|🔞[成人]",
|
||||
"type": 3,
|
||||
"api": "https://ghfast.top/https://raw.githubusercontent.com/FGBLH/HKL/refs/heads/main/py/MoTV.py"
|
||||
},
|
||||
{
|
||||
"key": "真实人妻",
|
||||
"name": "🐬真实人妻.py|🔞[成人]",
|
||||
|
||||
@@ -741,6 +741,12 @@
|
||||
"type": 3,
|
||||
"api": "https://ghfast.top/https://raw.githubusercontent.com/FGBLH/HKL/refs/heads/main/py/蜜桃视频.py"
|
||||
},
|
||||
{
|
||||
"key": "MoTV",
|
||||
"name": "🐬MoTV.py|🔞",
|
||||
"type": 3,
|
||||
"api": "https://ghfast.top/https://raw.githubusercontent.com/FGBLH/HKL/refs/heads/main/py/MoTV.py"
|
||||
},
|
||||
{
|
||||
"key": "真实人妻",
|
||||
"name": "🐬真实人妻.py|🔞",
|
||||
|
||||
@@ -574,6 +574,12 @@
|
||||
"type": 3,
|
||||
"api": "https://ghfast.top/https://raw.githubusercontent.com/FGBLH/HKL/refs/heads/main/py/蜜桃视频.py"
|
||||
},
|
||||
{
|
||||
"key": "MoTV",
|
||||
"name": "🐬MoTV.py|🔞",
|
||||
"type": 3,
|
||||
"api": "https://ghfast.top/https://raw.githubusercontent.com/FGBLH/HKL/refs/heads/main/py/MoTV.py"
|
||||
},
|
||||
{
|
||||
"key": "真实人妻",
|
||||
"name": "🐬真实人妻.py|🔞",
|
||||
|
||||
@@ -0,0 +1,196 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import re
|
||||
import urllib.parse
|
||||
import requests
|
||||
|
||||
try:
|
||||
from base.spider import Spider as BaseSpider
|
||||
except ImportError:
|
||||
class BaseSpider:
|
||||
pass
|
||||
|
||||
class Spider(BaseSpider):
|
||||
BASE_URL = "https://www.motv.app"
|
||||
HEADERS = {
|
||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0 Safari/537.36",
|
||||
"Referer": "https://www.motv.app/",
|
||||
"Accept": "*/*"
|
||||
}
|
||||
|
||||
CATES = [
|
||||
{"type_name": "日本有碼", "type_id": "20"},
|
||||
{"type_name": "日本無碼", "type_id": "50"},
|
||||
{"type_name": "歐美风情", "type_id": "25"},
|
||||
{"type_name": "國產原創", "type_id": "41"},
|
||||
{"type_name": "動畫", "type_id": "29"},
|
||||
{"type_name": "水果AV", "type_id": "35"},
|
||||
{"type_name": "色情情燴", "type_id": "30"},
|
||||
{"type_name": "經典四級", "type_id": "47"},
|
||||
{"type_name": "鹹濕電台", "type_id": "169"}
|
||||
]
|
||||
|
||||
def __init__(self):
|
||||
self.session = requests.Session()
|
||||
self.session.headers.update(self.HEADERS)
|
||||
|
||||
def getName(self):
|
||||
return "MOTV"
|
||||
|
||||
def init(self, extend=""):
|
||||
pass
|
||||
|
||||
def isVideoFormat(self, url):
|
||||
return False
|
||||
|
||||
def manualVideoCheck(self):
|
||||
return False
|
||||
|
||||
def homeContent(self, filter):
|
||||
return {"class": self.CATES, "filters": {}, "list": self._ajax_list("20", 1), "parse": 0, "jx": 0}
|
||||
|
||||
def homeVideoContent(self):
|
||||
return {"list": self._ajax_list("20", 1)}
|
||||
|
||||
def categoryContent(self, tid, pg, filter, extend):
|
||||
pg = int(pg or 1)
|
||||
data = self._ajax_json(tid, pg)
|
||||
return {
|
||||
"list": self._json_list(data),
|
||||
"page": pg,
|
||||
"pagecount": self._to_int(data.get("pagecount") or data.get("page_count") or data.get("last_page"), 999),
|
||||
"limit": self._to_int(data.get("limit"), 20),
|
||||
"total": self._to_int(data.get("total"), 9999)
|
||||
}
|
||||
|
||||
def detailContent(self, ids):
|
||||
vid = ids[0] if isinstance(ids, list) else ids
|
||||
html = self._get(urllib.parse.urljoin(self.BASE_URL, "/voddetail/%s/" % vid))
|
||||
name = self._match(html, r"<h1[^>]*>(.*?)</h1>") or self._match(html, r"vod_name\s*=\s*['\"]([^'\"]+)")
|
||||
pic = self._match(html, r"vod_pic\s*=\s*['\"]([^'\"]+)")
|
||||
desc = self._clean(self._match(html, r'<div[^>]+class="[^"]*(?:content|detail|desc|sketch)[^"]*"[^>]*>(.*?)</div>'))
|
||||
play_urls = self._play_urls(html, vid)
|
||||
vod = {
|
||||
"vod_id": vid,
|
||||
"vod_name": self._clean(name) or vid,
|
||||
"vod_pic": urllib.parse.urljoin(self.BASE_URL, pic or ""),
|
||||
"type_name": "",
|
||||
"vod_year": "",
|
||||
"vod_area": "",
|
||||
"vod_remarks": "",
|
||||
"vod_actor": "",
|
||||
"vod_director": "",
|
||||
"vod_content": desc,
|
||||
"vod_play_from": "MOTV",
|
||||
"vod_play_url": play_urls
|
||||
}
|
||||
return {"list": [vod], "parse": 0, "jx": 0}
|
||||
|
||||
def searchContent(self, key, quick, pg="1"):
|
||||
wd = urllib.parse.quote(key)
|
||||
url = "%s/index.php/ajax/data?mid=1&wd=%s&page=%s&limit=20" % (self.BASE_URL, wd, pg)
|
||||
return {"list": self._json_list(self._json(url))}
|
||||
|
||||
def playerContent(self, flag, id, vipFlags):
|
||||
play_url = urllib.parse.urljoin(self.BASE_URL, id or "")
|
||||
page = self._get(play_url)
|
||||
watch = self._player_url(page)
|
||||
if watch:
|
||||
watch_html = self._get(watch, {"Referer": play_url, "Origin": self.BASE_URL, "Accept": "*/*"})
|
||||
m3u8 = self._match(watch_html, r"var\s+src\s*=\s*['\"]([^'\"]+\.m3u8[^'\"]*)")
|
||||
if not m3u8:
|
||||
m3u8 = self._match(watch_html, r"['\"]([^'\"]+\.m3u8[^'\"]*)")
|
||||
if m3u8:
|
||||
real = urllib.parse.urljoin(watch, m3u8.replace("\\/", "/"))
|
||||
u = urllib.parse.urlparse(watch)
|
||||
return {"parse": 0, "playUrl": "", "url": real, "jx": 0, "header": {"User-Agent": self.HEADERS["User-Agent"], "Referer": watch, "Origin": u.scheme + "://" + u.netloc}}
|
||||
return {"parse": 0, "playUrl": "", "url": watch, "jx": 0, "header": {"User-Agent": self.HEADERS["User-Agent"], "Referer": play_url, "Origin": self.BASE_URL}}
|
||||
return {"parse": 1, "playUrl": "", "url": play_url, "jx": 0, "header": {"User-Agent": self.HEADERS["User-Agent"], "Referer": self.BASE_URL + "/"}}
|
||||
|
||||
def localProxy(self, param):
|
||||
return None
|
||||
|
||||
def _ajax_json(self, tid, pg):
|
||||
tid = str(tid or "20")
|
||||
pg = str(pg or "1")
|
||||
url = "%s/index.php/ajax/data?mid=1&tid=%s&page=%s&limit=20" % (self.BASE_URL, urllib.parse.quote(tid), urllib.parse.quote(pg))
|
||||
return self._json(url, {"Referer": "%s/vodtype/%s/" % (self.BASE_URL, tid)})
|
||||
|
||||
def _ajax_list(self, tid, pg):
|
||||
return self._json_list(self._ajax_json(tid, pg))
|
||||
|
||||
def _json_list(self, data):
|
||||
arr = data.get("list") or data.get("data") or []
|
||||
if isinstance(arr, dict):
|
||||
arr = arr.get("list") or arr.get("data") or []
|
||||
result = []
|
||||
seen = set()
|
||||
for item in arr:
|
||||
vid = str(item.get("vod_id") or item.get("id") or item.get("vodid") or "")
|
||||
name = item.get("vod_name") or item.get("name") or item.get("title") or ""
|
||||
pic = item.get("vod_pic") or item.get("pic") or item.get("cover") or item.get("vod_pic_thumb") or ""
|
||||
remarks = item.get("vod_remarks") or item.get("remarks") or item.get("note") or item.get("vod_time") or ""
|
||||
if vid and name and vid not in seen:
|
||||
seen.add(vid)
|
||||
result.append({"vod_id": vid, "vod_name": self._clean(name), "vod_pic": urllib.parse.urljoin(self.BASE_URL, pic), "vod_remarks": self._clean(remarks)})
|
||||
return result
|
||||
|
||||
def _play_urls(self, html, vid):
|
||||
rows = re.findall(r'href=["\']([^"\']*/vodplay/%s-\d+-\d+/?)["\'][^>]*>(.*?)<' % re.escape(str(vid)), html, re.S)
|
||||
if not rows:
|
||||
return "第1集$%s/vodplay/%s-1-1/" % (self.BASE_URL, vid)
|
||||
result = []
|
||||
seen = set()
|
||||
for url, name in rows:
|
||||
full = urllib.parse.urljoin(self.BASE_URL, url)
|
||||
if full not in seen:
|
||||
seen.add(full)
|
||||
result.append("%s$%s" % (self._clean(name) or ("第%s集" % len(result + [1])), full))
|
||||
return "#".join(result) or "第1集$%s/vodplay/%s-1-1/" % (self.BASE_URL, vid)
|
||||
|
||||
def _player_url(self, html):
|
||||
raw = self._match(html, r"player_aaaa\s*=\s*(\{.*?\})")
|
||||
if not raw:
|
||||
raw = self._match(html, r"player_data\s*=\s*(\{.*?\})")
|
||||
if raw:
|
||||
url = self._match(raw, r'"url"\s*:\s*"([^"]+)"') or self._match(raw, r"'url'\s*:\s*'([^']+)'")
|
||||
if url:
|
||||
return url.replace("\\/", "/")
|
||||
iframe = self._match(html, r'<iframe[^>]+src=["\']([^"\']+)')
|
||||
return urllib.parse.urljoin(self.BASE_URL, iframe) if iframe else ""
|
||||
|
||||
def _json(self, url, headers=None):
|
||||
try:
|
||||
h = self.HEADERS.copy()
|
||||
if headers:
|
||||
h.update(headers)
|
||||
r = self.session.get(url, headers=h, timeout=15)
|
||||
r.encoding = "utf-8"
|
||||
return r.json()
|
||||
except Exception:
|
||||
return {}
|
||||
|
||||
def _get(self, url, headers=None):
|
||||
try:
|
||||
h = self.HEADERS.copy()
|
||||
if headers:
|
||||
h.update(headers)
|
||||
r = self.session.get(url, headers=h, timeout=15)
|
||||
r.encoding = "utf-8"
|
||||
return r.text
|
||||
except Exception:
|
||||
return ""
|
||||
|
||||
def _match(self, text, pattern):
|
||||
m = re.search(pattern, text or "", re.S)
|
||||
return m.group(1).strip() if m else ""
|
||||
|
||||
def _clean(self, text):
|
||||
text = re.sub(r"<[^>]+>", " ", text or "")
|
||||
text = text.replace(" ", " ").replace("&", "&").replace(""", '"').replace("'", "'")
|
||||
return re.sub(r"\s+", " ", text).strip()
|
||||
|
||||
def _to_int(self, value, default=0):
|
||||
try:
|
||||
return int(value)
|
||||
except Exception:
|
||||
return default
|
||||
+11
-3
@@ -95,12 +95,20 @@ class Spider(BaseSpider):
|
||||
if self._class_cache:
|
||||
return self._class_cache
|
||||
self._class_cache = [
|
||||
{"type_id": "/videos", "type_name": "精选影片"},
|
||||
{"type_id": "/videos/all/new", "type_name": "今日更新"},
|
||||
{"type_id": "/videos/all/every", "type_name": "全站最热"},
|
||||
{"type_id": "/videos/category/rhgv", "type_name": "日韩专区"},
|
||||
{"type_id": "/videos/category/omjd", "type_name": "欧美专区"},
|
||||
{"type_id": "/videos/all/xiaolan", "type_name": "原创专区"},
|
||||
{"type_id": "/videos/all/xiaolan", "type_name": "小蓝原创"},
|
||||
{"type_id": "/videos/all/20min", "type_name": "长片专区"},
|
||||
{"type_id": "/videos/all/10min", "type_name": "短片速看"},
|
||||
{"type_id": "/videos/category/xrbj", "type_name": "薄肌鲜肉"},
|
||||
{"type_id": "/videos/category/wtns", "type_name": "无套内射"},
|
||||
{"type_id": "/videos/category/jrmn", "type_name": "肌肉猛男"},
|
||||
{"type_id": "/videos/category/drqp", "type_name": "群交互动"},
|
||||
{"type_id": "/videos/category/tjsm", "type_name": "调教SM"},
|
||||
{"type_id": "/videos/category/kjys", "type_name": "口交颜射"},
|
||||
{"type_id": "/videos/category/zfyh", "type_name": "制服诱惑"},
|
||||
]
|
||||
return self._class_cache
|
||||
|
||||
@@ -225,4 +233,4 @@ class Spider(BaseSpider):
|
||||
import time
|
||||
return int(time.time())
|
||||
except Exception:
|
||||
return 0
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user