Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
没毛的刷子
dr_py
提交
8a908824
dr_py
项目概览
没毛的刷子
/
dr_py
与 Fork 源项目一致
Fork自
晚风拂柳颜 / dr_py
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
dr_py
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8a908824
编写于
9月 11, 2022
作者:
H
hjdhnx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
解决菜狗的重定向链接问题
上级
281e589a
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
32 addition
and
15 deletion
+32
-15
controllers/cms.py
controllers/cms.py
+6
-4
js/菜狗.js
js/菜狗.js
+3
-2
py/搜狗二级.js
py/搜狗二级.js
+5
-4
py/搜狗免嗅.js
py/搜狗免嗅.js
+11
-0
utils/encode.py
utils/encode.py
+6
-4
utils/parser.py
utils/parser.py
+1
-1
未找到文件。
controllers/cms.py
浏览文件 @
8a908824
...
...
@@ -1060,10 +1060,12 @@ class CMS:
# 注意:全局flags里的视频没法执行免嗅代码,因为会自动拦截去调用解析: url=yoursite:5705/vod?play_url=xxxx
if
not
jxs
:
jxs
=
[]
try
:
play_url
=
baseDecode
(
play_url
)
# 自动base64解码
except
:
pass
# print(play_url)
if
play_url
.
find
(
'http'
)
==
-
1
:
# 字符串看起来被编码的
try
:
play_url
=
baseDecode
(
play_url
)
# 自动base64解码
except
:
pass
if
self
.
lazy
:
print
(
f
'
{
play_url
}
->开始执行免嗅代码
{
type
(
self
.
lazy
)
}
->
{
self
.
lazy
}
'
)
t1
=
time
()
...
...
js/菜狗.js
浏览文件 @
8a908824
...
...
@@ -19,11 +19,11 @@ var rule = {
play_parse
:
true
,
// 手动调用解析请求json的url,此lazy不方便
// lazy:'js:input="https://cache.json.icu/home/api?type=ys&uid=292796&key=fnoryABDEFJNPQV269&url="+input.split("?")[0];log(input);let html=JSON.parse(request(input));log(html);input=html.url||input',
lazy
:
'
js:fetch_params.
withHeaders = 1;let data=fetch(input,fetch_params);log(input);log(data)
;
'
,
lazy
:
'
js:fetch_params.
headers["user-agent"]=MOBILE_UA;let html=request(input);let rurl=html.match(/window
\\
.open
\\
(
\'
(.*?)
\'
,/)[1].split("?")[0];input=rurl
;
'
,
// 推荐:'.list_item;img&&alt;img&&src;a&&Text;a&&data-float',
一级
:
'
js:let d=[];let html=request(input);html=JSON.parse(html);let list=html.listData.results;list.forEach(function(it){let desc1=it.ipad_play_for_list.finish_episode?it.ipad_play_for_list.episode===it.ipad_play_for_list.finish_episode?"全集"+it.ipad_play_for_list.finish_episode:"连载"+it.ipad_play_for_list.episode+"/"+it.ipad_play_for_list.finish_episode:"";let desc2=it.score?"评分:"+it.score:"";let desc3=it.date?"更至:"+it.date:"";d.push({title:it.name,img:it.v_picurl,url:"https://v.sogou.com"+it.url.replace("teleplay","series").replace("cartoon","series"),desc:desc1||desc2||desc3})});setResult(d);
'
,
二级
:
''
,
二级
:
'
js:var vod={vod_id:input};let html=request(input);try{let json=JSON.parse(html.match(/INITIAL_STATE.*?({.*});/)[1]).detail.itemData;let key=json.dockey;let name=json.name;let zone=json.zone;let score=json.score?json.score:"暂无";let style=json.style;let emcee=json.emcee?"主持:"+json.emcee:json.name;let director=json.director?"导演:"+json.director:name;director=director.replace(/;/g,"
\\
t");let starring=json.starring?"演员:"+json.starring:"声优:"+json.shengyou;starring=starring.replace(/.*undefined/,"").replace(/;/g,"
\\
t");let update=json.update_wordstr?json.update_wordstr:"";let tv_station=json.tv_station?json.tv_station:zone;let introduction=json.introduction;let shengyou=json.shengyou;let shows=json.play_from_open_index;let plays=json.play.item_list;if(shows){vod.vod_name=name;vod.vod_area=emcee+","+tv_station;vod.vod_director=director;vod.vod_actor=starring;vod.vod_pic=jsp.pd(html,"#thumb_img&&img&&src");vod.vod_remarks=style+" 评分:"+score+","+update;vod.vod_content=introduction}else{vod.vod_name=name;vod.vod_director=director;vod.vod_actor=starring;vod.vod_pic=jsp.pd(html,"#thumb_img&&img&&src");vod.vod_content=introduction}try{let tabs=[];let lists=[];plays.forEach(function(it){lists.push(it.info);let tbn=it.sitename[0]||it.site.replace(".com","");tbn=tbn.split("").join(" ");tabs.push(tbn)});vod.vod_play_from=tabs.join("$$$");vod_lists=[];lists.forEach(function(item,idex){if(item||shows){if(item&&Array.isArray(item)&&item.length>1){let tmp=item.slice(1).map(function(its){return its.index+"$"+play_url+
"https://v.sogou.com"+its.url});vod_lists.push(tmp.join("#"))}if(shows){let arr=[];let tmp=[];let zy=shows.item_list[idex];zy.date.forEach(function(date){let day=date.day;for(let j=0;j<day.length;j++){let dayy=day[j][0]>=10?day[j][0]:"0"+day[j][0];let Tdate=date.year+date.month+dayy;arr.push(Tdate)}});for(let k=0;k<arr.length;k++){let url="https://v.sogou.com/vc/eplay?query="+arr[k]+"&date="+arr[k]+"&key="+key+"&st=5&tvsite="+plays[idex].site;tmp.push("第"+arr[k]+"期"+"$"+play_url+"https://v.sogou.com"+url)}vod_lists.push(tmp.join("#"))}}else if(plays[idex].site){let tmp=[];if(!plays[idex].flag_list.includes("trailer")){tmp.push(plays[idex].sitename[0]+"$"+play_url+"https://v.sogou.com"+plays[idex].url)}else{tmp.push(plays[idex].sitename[0]+"—预告"+"$"+play_url+"https://v.sogou.com"+plays[idex].url
)}vod_lists.push(tmp.join("#"))}});vod.vod_play_url=vod_lists.join("$$$")}catch(e){let img=json.photo.item_list;vod.vod_name="本片无选集";vod.vod_pic=img.length>0?img[0]:""}}catch(e){}
'
,
二级
:
'
js:var vod={vod_id:input};let html=request(input);try{let json=JSON.parse(html.match(/INITIAL_STATE.*?({.*});/)[1]).detail.itemData;let key=json.dockey;let name=json.name;let zone=json.zone;let score=json.score?json.score:"暂无";let style=json.style;let emcee=json.emcee?"主持:"+json.emcee:json.name;let director=json.director?"导演:"+json.director:name;director=director.replace(/;/g,"
\\
t");let starring=json.starring?"演员:"+json.starring:"声优:"+json.shengyou;starring=starring.replace(/.*undefined/,"").replace(/;/g,"
\\
t");let update=json.update_wordstr?json.update_wordstr:"";let tv_station=json.tv_station?json.tv_station:zone;let introduction=json.introduction;let shengyou=json.shengyou;let shows=json.play_from_open_index;let plays=json.play.item_list;if(shows){vod.vod_name=name;vod.vod_area=emcee+","+tv_station;vod.vod_director=director;vod.vod_actor=starring;vod.vod_pic=jsp.pd(html,"#thumb_img&&img&&src");vod.vod_remarks=style+" 评分:"+score+","+update;vod.vod_content=introduction}else{vod.vod_name=name;vod.vod_director=director;vod.vod_actor=starring;vod.vod_pic=jsp.pd(html,"#thumb_img&&img&&src");vod.vod_content=introduction}try{let tabs=[];let lists=[];plays.forEach(function(it){lists.push(it.info);let tbn=it.sitename[0]||it.site.replace(".com","");tbn=tbn.split("").join(" ");tabs.push(tbn)});vod.vod_play_from=tabs.join("$$$");vod_lists=[];lists.forEach(function(item,idex){if(item||shows){if(item&&Array.isArray(item)&&item.length>1){let tmp=item.slice(1).map(function(its){return its.index+"$"+play_url+
base64Encode("https://v.sogou.com"+its.url)});vod_lists.push(tmp.join("#"))}if(shows){let arr=[];let tmp=[];let zy=shows.item_list[idex];zy.date.forEach(function(date){let day=date.day;for(let j=0;j<day.length;j++){let dayy=day[j][0]>=10?day[j][0]:"0"+day[j][0];let Tdate=date.year+date.month+dayy;arr.push(Tdate)}});for(let k=0;k<arr.length;k++){let url="https://v.sogou.com/vc/eplay?query="+arr[k]+"&date="+arr[k]+"&key="+key+"&st=5&tvsite="+plays[idex].site;tmp.push("第"+arr[k]+"期"+"$"+play_url+base64Encode("https://v.sogou.com"+url))}vod_lists.push(tmp.join("#"))}}else if(plays[idex].site){let tmp=[];if(!plays[idex].flag_list.includes("trailer")){tmp.push(plays[idex].sitename[0]+"$"+play_url+base64Encode("https://v.sogou.com"+plays[idex].url))}else{tmp.push(plays[idex].sitename[0]+"—预告"+"$"+play_url+base64Encode("https://v.sogou.com"+plays[idex].url)
)}vod_lists.push(tmp.join("#"))}});vod.vod_play_url=vod_lists.join("$$$")}catch(e){let img=json.photo.item_list;vod.vod_name="本片无选集";vod.vod_pic=img.length>0?img[0]:""}}catch(e){}
'
,
搜索
:
''
,
搜索
:
'
js:let d=[];let html=request(input);let jsonA=JSON.parse(html.match(/INITIAL_STATE.*?({.*});/)[1]).result.longVideo.results;jsonA.forEach(function(it){let name=it.name;let introduction=it.introduction;let pic=it.v_picurl;let url=it.tiny_url;let zone=it.zone;let score=it.score||"暂无";let style=it.style;if(it.play.item_list){let r={};r.title=name.replace(//,"").replace(//,"");r.url="https://v.sogou.com"+url;r.desc=it.list_category.join(",");r.content=introduction;r.pic_url=pic;d.push(r)}});setResult(d);
'
,
}
\ No newline at end of file
py/搜狗二级.js
浏览文件 @
8a908824
...
...
@@ -55,7 +55,8 @@ try {
lists
.
forEach
(
function
(
item
,
idex
){
// item是个json列表
if
(
item
||
shows
)
{
// 动漫,电视剧
if
(
item
&&
Array
.
isArray
(
item
)
&&
item
.
length
>
1
){
let
tmp
=
item
.
slice
(
1
).
map
(
function
(
its
){
return
its
.
index
+
'
$
'
+
play_url
+
'
https://v.sogou.com
'
+
its
.
url
});
// let tmp = item.slice(1).map(function (its){return its.index+'$'+play_url+'https://v.sogou.com'+its.url});
let
tmp
=
item
.
slice
(
1
).
map
(
function
(
its
){
return
its
.
index
+
'
$
'
+
play_url
+
base64Encode
(
'
https://v.sogou.com
'
+
its
.
url
)});
vod_lists
.
push
(
tmp
.
join
(
'
#
'
));
}
if
(
shows
)
{
//综艺,纪录片
...
...
@@ -73,7 +74,7 @@ try {
for
(
let
k
=
0
;
k
<
arr
.
length
;
k
++
)
{
let
url
=
"
https://v.sogou.com/vc/eplay?query=
"
+
arr
[
k
]
+
"
&date=
"
+
arr
[
k
]
+
"
&key=
"
+
key
+
"
&st=5&tvsite=
"
+
plays
[
idex
].
site
;
tmp
.
push
(
"
第
"
+
arr
[
k
]
+
"
期
"
+
'
$
'
+
play_url
+
'
https://v.sogou.com
'
+
url
);
tmp
.
push
(
"
第
"
+
arr
[
k
]
+
"
期
"
+
'
$
'
+
play_url
+
base64Encode
(
'
https://v.sogou.com
'
+
url
)
);
}
vod_lists
.
push
(
tmp
.
join
(
'
#
'
));
}
...
...
@@ -81,9 +82,9 @@ try {
// print(plays[idex].site);
let
tmp
=
[];
if
(
!
plays
[
idex
].
flag_list
.
includes
(
'
trailer
'
))
{
tmp
.
push
(
plays
[
idex
].
sitename
[
0
]
+
'
$
'
+
play_url
+
'
https://v.sogou.com
'
+
plays
[
idex
].
url
);
tmp
.
push
(
plays
[
idex
].
sitename
[
0
]
+
'
$
'
+
play_url
+
base64Encode
(
'
https://v.sogou.com
'
+
plays
[
idex
].
url
)
);
}
else
{
tmp
.
push
(
plays
[
idex
].
sitename
[
0
]
+
'
—预告
'
+
'
$
'
+
play_url
+
"
https://v.sogou.com
"
+
plays
[
idex
].
url
);
tmp
.
push
(
plays
[
idex
].
sitename
[
0
]
+
'
—预告
'
+
'
$
'
+
play_url
+
base64Encode
(
"
https://v.sogou.com
"
+
plays
[
idex
].
url
)
);
}
vod_lists
.
push
(
tmp
.
join
(
'
#
'
));
}
...
...
py/搜狗免嗅.js
0 → 100644
浏览文件 @
8a908824
js
:
// fetch_params.withHeaders = 1;
// let data=fetch(input,fetch_params);
// let html = data.body;
fetch_params
.
headers
[
'
user-agent
'
]
=
MOBILE_UA
;
let
html
=
request
(
input
);
let
rurl
=
html
.
match
(
/window
\.
open
\(
'
(
.*
?)
',/
)[
1
].
split
(
'
?
'
)[
0
];
// print(input);
// print(rurl);
input
=
rurl
;
// print(html);
utils/encode.py
浏览文件 @
8a908824
...
...
@@ -6,7 +6,7 @@
import
base64
from
urllib.parse
import
urljoin
from
js2py.base
import
PyJsString
import
requests
,
warnings
# 关闭警告
warnings
.
filterwarnings
(
"ignore"
)
...
...
@@ -88,6 +88,8 @@ def verifyCode(url,headers,timeout=5,total_cnt=3,api=None):
return
''
def
base64Encode
(
text
):
if
isinstance
(
text
,
PyJsString
):
text
=
str
(
text
).
replace
(
"'"
,
""
).
replace
(
'"'
,
''
)
return
base64
.
b64encode
(
text
.
encode
(
"utf8"
)).
decode
(
"utf-8"
)
#base64编码
def
baseDecode
(
text
):
...
...
@@ -174,7 +176,7 @@ def base_request(url,obj):
url
=
str
(
url
).
replace
(
"'"
,
""
)
method
=
obj
.
get
(
'method'
)
or
''
withHeaders
=
obj
.
get
(
'withHeaders'
)
or
''
print
(
f
'withHeaders:
{
withHeaders
}
'
)
#
print(f'withHeaders:{withHeaders}')
if
not
method
:
method
=
'get'
obj
[
'method'
]
=
'method'
...
...
@@ -206,7 +208,7 @@ def base_request(url,obj):
def
fetch
(
url
,
obj
):
obj
=
dealObj
(
obj
)
if
not
obj
.
get
(
'headers'
)
or
not
obj
[
'headers'
].
get
(
'User-Agent'
):
if
not
obj
.
get
(
'headers'
)
or
not
any
([
obj
[
'headers'
].
get
(
'User-Agent'
),
obj
[
'headers'
].
get
(
'user-agent'
)]
):
obj
[
'headers'
][
'User-Agent'
]
=
obj
[
'headers'
].
get
(
'user-agent'
,
PC_UA
)
return
base_request
(
url
,
obj
)
...
...
@@ -218,7 +220,7 @@ def post(url,obj):
def
request
(
url
,
obj
):
obj
=
dealObj
(
obj
)
# print(f'{method}:{url}')
if
not
obj
.
get
(
'headers'
)
or
not
obj
[
'headers'
].
get
(
'User-Agent'
):
if
not
obj
.
get
(
'headers'
)
or
not
any
([
obj
[
'headers'
].
get
(
'User-Agent'
),
obj
[
'headers'
].
get
(
'user-agent'
)]
):
obj
[
'headers'
][
'User-Agent'
]
=
obj
[
'headers'
].
get
(
'user-agent'
,
UC_UA
)
return
base_request
(
url
,
obj
)
...
...
utils/parser.py
浏览文件 @
8a908824
...
...
@@ -14,7 +14,7 @@ subprocess.Popen = partial(subprocess.Popen, encoding="utf-8") # 固定写法
# 解决execjs执行js时产生的乱码报错,需要在导入该模块之前,让Popen的encoding参数锁定为utf-8
# import execjs
import
js2py
from
js2py.base
import
JsObjectWrapper
from
js2py.base
import
JsObjectWrapper
,
PyJsString
# os.environ["EXECJS_RUNTIME"] = "JScript"
# print(execjs.get().name)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录