Skip to content
This repository has been archived by the owner on Jul 8, 2024. It is now read-only.

Commit

Permalink
更新bd影视
Browse files Browse the repository at this point in the history
  • Loading branch information
hjdhnx committed Jan 12, 2024
1 parent ee2bdb7 commit a614069
Show file tree
Hide file tree
Showing 9 changed files with 95 additions and 24 deletions.
16 changes: 8 additions & 8 deletions base/custom.conf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"searchable":1,
"quickSearch":0,
"filterable":1,
"ext":"base_spider"
"ext":"{{host}}/txt/hipy/base_spider.json"
},
{
"key": "hipy_t3_base_spider",
Expand All @@ -43,11 +43,11 @@
"key":"hipy_t4_cntv央视",
"name":"cntv央视(hipy_t4)",
"type":4,
"api":"http://192.168.31.49:5707/api/v1/vod/cntv央视?api_ext={{host}}/txt/hipy/cntv央视.json",
"api":"http://192.168.31.49:5707/api/v1/vod/cntv央视",
"searchable":1,
"quickSearch":0,
"filterable":1,
"ext":"cntv央视"
"ext":"{{host}}/txt/hipy/cntv央视.json"
},
{
"key": "hipy_t3_cntv央视",
Expand All @@ -63,11 +63,11 @@
"key":"hipy_t4_两个BT",
"name":"两个BT(hipy_t4)",
"type":4,
"api":"http://192.168.31.49:5707/api/v1/vod/两个BT?api_ext={{host}}/txt/hipy/两个BT.json",
"api":"http://192.168.31.49:5707/api/v1/vod/两个BT",
"searchable":1,
"quickSearch":0,
"filterable":1,
"ext":"两个BT"
"ext":"{{host}}/txt/hipy/两个BT.json"
},
{
"key": "hipy_t3_两个BT",
Expand Down Expand Up @@ -103,11 +103,11 @@
"key":"hipy_t4_哔滴影视",
"name":"哔滴影视(hipy_t4)",
"type":4,
"api":"http://192.168.31.49:5707/api/v1/vod/哔滴影视?api_ext={{host}}/txt/hipy/bdys.jar",
"api":"http://192.168.31.49:5707/api/v1/vod/哔滴影视",
"searchable":1,
"quickSearch":0,
"filterable":1,
"ext":"{{host}}/txt/hipy/bdys.jar"
"ext":"{{host}}/txt/hipy/bidi.jar"
},
{
"key": "hipy_t3_哔滴影视",
Expand All @@ -117,7 +117,7 @@
"searchable": 1,
"quickSearch": 0,
"filterable": 1,
"ext": "{{host}}/txt/hipy/bdys.jar"
"ext": "{{host}}/txt/hipy/bidi.jar"
},
{"key":"Test_jsapi","name":"Test_jsapi(drpy)","type":3,"api":"{{host}}/libs/drpy2.min.js","searchable":2,"quickSearch":0,"filterable":0,"ext":"{{host}}/js/jsapi.js","jar":"{{host}}/libs/jar/custom_jsapi.jar"},

Expand Down
Binary file modified base/rules.db
Binary file not shown.
18 changes: 18 additions & 0 deletions txt/hipy/base_java_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
try:
# from base.spider import Spider as BaseSpider
from base.spider import BaseSpider
from com.github.tvbox.osc.util import PyUtil
from java import jbyte, jarray
# https://chaquo.com/chaquopy/doc/current/python.html#java.jbyte
except ImportError:
from t4.base.spider import BaseSpider

Expand Down Expand Up @@ -46,8 +49,23 @@ def init_jar(self, jar_path="./bdys.jar"):
self._prepare_env(jpype)
self.jClass = jpype.JClass
elif self.ENV.lower() == 't3':
PyUtil.load(jar_path)
self.jClass = None

def call_java(self, class_name, method_name, *args):
if self.ENV.lower() == 't4':
class1 = self.jClass(class_name)
method = getattr(class1, method_name)
# method = eval(f'class1.{method_name}', {'class1': class1})
# print(method)
return method(*args)
elif self.ENV.lower() == 't3':
return PyUtil.call(class_name, method_name, *args)

@staticmethod
def jarBytes(some_bytes: bytes):
return jarray(jbyte)(some_bytes)

def init(self, extend=""):
pass

Expand Down
6 changes: 5 additions & 1 deletion txt/hipy/base_spider.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def init_file(ext_file):
print(f'更新扩展筛选条件发生错误:{e}')

