Sync all projects
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
{
|
||||
"class": [
|
||||
{ "type_id": "rank", "type_name": "排行榜" },
|
||||
{ "type_id": "pop", "type_name": "流行" },
|
||||
{ "type_id": "rock", "type_name": "摇滚" },
|
||||
{ "type_id": "folk", "type_name": "民谣" },
|
||||
{ "type_id": "electronic", "type_name": "电子" },
|
||||
{ "type_id": "rap", "type_name": "说唱" },
|
||||
{ "type_id": "rnb", "type_name": "R&B" },
|
||||
{ "type_id": "jazz", "type_name": "爵士" },
|
||||
{ "type_id": "classical", "type_name": "古典" },
|
||||
{ "type_id": "light", "type_name": "轻音乐" },
|
||||
{ "type_id": "soundtrack", "type_name": "影视原声" },
|
||||
{ "type_id": "anime", "type_name": "动漫" },
|
||||
{ "type_id": "game", "type_name": "游戏" },
|
||||
{ "type_id": "net", "type_name": "网络歌曲" },
|
||||
{ "type_id": "douyin", "type_name": "抖音热歌" },
|
||||
{ "type_id": "classic", "type_name": "怀旧经典" },
|
||||
{ "type_id": "chinese", "type_name": "华语" },
|
||||
{ "type_id": "cantonese", "type_name": "粤语" },
|
||||
{ "type_id": "western", "type_name": "欧美" },
|
||||
{ "type_id": "japan", "type_name": "日语" },
|
||||
{ "type_id": "korea", "type_name": "韩语" }
|
||||
],
|
||||
"filters": {
|
||||
"pop": [
|
||||
{ "key": "lang", "name": "语种", "value": [
|
||||
{ "n": "全部", "v": "" },
|
||||
{ "n": "华语", "v": "华语" },
|
||||
{ "n": "欧美", "v": "欧美" },
|
||||
{ "n": "日韩", "v": "日韩" }
|
||||
]},
|
||||
{ "key": "year", "name": "年代", "value": [
|
||||
{ "n": "全部", "v": "" },
|
||||
{ "n": "2020", "v": "2020" },
|
||||
{ "n": "2010", "v": "2010" },
|
||||
{ "n": "2000", "v": "2000" }
|
||||
]}
|
||||
],
|
||||
"chinese": [
|
||||
{ "key": "male", "name": "男歌手", "value": [
|
||||
{ "n": "全部", "v": "" },
|
||||
{ "n": "周杰伦", "v": "周杰伦" },
|
||||
{ "n": "林俊杰", "v": "林俊杰" },
|
||||
{ "n": "陈奕迅", "v": "陈奕迅" },
|
||||
{ "n": "李健", "v": "李健" },
|
||||
{ "n": "朴树", "v": "朴树" },
|
||||
{ "n": "许巍", "v": "许巍" },
|
||||
{ "n": "毛不易", "v": "毛不易" },
|
||||
{ "n": "薛之谦", "v": "薛之谦" },
|
||||
{ "n": "李荣浩", "v": "李荣浩" },
|
||||
{ "n": "张杰", "v": "张杰" },
|
||||
{ "n": "胡彦斌", "v": "胡彦斌" },
|
||||
{ "n": "许嵩", "v": "许嵩" },
|
||||
{ "n": "赵雷", "v": "赵雷" }
|
||||
]},
|
||||
{ "key": "female", "name": "女歌手", "value": [
|
||||
{ "n": "全部", "v": "" },
|
||||
{ "n": "邓紫棋", "v": "邓紫棋" },
|
||||
{ "n": "张靓颖", "v": "张靓颖" },
|
||||
{ "n": "降央卓玛", "v": "降央卓玛" },
|
||||
{ "n": "萨顶顶", "v": "萨顶顶" },
|
||||
{ "n": "谭维维", "v": "谭维维" },
|
||||
{ "n": "袁娅维", "v": "袁娅维" },
|
||||
{ "n": "田馥甄", "v": "田馥甄" },
|
||||
{ "n": "陈粒", "v": "陈粒" },
|
||||
{ "n": "张碧晨", "v": "张碧晨" },
|
||||
{ "n": "徐佳莹", "v": "徐佳莹" },
|
||||
{ "n": "郁可唯", "v": "郁可唯" },
|
||||
{ "n": "蔡健雅", "v": "蔡健雅" },
|
||||
{ "n": "孙燕姿", "v": "孙燕姿" }
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -24,7 +24,7 @@ class Spider(Spider):
|
||||
self.headers = {
|
||||
'Origin': origin,
|
||||
'Referer': f"{origin}/",
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:144.0) Gecko/20100101 Firefox/144.0'
|
||||
'User-Agent':"Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
|
||||
}
|
||||
self.stripchat_key = self.decode_key_compact()
|
||||
# 缓存字典
|
||||
|
||||
@@ -0,0 +1,278 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# by @6666
|
||||
import concurrent.futures
|
||||
import json
|
||||
import re
|
||||
import sys
|
||||
import time
|
||||
from base64 import b64decode, b64encode
|
||||
import requests
|
||||
from pyquery import PyQuery as pq
|
||||
sys.path.append('..')
|
||||
from base.spider import Spider
|
||||
|
||||
|
||||
class Spider(Spider):
|
||||
|
||||
def init(self, extend=""):
|
||||
self.host = "https://vip.wwgz.cn:5200"
|
||||
self.headers = {
|
||||
'User-Agent': 'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36',
|
||||
'Referer': self.host + '/',
|
||||
'Accept': 'text/html'
|
||||
}
|
||||
self.cateConfig = {
|
||||
"12": [{"key": "cateId", "name": "类型", "value": [{"n": "国产剧", "v": "12"}]}],
|
||||
"4": [{"key": "cateId", "name": "类型", "value": [{"n": "动漫", "v": "4"}]}],
|
||||
"1": [{"key": "cateId", "name": "类型", "value": [{"n": "电影", "v": "1"}]}],
|
||||
"2": [{"key": "cateId", "name": "类型", "value": [{"n": "电视剧", "v": "2"}]}],
|
||||
"3": [{"key": "cateId", "name": "类型", "value": [{"n": "综艺", "v": "3"}]}],
|
||||
"26": [{"key": "cateId", "name": "类型", "value": [{"n": "短剧", "v": "26"}]}]
|
||||
}
|
||||
self.filterConfig = {}
|
||||
|
||||
def getName(self):
|
||||
return "农民影视"
|
||||
|
||||
def isVideoFormat(self, url):
|
||||
pass
|
||||
|
||||
def manualVideoCheck(self):
|
||||
pass
|
||||
|
||||
def destroy(self):
|
||||
pass
|
||||
|
||||
def homeContent(self, filter):
|
||||
result = {}
|
||||
classes = [
|
||||
{'type_name': '国产剧', 'type_id': '12'},
|
||||
{'type_name': '动漫', 'type_id': '4'},
|
||||
{'type_name': '电影', 'type_id': '1'},
|
||||
{'type_name': '电视剧', 'type_id': '2'},
|
||||
{'type_name': '综艺', 'type_id': '3'},
|
||||
{'type_name': '短剧', 'type_id': '26'}
|
||||
]
|
||||
try:
|
||||
data = self.fetch(self.host, headers=self.headers).text
|
||||
doc = pq(data)
|
||||
videos = []
|
||||
# 修改选择器并添加去重逻辑
|
||||
seen_ids = set() # 用于记录已处理的影片ID
|
||||
for item in doc('.globalPicList li:has(img)').items():
|
||||
vod_id = self.host + item('a').attr('href')
|
||||
if vod_id not in seen_ids: # 检查是否已处理过
|
||||
seen_ids.add(vod_id) # 记录已处理的ID
|
||||
pic_url = item('img').attr('data-echo') or item('img').attr('data-src') or item('img').attr('src')
|
||||
# 替换图片域名
|
||||
if pic_url and 'pic.lzzypic.com' in pic_url:
|
||||
pic_url = pic_url.replace('https://pic.lzzypic.com', 'https://img.lzzyimg.com')
|
||||
videos.append({
|
||||
'vod_id': vod_id,
|
||||
'vod_name': item('.sTit').text(),
|
||||
'vod_pic': pic_url,
|
||||
'vod_remarks': item('.sBottom').text()
|
||||
})
|
||||
result['class'] = classes
|
||||
result['filters'] = self.cateConfig
|
||||
result['list'] = videos
|
||||
except Exception as e:
|
||||
print(f"首页数据获取失败: {str(e)}")
|
||||
result['class'] = classes
|
||||
result['filters'] = self.cateConfig
|
||||
result['list'] = []
|
||||
return result
|
||||
|
||||
def homeVideoContent(self):
|
||||
pass
|
||||
|
||||
def categoryContent(self, tid, pg, filter, extend):
|
||||
result = {}
|
||||
try:
|
||||
if tid == "4-dm":
|
||||
# 处理大陆人气动漫分类
|
||||
url = "https://www.wwgz.cn/vod-list-id-4-pg-{}-order--by-hits-class-0-year-0-letter--area-大陆-lang-.html".format(pg)
|
||||
else:
|
||||
cateId = tid
|
||||
url = f"{self.host}/vod-list-id-{cateId}-pg-{pg}.html"
|
||||
|
||||
data = self.fetch(url, headers=self.headers).text
|
||||
doc = pq(data)
|
||||
|
||||
videos = []
|
||||
for item in doc('.globalPicList li').items():
|
||||
pic_url = item('img').attr('data-echo') or item('img').attr('data-src') or item('img').attr('src')
|
||||
# 替换图片域名
|
||||
if pic_url and 'pic.lzzypic.com' in pic_url:
|
||||
pic_url = pic_url.replace('https://pic.lzzypic.com', 'https://img.lzzyimg.com')
|
||||
videos.append({
|
||||
'vod_id': self.host + item('a').attr('href'),
|
||||
'vod_name': item('.sTit').text(),
|
||||
'vod_pic': pic_url,
|
||||
'vod_remarks': item('.sBottom').text()
|
||||
})
|
||||
|
||||
result['list'] = videos
|
||||
result['page'] = pg
|
||||
result['pagecount'] = 9999
|
||||
result['limit'] = 90
|
||||
result['total'] = 999999
|
||||
except Exception as e:
|
||||
print(f"分类数据获取失败: {str(e)}")
|
||||
result['list'] = []
|
||||
result['page'] = pg
|
||||
result['pagecount'] = 1
|
||||
result['limit'] = 90
|
||||
result['total'] = 0
|
||||
return result
|
||||
|
||||
def detailContent(self, ids):
|
||||
result = {}
|
||||
try:
|
||||
url = ids[0]
|
||||
data = self.fetch(url, headers=self.headers).text
|
||||
doc = pq(data)
|
||||
|
||||
# 获取播放线路和剧集
|
||||
play_from = []
|
||||
play_url = []
|
||||
|
||||
tab_box = doc('#leftTabBox')
|
||||
if tab_box:
|
||||
for tab in tab_box('ul li').items():
|
||||
play_from.append(tab.text())
|
||||
|
||||
play_lists = []
|
||||
for num_list in tab_box('.numList').items():
|
||||
episodes = []
|
||||
# 修改这里:将items()转换为列表后反转顺序
|
||||
for ep in list(num_list('li').items())[::-1]: # 反转列表顺序
|
||||
episodes.append(f"{ep('a').text()}${self.host}{ep('a').attr('href')}")
|
||||
play_lists.append('#'.join(episodes))
|
||||
|
||||
play_url = play_lists
|
||||
|
||||
# 获取详情信息
|
||||
vod = {
|
||||
'vod_name': doc('h1 a').text(),
|
||||
'vod_year': doc('span:contains("年代:")').text().replace('年代:', ''),
|
||||
'vod_area': '',
|
||||
'vod_actor': doc('.sDes:contains("主演:")').text().replace('主演:', ''),
|
||||
'vod_director': '',
|
||||
'vod_content': doc('.detail-con p').text().replace('简介:', ''),
|
||||
'vod_play_from': '$$$'.join(play_from),
|
||||
'vod_play_url': '$$$'.join(play_url)
|
||||
}
|
||||
result['list'] = [vod]
|
||||
except Exception as e:
|
||||
print(f"详情数据获取失败: {str(e)}")
|
||||
result['list'] = []
|
||||
return result
|
||||
|
||||
def searchContent(self, key, quick, pg="1"):
|
||||
result = {}
|
||||
try:
|
||||
url = f"{self.host}/index.php?m=vod-search"
|
||||
data = {'wd': key}
|
||||
headers = {
|
||||
'User-Agent': self.headers['User-Agent'],
|
||||
'Referer': self.host + '/'
|
||||
}
|
||||
html = self.post(url, data=data, headers=headers).text
|
||||
doc = pq(html)
|
||||
|
||||
videos = []
|
||||
for item in doc('#data_list li').items():
|
||||
pic_url = item('.lazyload').attr('data-src')
|
||||
# 替换图片域名
|
||||
if pic_url and 'pic.lzzypic.com' in pic_url:
|
||||
pic_url = pic_url.replace('https://pic.lzzypic.com', 'https://img.lzzyimg.com')
|
||||
videos.append({
|
||||
'vod_id': self.host + item('a').attr('href'),
|
||||
'vod_name': item('.sTit').text(),
|
||||
'vod_pic': pic_url,
|
||||
'vod_remarks': item('.sDes').eq(-1).text()
|
||||
})
|
||||
|
||||
result['list'] = videos
|
||||
result['page'] = pg
|
||||
except Exception as e:
|
||||
print(f"搜索数据获取失败: {str(e)}")
|
||||
result['list'] = []
|
||||
result['page'] = pg
|
||||
return result
|
||||
|
||||
def playerContent(self, flag, id, vipFlags):
|
||||
result = {}
|
||||
try:
|
||||
if '@' in id:
|
||||
ids = id.split('@')
|
||||
if not ids[0]:
|
||||
raise Exception('未找到播放地址')
|
||||
|
||||
js_url = f"{self.host}/player/{ids[0]}.js"
|
||||
js_data = self.fetch(js_url, headers=self.headers).text
|
||||
jxurl = re.search(r'http.*?url=', js_data).group()
|
||||
|
||||
data = self.fetch(f"{jxurl}{ids[1]}", headers=self.headers).text
|
||||
matches = re.findall(r'http.*?url=', data)
|
||||
|
||||
if matches:
|
||||
url = []
|
||||
for i, x in enumerate(matches):
|
||||
js = {'jx': x, 'id': ids[1]}
|
||||
purl = f"{self.getProxyUrl()}&wdict={self.e64(json.dumps(js))}"
|
||||
url.extend([f'线路{i + 1}', purl])
|
||||
else:
|
||||
url = re.search(r"url='(.*?)'", data).group(1)
|
||||
|
||||
if not url:
|
||||
raise Exception('未找到播放地址')
|
||||
|
||||
p = 0
|
||||
else:
|
||||
p, url = 1, id
|
||||
|
||||
result['parse'] = p
|
||||
result['url'] = url
|
||||
result['header'] = self.headers
|
||||
except Exception as e:
|
||||
print(f"播放数据获取失败: {str(e)}")
|
||||
result['parse'] = 1
|
||||
result['url'] = id
|
||||
result['header'] = self.headers
|
||||
return result
|
||||
|
||||
def localProxy(self, param):
|
||||
try:
|
||||
wdict = json.loads(self.d64(param['wdict']))
|
||||
url = f"{wdict['jx']}{wdict['id']}"
|
||||
data = self.fetch(url, headers=self.headers).text
|
||||
doc = pq(data)
|
||||
html = doc('script').eq(-1).text()
|
||||
url = re.search(r'src="(.*?)"', html).group(1)
|
||||
return [302, 'text/html', None, {'Location': url}]
|
||||
except Exception as e:
|
||||
print(f"代理处理失败: {str(e)}")
|
||||
return [500, 'text/plain', str(e).encode('utf-8')]
|
||||
|
||||
def liveContent(self, url):
|
||||
pass
|
||||
|
||||
def e64(self, text):
|
||||
try:
|
||||
text_bytes = text.encode('utf-8')
|
||||
encoded_bytes = b64encode(text_bytes)
|
||||
return encoded_bytes.decode('utf-8')
|
||||
except Exception as e:
|
||||
print(f"Base64编码错误: {str(e)}")
|
||||
return ""
|
||||
|
||||
def d64(self, encoded_text):
|
||||
try:
|
||||
encoded_bytes = encoded_text.encode('utf-8')
|
||||
decoded_bytes = b64decode(encoded_bytes)
|
||||
return decoded_bytes.decode('utf-8')
|
||||
except Exception as e:
|
||||
print(f"Base64解码错误: {str(e)}")
|
||||
return ""
|
||||
+19
-2
@@ -100,6 +100,12 @@
|
||||
"type": 3,
|
||||
"api": "https://ghfast.top/https://raw.githubusercontent.com/FGBLH/GHK/refs/heads/main/py/热播APP.py"
|
||||
},
|
||||
{
|
||||
"key": "nmvm",
|
||||
"name": "🐬农民影视.py",
|
||||
"type": 3,
|
||||
"api": "https://ghfast.top/https://raw.githubusercontent.com/FGBLH/GHK/refs/heads/main/py/农民影视.py"
|
||||
},
|
||||
{
|
||||
"key": "kf",
|
||||
"name": "🐬咖啡体育直播.py",
|
||||
@@ -401,16 +407,27 @@
|
||||
},
|
||||
{
|
||||
"key": "网易云音乐",
|
||||
"name": "🐬网易云|音乐",
|
||||
"name": "🐬网易云[音乐]",
|
||||
"type": 3,
|
||||
"api": "https://xn--fjq53n.xyz/Ting/yinyue/网易云音乐.py"
|
||||
},
|
||||
{
|
||||
"key": "网易云音乐1",
|
||||
"name": "🐬网易云1|音乐",
|
||||
"name": "🐬网易云1[音乐]",
|
||||
"type": 3,
|
||||
"api": "https://xn--fjq53n.xyz/Ting/yinyue/网易云音乐1.py"
|
||||
},
|
||||
{
|
||||
"key": "捡的音乐",
|
||||
"name": "🐬爱听音乐[音乐]",
|
||||
"type": 3,
|
||||
"api": "csp_Music1",
|
||||
"searchable": 1,
|
||||
"quickSearch": 1,
|
||||
"ext": "https://ghfast.top/https://raw.githubusercontent.com/FGBLH/GHK/refs/heads/main/jar_js/Music1.json",
|
||||
"jar": "https://ghfast.top/https://raw.githubusercontent.com/FGBLH/GHK/refs/heads/main/jar_js/so.jar",
|
||||
"filterable": 1
|
||||
},
|
||||
{
|
||||
"key": "shjb",
|
||||
"name": "🐬色播聚合.py|🔞",
|
||||
|
||||
+12
-1
@@ -389,7 +389,18 @@
|
||||
"name": "🐬网易云1|音乐",
|
||||
"type": 3,
|
||||
"api": "https://xn--fjq53n.xyz/Ting/yinyue/网易云音乐1.py"
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "捡的音乐",
|
||||
"name": "🐬爱听音乐",
|
||||
"type": 3,
|
||||
"api": "csp_Music1",
|
||||
"searchable": 1,
|
||||
"quickSearch": 1,
|
||||
"ext": "https://ghfast.top/https://raw.githubusercontent.com/FGBLH/GHK/refs/heads/main/jar_js/Music1.json",
|
||||
"jar": "https://ghfast.top/https://raw.githubusercontent.com/FGBLH/GHK/refs/heads/main/jar_js/so.jar",
|
||||
"filterable": 1
|
||||
}
|
||||
],
|
||||
"parses": [
|
||||
{
|
||||
|
||||
@@ -495,6 +495,17 @@
|
||||
"type": 3,
|
||||
"api": "https://xn--fjq53n.xyz/Ting/yinyue/网易云音乐1.py"
|
||||
},
|
||||
{
|
||||
"key": "捡的音乐",
|
||||
"name": "🐬爱听音乐",
|
||||
"type": 3,
|
||||
"api": "csp_Music1",
|
||||
"searchable": 1,
|
||||
"quickSearch": 1,
|
||||
"ext": "https://ghfast.top/https://raw.githubusercontent.com/FGBLH/GHK/refs/heads/main/jar_js/Music1.json",
|
||||
"jar": "https://ghfast.top/https://raw.githubusercontent.com/FGBLH/GHK/refs/heads/main/jar_js/so.jar",
|
||||
"filterable": 1
|
||||
},
|
||||
{
|
||||
"key": "shjb",
|
||||
"name": "🐬色播聚合.py|🔞[成人]",
|
||||
|
||||
@@ -466,6 +466,17 @@
|
||||
"type": 3,
|
||||
"api": "https://xn--fjq53n.xyz/Ting/yinyue/网易云音乐1.py"
|
||||
},
|
||||
{
|
||||
"key": "捡的音乐",
|
||||
"name": "🐬爱听音乐",
|
||||
"type": 3,
|
||||
"api": "csp_Music1",
|
||||
"searchable": 1,
|
||||
"quickSearch": 1,
|
||||
"ext": "https://ghfast.top/https://raw.githubusercontent.com/FGBLH/GHK/refs/heads/main/jar_js/Music1.json",
|
||||
"jar": "https://ghfast.top/https://raw.githubusercontent.com/FGBLH/GHK/refs/heads/main/jar_js/so.jar",
|
||||
"filterable": 1
|
||||
},
|
||||
{
|
||||
"key": "豆瓣",
|
||||
"name": "豆瓣|首页",
|
||||
|
||||
Reference in New Issue
Block a user