提交 b7e01278 编写于 作者: H hjdhnx

更新了api

上级 2e3bd1f5
无法预览此类型文件
......@@ -882,8 +882,13 @@ class CMS:
# print(result)
# print(result['pagecount'])
logger.info(f'{self.getName()}获取分类{fyclass}{fypage}页耗时:{get_interval(t1)}毫秒,共计{round(len(str(result)) / 1000, 2)} kb')
return result
nodata = {
'list': [{'vod_name': '无数据,防无限请求', 'vod_id': 'no_data', 'vod_remarks': '不要点,会崩的',
'vod_pic': 'https://ghproxy.com/https://raw.githubusercontent.com/hjdhnx/dr_py/main/404.jpg'}],
'total': 1, 'pagecount': 1, 'page': 1, 'limit': 1
}
# return result
return result if len(result['list']) > 0 else nodata
def 二级渲染(self,parse_str:'str|dict',**kwargs):
# *args是不定长参数 列表
......
3.9.28
\ No newline at end of file
3.9.28beta1
\ No newline at end of file
......@@ -2,6 +2,7 @@ var rule = {
title:'哔哩影视',
host:'https://api.bilibili.com',
url:'/fyclass-fypage',
filter_url:'fl={{fl}}',
searchUrl:'/index.php?m=vod-search#wd=**&search=;post',
searchable:1,
filterable:1,
......@@ -21,7 +22,7 @@ var rule = {
推荐:'',
double:true, // 推荐内容是否双层定位
一级:'',
一级:'js:let d=[];function get_result(url){let result={};let html=request(url);let jo=JSON.parse(html);if(jo["code"]===0){let videos=[];let vodList=jo.result?jo.result.list:jo.data.list;vodList.forEach(function(vod){let aid=(vod["season_id"]+"").trim();let title=vod["title"].trim();let img=vod["cover"].trim();let remark=vod["new_ep"]["index_show"];videos.push({vod_id:aid,vod_name:title,vod_pic:img,vod_remarks:remark})});result["list"]=videos;result["page"]=1;result["pagecount"]=1;result["limit"]=90;result["total"]=999999}return result}function get_rank(tid,pg){return get_result("https://api.bilibili.com/pgc/web/rank/list?season_type="+tid+"&pagesize=20&page="+pg+"&day=3")}function get_rank2(tid,pg){return get_result("https://api.bilibili.com/pgc/season/rank/web/list?season_type="+tid+"&pagesize=20&page="+pg+"&day=3")}function get_zhui(pg,mode){let url="https://api.bilibili.com/x/space/bangumi/follow/list?type="+mode+"&follow_status=0&pn="+pg+"&ps=10&vmid="+getItem("userid","");return get_result(url)}function get_all(tid,pg,order,season_status){let url="https://api.bilibili.com/pgc/season/index/result?order="+order+"&pagesize=20&type=1&season_type="+tid+"&page="+pg+"&season_status="+season_status;return get_result(url)}function get_timeline(tid,pg){let result={};let url="https://api.bilibili.com/pgc/web/timeline/v2?season_type="+tid+"&day_before=2&day_after=4";let html=request(url);let jo=JSON.parse(html);if(jo["code"]===0){let videos1=[];let vodList=jo.result.latest;vodList.forEach(function(vod){let aid=(vod["season_id"]+"").trim();let title=vod["title"].trim();let img=vod["cover"].trim();let remark=vod["pub_index"]+" "+vod["follows"].replace("系列","");videos.push({vod_id:aid,vod_name:title,vod_pic:img,vod_remarks:remark})});let videos2=[];for(let i=0;i<7;i++){let vodList=jo["result"]["timeline"][i]["episodes"];vodList.forEach(function(vod){if(vod["published"]+""==="0"){let aid=(vod["season_id"]+"").trim();let title=vod["title"].trim();let img=vod["cover"].trim();let date=vod["pub_ts"];let remark=date+" "+vod["pub_index"];videos2.push({vod_id:aid,vod_name:title,vod_pic:img,vod_remarks:remark})}})}result["list"]=videos2.concat(videos1);result["page"]=1;result["pagecount"]=1;result["limit"]=90;result["total"]=999999}return result}function cate_filter(d,cookie){if(MY_CATE==="1"){return get_rank(MY_CATE,MY_PAGE)}else if(["2","3","4","5","7"].includes(MY_CATE)){return get_rank2(MY_CATE,MY_PAGE)}else if(MY_CATE==="全部"){let tid=MY_FL.tid||"1";let order=MY_FL.order||"2";let season_status=MY_FL.season_status||"-1";return get_all(tid,MY_PAGE,order,season_status)}else if(MY_CATE==="追番"){return get_zhui(MY_PAGE,1)}else if(MY_CATE==="追剧"){return get_zhui(MY_PAGE,2)}else if(MY_CATE==="时间表"){let tid=MY_FL.tid||"1";return get_timeline(tid,MY_PAGE)}else{return{}}}VODS=cate_filter().list;',
一级:'js:let d=[];function get_result(url){let videos=[];let html=request(url);let jo=JSON.parse(html);if(jo["code"]===0){let vodList=jo.result?jo.result.list:jo.data.list;vodList.forEach(function(vod){let aid=(vod["season_id"]+"").trim();let title=vod["title"].trim();let img=vod["cover"].trim();let remark=vod["new_ep"]["index_show"];videos.push({vod_id:aid,vod_name:title,vod_pic:img,vod_remarks:remark})})}return videos}function get_rank(tid,pg){return get_result("https://api.bilibili.com/pgc/web/rank/list?season_type="+tid+"&pagesize=20&page="+pg+"&day=3")}function get_rank2(tid,pg){return get_result("https://api.bilibili.com/pgc/season/rank/web/list?season_type="+tid+"&pagesize=20&page="+pg+"&day=3")}function get_zhui(pg,mode){let url="https://api.bilibili.com/x/space/bangumi/follow/list?type="+mode+"&follow_status=0&pn="+pg+"&ps=10&vmid="+getItem("userid","");return get_result(url)}function get_all(tid,pg,order,season_status){let url="https://api.bilibili.com/pgc/season/index/result?order="+order+"&pagesize=20&type=1&season_type="+tid+"&page="+pg+"&season_status="+season_status;return get_result(url)}function get_timeline(tid,pg){let videos=[];let url="https://api.bilibili.com/pgc/web/timeline/v2?season_type="+tid+"&day_before=2&day_after=4";let html=request(url);let jo=JSON.parse(html);if(jo["code"]===0){let videos1=[];let vodList=jo.result.latest;vodList.forEach(function(vod){let aid=(vod["season_id"]+"").trim();let title=vod["title"].trim();let img=vod["cover"].trim();let remark=vod["pub_index"]+" "+vod["follows"].replace("系列","");videos1.push({vod_id:aid,vod_name:title,vod_pic:img,vod_remarks:remark})});let videos2=[];for(let i=0;i<7;i++){let vodList=jo["result"]["timeline"][i]["episodes"];vodList.forEach(function(vod){if(vod["published"]+""==="0"){let aid=(vod["season_id"]+"").trim();let title=vod["title"].trim();let img=vod["cover"].trim();let date=vod["pub_ts"];let remark=date+" "+vod["pub_index"];videos2.push({vod_id:aid,vod_name:title,vod_pic:img,vod_remarks:remark})}})}videos=videos2.concat(videos1)}return videos}function cate_filter(d,cookie){if(MY_CATE==="1"){return get_rank(MY_CATE,MY_PAGE)}else if(["2","3","4","5","7"].includes(MY_CATE)){return get_rank2(MY_CATE,MY_PAGE)}else if(MY_CATE==="全部"){let tid=MY_FL.tid||"1";let order=MY_FL.order||"2";let season_status=MY_FL.season_status||"-1";return get_all(tid,MY_PAGE,order,season_status)}else if(MY_CATE==="追番"){return get_zhui(MY_PAGE,1)}else if(MY_CATE==="追剧"){return get_zhui(MY_PAGE,2)}else if(MY_CATE==="时间表"){let tid=MY_FL.tid||"1";return get_timeline(tid,MY_PAGE)}else{return{}}}VODS=cate_filter();',
二级:{"title":".data h4--i&&Text;.yac&&Text","img":".item-lazy&&data-original","desc":";;;.act&&Text;.dir&&Text","content":".tbox_js&&Text","tabs":"js:pdfa=jsp.pdfa;TABS=pdfa(html,'.tbox_t h3').map(function(it,idex){return '线路'+(idex+1)})","lists":"ul.list_block:eq(#id) li","tabs":".tbox_t h3"},
搜索:'ul.tbox_m li;*;*;*;*',
......
......@@ -1509,13 +1509,19 @@ function categoryParse(cateObj) {
print(`MY_CATE:${MY_CATE},pagecount:${JSON.stringify(rule.pagecount)}`);
pagecount = parseInt(rule.pagecount[MY_CATE]);
}
return d.length<1?'{}':JSON.stringify({
let nodata = {
list:[{vod_name:'无数据,防无限请求',vod_id:'no_data',vod_remarks:'不要点,会崩的',vod_pic:'https://ghproxy.com/https://raw.githubusercontent.com/hjdhnx/dr_py/main/404.jpg'}],
total:1,pagecount:1,page:1,limit:1
};
let vod = d.length<1?JSON.stringify(nodata):JSON.stringify({
'page': parseInt(cateObj.pg),
'pagecount': pagecount||999,
'limit': 20,
'total': 999,
'list': d,
});
// print(vod);
return vod
}
/**
......
此差异已折叠。
......@@ -1401,13 +1401,19 @@ function categoryParse(cateObj) {
print(`MY_CATE:${MY_CATE},pagecount:${JSON.stringify(rule.pagecount)}`);
pagecount = parseInt(rule.pagecount[MY_CATE]);
}
return d.length<1?'{}':JSON.stringify({
let nodata = {
list:[{vod_name:'无数据,防无限请求',vod_id:'no_data',vod_remarks:'不要点,会崩的',vod_pic:'https://ghproxy.com/https://raw.githubusercontent.com/hjdhnx/dr_py/main/404.jpg'}],
total:1,pagecount:1,page:1,limit:1
};
let vod = d.length<1?JSON.stringify(nodata):JSON.stringify({
'page': parseInt(cateObj.pg),
'pagecount': pagecount||999,
'limit': 20,
'total': 999,
'list': d,
});
// print(vod);
return vod
}
/**
......
此差异已折叠。
js:
let d = [];
function get_result(url){
let result = {};
let videos = [];
let html = request(url);
let jo = JSON.parse(html);
if(jo['code'] === 0){
let videos = [];
let vodList = jo.result?jo.result.list:jo.data.list;
vodList.forEach(function (vod){
let aid = (vod['season_id']+'').trim();
......@@ -19,13 +18,8 @@ function get_result(url){
"vod_remarks": remark
});
});
result['list'] = videos;
result['page'] = 1;
result['pagecount'] = 1;
result['limit'] = 90;
result['total'] = 999999;
}
return result;
return videos;
}
function get_rank(tid,pg){
return get_result('https://api.bilibili.com/pgc/web/rank/list?season_type='+tid+'&pagesize=20&page='+pg+'&day=3')
......@@ -46,7 +40,7 @@ function get_all(tid, pg, order, season_status){
}
function get_timeline(tid,pg){
let result = {};
let videos = [];
let url = 'https://api.bilibili.com/pgc/web/timeline/v2?season_type='+tid+'&day_before=2&day_after=4';
let html = request(url);
let jo = JSON.parse(html);
......@@ -58,7 +52,7 @@ function get_timeline(tid,pg){
let title = vod['title'].trim();
let img = vod['cover'].trim();
let remark = vod['pub_index'] + ' ' + vod['follows'].replace('系列', '');
videos.push({
videos1.push({
"vod_id": aid,
"vod_name": title,
"vod_pic": img,
......@@ -83,15 +77,10 @@ function get_timeline(tid,pg){
});
}
});
}
result['list'] = videos2.concat(videos1);
result['page'] = 1;
result['pagecount'] = 1;
result['limit'] = 90;
result['total'] = 999999;
videos = videos2.concat(videos1);
}
return result;
return videos;
}
function cate_filter(d, cookie) {
......@@ -115,5 +104,5 @@ function cate_filter(d, cookie) {
return {}
}
}
VODS = cate_filter().list;
VODS = cate_filter();
// print(VODS);
\ No newline at end of file
......@@ -54,6 +54,7 @@
```json
{"1":1,"2":1,"3":1,"4":1,"5":1,"7":1,"时间表":1}
```
- [X] 增加分类api无数据时显示一条提示数据防止软件无限请求
###### 2022/11/30
- [X] 修复哔哩zb,jrkan zb无法播放问题
###### 2022/11/29
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册