ext = self.extend
print(f"============{extend}============")
print(f"============ext:{ext},extend:{extend}============")
if isinstance(ext, str) and ext:
if ext.startswith('./'):
ext_file = os.path.join(os.path.dirname(__file__), ext)
Expand Down Expand Up @@ -406,4 +406,8 @@ def check_unsafe_attributes(string):
# spider.init_api_ext_file() # 生成筛选对应的json文件
spider.log({'key': 'value'})
spider.log('====文本内容====')
with open('test_1.txt', encoding='utf-8') as f:
code = f.read()
a = spider.superStr2dict(code)
print(type(a), a)
# spider.searchContent('斗罗大陆')
Binary file removed txt/hipy/bdys.jar
Binary file not shown.
Binary file added txt/hipy/bidi.jar
Binary file not shown.
22 changes: 22 additions & 0 deletions txt/hipy/test_1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[{'key':'你好',
'value':'这是一串代码',
'tip':'可能会有注释','a':true,"b":None,"c":null,'d':True}]
// 单行注释
# 单行注释

/*


多行注释
*/

"""

多行注释
"""


'''
多行注释

'''
2 changes: 2 additions & 0 deletions txt/hipy/两个BT.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,8 @@ def check_unsafe_attributes(string):
# print(spider.categoryContent('movie_bt', 1, True, {}))
# print(spider.searchContent('斗罗大陆'))
# print(spider.detailContent(['https://www.bttwo.net/movie/20107.html']))
# print(spider.playerContent('在线播放', spider.decodeStr('https%3A%2F%2Fwww.bttwo.net%2Fv_play%2FbXZfMzY4Nzgtbm1fMQ%3D%3D.html','utf-8'), None))
# print(spider.playerContent('在线播放', spider.decodeStr('https://www.bttwo.net/v_play/bXZfMTMyNjkwLW5tXzE=.html','utf-8'), None))
# print(spider.playerContent('在线播放', 'https://www.bttwo.net/v_play/bXZfMTMyNjA2LW5tXzE=.html', None))

