Skip to content

Commit

Permalink
完善辅助嗅探和本地代理
Browse files Browse the repository at this point in the history
  • Loading branch information
hjdhnx committed Jan 13, 2024
1 parent 0d692cd commit 80d8ec0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion js/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.9.49beta23
3.9.49beta24
18 changes: 18 additions & 0 deletions txt/hipy/两个BT.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ def init_file(ext_file):
self.module = lib
break

def isVideo(self):
"""
返回是否为视频的匹配字符串
@return: None空 reg:正则表达式 js:input js代码
"""
# return 'js:input.includes("https://zf.13to.com/")?true:false'
return 'reg:zf\.13to\.com'

def isVideoFormat(self, url):
pass

Expand Down Expand Up @@ -385,6 +393,16 @@ def playerContent(self, flag, id, vipFlags):
@param vipFlags: vip标识
@return:
"""
headers = {
'User-Agent': 'Mozilla/5.0 (Linux;; Android 11;; M2007J3SC Build/RKQ1.200826.002;; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/99.0.4844.48 Mobile Safari/537.36',
'Referer': id,
}
return {
'parse': 1, # 1=嗅探,0=播放
'playUrl': '', # 解析链接
'url': id, # 直链或待嗅探地址
'header': headers, # 播放UA
}
r = self.fetch(id)
html = r.text
text = html.split('window.wp_nonce=')[1].split('eval')[0]
Expand Down
11 changes: 1 addition & 10 deletions txt/hipy/哔滴影视.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,16 +414,7 @@ def localProxy(self, params):
content = pdata.strip()

media_type = 'text/plain' if 'txt' in name else 'video/MP2T'
action = {
'url': url,
'header': headers,
'param': '',
'type': media_type,
}
if '3' in self.ENV:
return [200, media_type, action, content]
else:
return [200, media_type, content]
return [200, media_type, content]

# -----------------------------------------------自定义函数-----------------------------------------------
def decode(self, text):
Expand Down

0 comments on commit 80d8ec0

Please sign in to comment.