Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
molin.JC
dr_py
提交
c31cb685
dr_py
项目概览
molin.JC
/
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,发现更多精彩内容 >>
提交
c31cb685
编写于
9月 03, 2022
作者:
H
hjdhnx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
踩了无数个坑并完善了360影视
上级
e6b66298
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
305 addition
and
92 deletion
+305
-92
classes/cms.py
classes/cms.py
+115
-90
js/360影视.js
js/360影视.js
+3
-1
libs/pre.js
libs/pre.js
+40
-0
py/360二级.js
py/360二级.js
+100
-0
utils/encode.py
utils/encode.py
+47
-1
未找到文件。
classes/cms.py
浏览文件 @
c31cb685
...
...
@@ -12,7 +12,7 @@ from models import *
from
utils.config
import
playerConfig
from
utils.log
import
logger
from
utils.encode
import
base64Encode
,
baseDecode
,
fetch
,
post
,
request
,
getCryptoJS
,
getPreJs
,
buildUrl
,
getHome
from
utils.encode
import
verifyCode
from
utils.encode
import
verifyCode
,
setDetail
,
join
,
urljoin2
from
utils.safePython
import
safePython
from
utils.parser
import
runPy
,
runJScode
,
JsObjectWrapper
from
utils.htmlParser
import
jsoup
...
...
@@ -24,7 +24,7 @@ from easydict import EasyDict as edict
py_ctx
=
{
'requests'
:
requests
,
'print'
:
print
,
'base64Encode'
:
base64Encode
,
'baseDecode'
:
baseDecode
,
'log'
:
logger
.
info
,
'fetch'
:
fetch
,
'post'
:
post
,
'request'
:
request
,
'getCryptoJS'
:
getCryptoJS
,
'buildUrl'
:
buildUrl
,
'getHome'
:
getHome
'buildUrl'
:
buildUrl
,
'getHome'
:
getHome
,
'setDetail'
:
setDetail
,
'join'
:
join
,
'urljoin2'
:
urljoin2
}
# print(getCryptoJS())
...
...
@@ -569,18 +569,43 @@ class CMS:
if
p
==
'*'
:
vod
=
self
.
blank_vod
()
vod
[
'vod_play_from'
]
=
'道长在线'
vod
[
'
desc
'
]
=
self
.
play_url
+
detailUrl
vod
[
'
vod_remarks
'
]
=
self
.
play_url
+
detailUrl
vod
[
'vod_actor'
]
=
'没有二级,只有一级链接直接嗅探播放'
vod
[
'content'
]
=
detailUrl
vod
[
'
vod_
content'
]
=
detailUrl
vod
[
'vod_play_url'
]
=
'嗅探播放$'
+
detailUrl
return
vod
if
not
isinstance
(
p
,
dict
):
if
not
isinstance
(
p
,
dict
)
and
not
isinstance
(
p
,
str
)
and
not
str
(
p
).
startswith
(
'js:'
)
:
return
vod
jsp
=
jsoup
(
self
.
url
)
is_json
=
p
.
get
(
'is_json'
,
False
)
# 二级里加is_json参数
is_json
=
p
.
get
(
'is_json'
,
False
)
if
isinstance
(
p
,
dict
)
else
False
# 二级里加is_json参数
is_js
=
isinstance
(
p
,
str
)
and
str
(
p
).
startswith
(
'js:'
)
# 是js
if
is_js
:
headers
[
'Referer'
]
=
getHome
(
url
)
py_ctx
.
update
({
'input'
:
url
,
'fetch_params'
:
{
'headers'
:
headers
,
'timeout'
:
self
.
d
.
timeout
,
'encoding'
:
self
.
d
.
encoding
},
'd'
:
self
.
d
,
'getParse'
:
self
.
d
.
getParse
,
'saveParse'
:
self
.
d
.
saveParse
,
'jsp'
:
jsp
,
'setDetail'
:
setDetail
,
})
ctx
=
py_ctx
# print(ctx)
jscode
=
getPreJs
()
+
p
.
replace
(
'js:'
,
''
,
1
)
# print(jscode)
loader
,
_
=
runJScode
(
jscode
,
ctx
=
ctx
)
# print(loader.toString())
vod
=
loader
.
eval
(
'vod'
)
if
isinstance
(
vod
,
JsObjectWrapper
):
vod
=
vod
.
to_dict
()
else
:
vod
=
{}
# print(type(vod))
# print(vod)
else
:
pdfh
=
jsp
.
pjfh
if
is_json
else
jsp
.
pdfh
pdfa
=
jsp
.
pjfa
if
is_json
else
jsp
.
pdfa
pd
=
jsp
.
pj
if
is_json
else
jsp
.
pd
...
...
js/360影视.js
浏览文件 @
c31cb685
...
...
@@ -19,7 +19,8 @@ var rule = {
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
'
,
推荐
:
'
json:data;title;cover;comment;cat+ent_id;description
'
,
一级
:
'
json:data.movies;title;cover;pubdate;id;description
'
,
二级
:{
is_json
:
1
,
"
title
"
:
"
data.title;data.moviecategory[0]+data.moviecategory[1]
"
,
"
img
"
:
"
data.cdncover
"
,
"
desc
"
:
"
data.area[0];data.director[0]
"
,
"
content
"
:
"
data.description
"
,
"
tabs
"
:
"
data.playlink_sites;data.playlinksdetail.#idv.quality
"
,
"
lists
"
:
"
data.playlinksdetail.#idv.default_url
"
},
//
二级:{is_json:1,"title":"data.title;data.moviecategory[0]+data.moviecategory[1]","img":"data.cdncover","desc":"data.area[0];data.director[0]","content":"data.description","tabs":"data.playlink_sites;data.playlinksdetail.#idv.quality","lists":"data.playlinksdetail.#idv.default_url"},
// 二级:{is_json:1,"title":"data.title;data.moviecategory[0]+data.moviecategory[1]","img":"data.cdncover","desc":"data.area[0];data.director[0]","content":"data.description","tabs":"data.playlink_sites","lists":"data.playlinksdetail.#idv.default_url"},
二级
:
'
js:let html=JSON.parse(fetch(input,fetch_params));let data=html.data;let tilte=data.title;let img=data.cdncover;let vod_type=data.moviecategory.join(",");let area=data.area.join(",");let director=data.director.join(",");let actor=data.actor.join(",");let content=data.description;base_vod={vod_id:input,vod_name:tilte,type_name:vod_type,vod_actor:actor,vod_director:director,vod_content:content,vod_remarks:area,vod_pic:urljoin2(input,img)};let delta=200;let vod_play={};let sites=data.playlink_sites;for(let i in sites){let site=sites[i];let playList="";let vodItems=[];if(data.allupinfo){let total=parseInt(data.allupinfo[site]);for(let j=1;j<total;j+=delta){let end=Math.min(total,j+delta-1);let url2=buildUrl(input,{start:j,end:end,site:site});let vod_data=JSON.parse(fetch(url2),fetch_params).data;if(vod_data.allepidetail){vod_data=vod_data.allepidetail[site];vod_data.forEach(function(item,index){vodItems.push((item.playlink_num||"")+"$"+(item.url||""))})}else{vod_data=vod_data.defaultepisode;vod_data.forEach(function(item,index){vodItems.push((item.period||"")+(item.name||"")+"$"+item.url||"")})}}}else{let item=data.playlinksdetail[site];vodItems.push((item.sort||"")+"$"+(item.default_url||""))}if(vodItems.length>0){playList=vodItems.join("#")}if(playList.length<1){continue}vod_play[site]=playList}let tabs=Object.keys(vod_play);let playUrls=[];for(let id in tabs){playUrls.push(vod_play[tabs[id]])}if(tabs.length>0){vod_play_from=tabs.join("$$$");vod_play_url=playUrls.join("$$$");base_vod.vod_play_from=vod_play_from;base_vod.vod_play_url=vod_play_url}vod=base_vod;
'
,
搜索
:
'
json:data.longData.rows;titleTxt;cover;score;cat_id+id;description
'
,
}
\ No newline at end of file
libs/pre.js
浏览文件 @
c31cb685
Object
.
assign
=
function
()
{
var
target
=
arguments
[
0
];
for
(
var
i
=
1
;
i
<
arguments
.
length
;
i
++
)
{
var
source
=
arguments
[
i
];
for
(
var
key
in
source
)
{
if
(
Object
.
prototype
.
hasOwnProperty
.
call
(
source
,
key
))
{
target
[
key
]
=
source
[
key
];
}
}
}
return
target
;
};
Object
.
prototype
.
myValues
=
function
(
obj
){
if
(
obj
==
null
)
{
throw
new
TypeError
(
"
Cannot convert undefined or null to object
"
);
}
var
res
=
[]
for
(
var
k
in
obj
){
if
(
obj
.
hasOwnProperty
(
k
)){
//需判断是否是本身的属性
res
.
push
(
obj
[
k
]);
}
}
return
res
;
}
Array
.
prototype
.
join
=
function
(
emoji
)
{
emoji
=
emoji
||
'
,
'
;
let
self
=
this
;
let
str
=
""
;
let
i
=
0
;
if
(
!
Array
.
isArray
(
self
))
{
throw
String
(
self
)
+
'
is not Array
'
}
if
(
self
.
length
===
0
){
return
''
}
if
(
self
.
length
===
1
){
return
String
(
self
[
0
])}
i
=
1
;
str
=
this
[
0
];
for
(;
i
<
self
.
length
;
i
++
)
{
str
+=
String
(
emoji
)
+
String
(
self
[
i
]);
}
return
str
;
};
// 千万不要用for in 推荐 forEach (for in 会打乱顺序)
//猫函数
function
maoss
(
jxurl
,
ref
,
key
)
{
eval
(
getCryptoJS
());
...
...
py/360二级.js
0 → 100644
浏览文件 @
c31cb685
js
:
// 请不要在里面使用单引号
// let html = fetch(input,fetch_params);
let
html
=
JSON
.
parse
(
fetch
(
input
,
fetch_params
));
let
data
=
html
.
data
;
// let tilte = jsp.pjfh(html,"data.title");
let
tilte
=
data
.
title
;
// let img = jsp.pj(html,"data.cdncover");
let
img
=
data
.
cdncover
;
// let vod_type = jsp.pjfa(html,"data.moviecategory").join(",");
let
vod_type
=
data
.
moviecategory
.
join
(
"
,
"
);
// let area = jsp.pjfa(html,"data.area").join(",");
let
area
=
data
.
area
.
join
(
"
,
"
);
// let director = jsp.pjfa(html,"data.director").join(",");
let
director
=
data
.
director
.
join
(
"
,
"
);
// let actor = jsp.pjfa(html,"data.actor").join(",");
let
actor
=
data
.
actor
.
join
(
"
,
"
);
// let content = jsp.pjfh(html,"data.description");
let
content
=
data
.
description
;
base_vod
=
{
vod_id
:
input
,
vod_name
:
tilte
,
type_name
:
vod_type
,
vod_actor
:
actor
,
vod_director
:
director
,
vod_content
:
content
,
vod_remarks
:
area
,
vod_pic
:
urljoin2
(
input
,
img
),
// vod_pic:img,
};
// print(base_vod);
let
delta
=
200
;
let
vod_play
=
{};
// let sites = jsp.pjfa(html,"data.playlink_sites"); //data.playlinksdetail.#idv.quality
let
sites
=
data
.
playlink_sites
;
//data.playlinksdetail.#idv.quality
// print(sites);
for
(
let
i
in
sites
){
let
site
=
sites
[
i
];
let
playList
=
""
;
let
vodItems
=
[];
if
(
data
.
allupinfo
){
let
total
=
parseInt
(
data
.
allupinfo
[
site
]);
// print('total:'+String(total));
for
(
let
j
=
1
;
j
<
total
;
j
+=
delta
){
let
end
=
Math
.
min
(
total
,
j
+
delta
-
1
);
let
url2
=
buildUrl
(
input
,{
"
start
"
:
j
,
"
end
"
:
end
,
"
site
"
:
site
});
// print(url2);
let
vod_data
=
JSON
.
parse
(
fetch
(
url2
),
fetch_params
).
data
;
if
(
vod_data
.
allepidetail
){
//电视剧或者动漫
vod_data
=
vod_data
.
allepidetail
[
site
];
vod_data
.
forEach
(
function
(
item
,
index
)
{
vodItems
.
push
((
item
.
playlink_num
||
""
)
+
"
$
"
+
(
item
.
url
||
""
));
});
}
else
{
// 综艺
vod_data
=
vod_data
.
defaultepisode
;
vod_data
.
forEach
(
function
(
item
,
index
)
{
vodItems
.
push
((
item
.
period
||
""
)
+
(
item
.
name
||
""
)
+
"
$
"
+
item
.
url
||
""
);
});
}
}
}
else
{
let
item
=
data
.
playlinksdetail
[
site
];
// print(item);
vodItems
.
push
((
item
.
sort
||
""
)
+
"
$
"
+
(
item
.
default_url
||
""
));
}
if
(
vodItems
.
length
>
0
){
playList
=
vodItems
.
join
(
"
#
"
);
}
// print(playList);
if
(
playList
.
length
<
1
){
continue
}
vod_play
[
site
]
=
playList
;
}
// print(vod_play);
let
tabs
=
Object
.
keys
(
vod_play
);
// let playUrls = Object.values(vod_play); // 没法使用values方法和列表的join方法
let
playUrls
=
[];
for
(
let
id
in
tabs
){
playUrls
.
push
(
vod_play
[
tabs
[
id
]]);
}
// print(tabs);
// print(playUrls);
if
(
tabs
.
length
>
0
){
// vod_play_from = join(tabs,"$$$");
vod_play_from
=
tabs
.
join
(
"
$$$
"
);
// vod_play_url = join(playUrls,"$$$");
vod_play_url
=
playUrls
.
join
(
"
$$$
"
);
// print(vod_play_from);
// print(vod_play_url);
base_vod
.
vod_play_from
=
vod_play_from
;
base_vod
.
vod_play_url
=
vod_play_url
;
}
vod
=
base_vod
;
// print(vod);
\ No newline at end of file
utils/encode.py
浏览文件 @
c31cb685
...
...
@@ -5,6 +5,8 @@
# Date : 2022/8/29
import
base64
from
urllib.parse
import
urljoin
import
requests
import
requests.utils
from
time
import
sleep
...
...
@@ -85,6 +87,48 @@ def base64Encode(text):
def
baseDecode
(
text
):
return
base64
.
b64decode
(
text
).
decode
(
"utf-8"
)
#base64解码
def
setDetail
(
title
:
str
,
img
:
str
,
desc
:
str
,
content
:
str
,
tabs
:
list
=
None
,
lists
:
list
=
None
):
vod
=
{
"vod_name"
:
title
.
split
(
'/n'
)[
0
],
"vod_pic"
:
img
,
"type_name"
:
title
,
"vod_year"
:
""
,
"vod_area"
:
""
,
"vod_remarks"
:
desc
,
"vod_actor"
:
""
,
"vod_director"
:
""
,
"vod_content"
:
content
}
return
vod
def
urljoin2
(
a
,
b
):
a
=
str
(
a
).
replace
(
"'"
,
''
).
replace
(
'"'
,
''
)
b
=
str
(
b
).
replace
(
"'"
,
''
).
replace
(
'"'
,
''
)
# print(type(a),a)
# print(type(b),b)
ret
=
urljoin
(
a
,
b
)
return
ret
def
join
(
lists
,
string
):
"""
残废函数,没法使用
:param lists:
:param string:
:return:
"""
# FIXME
lists1
=
lists
.
to_list
()
string1
=
str
(
string
)
print
(
type
(
lists1
),
lists1
)
print
(
type
(
string1
),
string1
)
try
:
ret
=
string1
.
join
(
lists1
)
print
(
ret
)
return
ret
except
Exception
as
e
:
print
(
e
)
return
''
def
dealObj
(
obj
=
None
):
if
not
obj
:
obj
=
{}
...
...
@@ -165,9 +209,11 @@ def buildUrl(url,obj=None):
new_obj
=
{}
for
i
in
obj
:
new_obj
[
str
(
i
).
replace
(
"'"
,
""
)]
=
str
(
obj
[
i
]).
replace
(
"'"
,
""
)
if
not
str
(
url
).
endswith
(
'?'
)
:
if
str
(
url
).
find
(
'?'
)
<
0
:
url
=
str
(
url
)
+
'?'
prs
=
'&'
.
join
([
f
'
{
i
}
=
{
obj
[
i
]
}
'
for
i
in
obj
])
if
len
(
new_obj
)
>
0
:
url
+=
'&'
url
=
(
url
+
prs
).
replace
(
'"'
,
''
).
replace
(
"'"
,
''
)
# print(url)
return
url
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录