# ciphertext = '+T77kORPkp6wtgdzcqQgPmUXomqshgO6IfTIGE8/40Iht0nDYW9pcGGUk/1157KS876b7FW1m6JMjPY2G+pwtscUjTcCq2G2NTnAX+1iMIexjK+nfTobgi2qYMtke/sWWe51RH/9IxqvoosAhH4dlN+QT/TIHKFFa6OyFiFp2hlUvPNpukbtZcHHshHMolQc9JmW3av+Js9AcyKDLuoFg9N38jrBidnUadw/9Pog/lsoRXUp7JFhdiVujAIkxTJjabvQXT2jGQS88MY7/kiem5SikAh/D+zVPnwO3E7z87o3GIC4agtWKbjTCfeRsUC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oC5xhI18xzZZZ1UJCjnKJRhdAumb5y3aAnOOX5Hj2KL6CD3PmPbSzE08ihcwxaRbME+2/zIxErr1j0MJmSvHBi9L1KCfGhizwFtJmu0MG0laGskYJflJUsIJE9BmuG7GCvCl4CKHYueKgpGn0ogd5QVDg5F/R3/tinEcw4n1Re0qlhKKyKhg8rCnOigAZCgET68/EOSMLxTlP4wY3Jtts12Zc5bL1MB6HkANlbwGryiiej4I8HmoH13AaS65cWmfZw9bJ4PffJYdhyns0qScbzGxQBiwJHZn7/mO6Yc7c0bfrevUeM4HogAHZTZYd7QIeH5ehmEUnPHv11GXtVJcN4sHhaaxDA4RVV5aN+4vRA3OgUhbuqebYcB5rVuMx7t3fw5kwQzQP7lnkPcXjjCLrLueCYyWJgUAKHi5TrAS9YtgHaIOA1lH0dIKAq+V8SoZPBxjxPr7AywT0d8qZc321NCbavu4voMZfh5ylrAuP7hYe1n9qGCFwZ/mQUoYLhPW0T6t3zmLEJgI9S0vm8SE0Z7BHam8O1P4xD9gFk/O1AumNs9rxFQT+exE+pZKJPKDXAgfEG11oUuB8sW/cgEwRZeLy3J543uWVS/LWY08SbVovKVWaTzm8JVGlwz2puLt5amzTLKUc'
Expand Down
55 changes: 40 additions & 15 deletions txt/hipy/哔滴影视.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
"key":"hipy_t4_哔滴影视",
"name":"哔滴影视(hipy_t4)",
"type":4,
"api":"http://192.168.31.49:5707/api/v1/vod/哔滴影视",
"api":"http://192.168.31.49:5707/api/v1/vod/哔滴影视?api_ext={{host}}/txt/hipy/bidi.jar",
"searchable":1,
"quickSearch":0,
"filterable":1,
"ext":""
"ext":"{{host}}/txt/hipy/bidi.jar"
},
{
"key": "hipy_t3_哔滴影视",
Expand All @@ -41,7 +41,7 @@
"searchable": 1,
"quickSearch": 0,
"filterable": 1,
"ext": ""
"ext": "{{host}}/txt/hipy/bidi.jar"
},
"""

Expand Down Expand Up @@ -103,7 +103,8 @@ def init(self, extend=""):
if ext.endswith('.jar'):
jar_path = os.path.join(os.path.dirname(__file__), './jars')
os.makedirs(jar_path, exist_ok=True)
jar_file = os.path.join(os.path.dirname(__file__), './jars/bdys.jar')
# jar_file = os.path.join(os.path.dirname(__file__), './jars/bdys.jar')
jar_file = os.path.join(os.path.dirname(__file__), './jars/bidi.jar')
jar_file = Path(jar_file).as_posix()
need_down = False
msg = ''
Expand All @@ -119,6 +120,9 @@ def init(self, extend=""):

if need_down:
self.log(msg)
if self.ENV.lower() == 't3':
# ext = ext.replace('.jar', '.dex')
pass
content = self.get_init_api(ext)
with open(jar_file, mode='wb+') as f:
f.write(content)
Expand All @@ -131,11 +135,18 @@ def init(self, extend=""):
break

if self.javar:
jar_file = os.path.join(os.path.dirname(__file__), './jars/bdys.jar')
# jar_file = os.path.join(os.path.dirname(__file__), './jars/bdys.jar')
jar_file = os.path.join(os.path.dirname(__file__), './jars/bidi.jar')
jar_file = Path(jar_file).as_posix()
self.javar.init_jar(jar_file)
self.class1 = self.javar.jClass('com.C4355b')
self.token = str(self.class1.getToken())
# self.class1 = self.javar.jClass('com.C4355b')
self.token = str(self.javar.call_java('com.EncryptionUtils', 'getToken'))
# self.class1 = self.javar.jClass('com.EncryptionUtils')
# # class1 = self.class1() # 类实例化
# class1 = self.class1
# self.token = str(class1.getToken())
# print(self.token)
# # self.token = str(self.class1.getToken())
self.headers.update({'token': self.token})

gParam['inited'] = True
Expand Down Expand Up @@ -391,14 +402,28 @@ def localProxy(self, params):
content = pdata.strip()

media_type = 'text/plain' if 'txt' in name else 'video/MP2T'

return [200, media_type, content]
action = {
'url': url,
'header': headers,
'param': '',
'type': media_type,
'after': ''
}
if '3' in self.ENV:
return [200, media_type, action, content]
else:
return [200, media_type, content]

# -----------------------------------------------自定义函数-----------------------------------------------
def decode(self, text):
bt = base64.b64decode(text)
res = self.class1.dec(bt)
return self.str2json(str(res))
# self.log(self.headers)
if self.ENV.lower() == 't3':
bt = self.javar.jarBytes(bt)
res = self.javar.call_java('com.EncryptionUtils', 'dec', bt)
# res = self.class1.dec(bt)
# print(str(res))
return self.str2json(str(res)) if res else None

def process_data(self, req_bytes):
"""
Expand All @@ -422,10 +447,10 @@ def process_data(self, req_bytes):
# spider.log('====文本内容====')
# print(spider.homeContent(True))
# print(spider.homeVideoContent())
# print(spider.categoryContent('0', 1, False, None))
print(spider.categoryContent('0', 1, False, None))
# print(spider.detailContent([24420]))
# spider.searchContent('斗罗大陆')
# print(spider.playerContent('至尊线路', 'vip://https://www.bdys03.com/api/v1/playurl/174296?type=1', None))
print(spider.playerContent('需要解析',
'https://www.bde4.cc/10E79044B82A84F70BE1308FFA5232E4DC3D0CA9EC2BF6B1D4EF56B2CE5B67CF238965CCAE17F859665B7E166720986D.m3u8',
None))
# print(spider.playerContent('需要解析',
# 'https://www.bde4.cc/10E79044B82A84F70BE1308FFA5232E4DC3D0CA9EC2BF6B1D4EF56B2CE5B67CF238965CCAE17F859665B7E166720986D.m3u8',
# None))

0 comments on commit a614069

Please sign in to comment.