From 60d3de96a7fa6b9a17990b414f2e17f4c3476e5e Mon Sep 17 00:00:00 2001 From: hjdhnx Date: Fri, 2 Dec 2022 15:16:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=8D=E6=AC=A1=E4=BC=98=E5=8C=96=E5=93=94?= =?UTF-8?q?=E5=93=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/version.txt | 2 +- ...45\223\224\345\223\251\345\275\261\350\247\206.js" | 5 +++-- ...45\223\224\345\223\251\344\272\214\347\272\247.js" | 11 +++++++---- ...45\223\224\345\223\251\345\205\215\345\227\205.js" | 8 ++++++++ readme.md | 1 + 5 files changed, 20 insertions(+), 7 deletions(-) diff --git a/js/version.txt b/js/version.txt index bbbc67a..d7721c7 100644 --- a/js/version.txt +++ b/js/version.txt @@ -1 +1 @@ -3.9.28beta2 \ No newline at end of file +3.9.28beta3 \ No newline at end of file diff --git "a/js/\345\223\224\345\223\251\345\275\261\350\247\206.js" "b/js/\345\223\224\345\223\251\345\275\261\350\247\206.js" index 2d3a639..7bcaa71 100644 --- "a/js/\345\223\224\345\223\251\345\275\261\350\247\206.js" +++ "b/js/\345\223\224\345\223\251\345\275\261\350\247\206.js" @@ -19,6 +19,7 @@ var rule = { class_url:'1&4&2&5&3&7&全部&追番&追剧&时间表', filter:{"全部":[{"key":"tid","name":"分类","value":[{"n":"番剧","v":"1"},{"n":"国创","v":"4"},{"n":"电影","v":"2"},{"n":"电视剧","v":"5"},{"n":"记录片","v":"3"},{"n":"综艺","v":"7"}]},{"key":"order","name":"排序","value":[{"n":"播放数量","v":"2"},{"n":"更新时间","v":"0"},{"n":"最高评分","v":"4"},{"n":"弹幕数量","v":"1"},{"n":"追看人数","v":"3"},{"n":"开播时间","v":"5"},{"n":"上映时间","v":"6"}]},{"key":"season_status","name":"付费","value":[{"n":"全部","v":"-1"},{"n":"免费","v":"1"},{"n":"付费","v":"2%2C6"},{"n":"大会员","v":"4%2C6"}]}],"时间表":[{"key":"tid","name":"分类","value":[{"n":"番剧","v":"1"},{"n":"国创","v":"4"}]}]}, play_parse:true, + // play_json:[{re:'*', json:{jx:1, parse:0,header:JSON.stringify({"user-agent":"PC_UA"})}}], pagecount:{"1":1,"2":1,"3":1,"4":1,"5":1,"7":1,"时间表":1}, lazy:'', limit:5, @@ -38,9 +39,9 @@ var rule = { list_url:'cid', }, 二级:'', - 二级:'js:function zh(num){let p="";if(Number(num)>1e8){p=(num/1e8).toFixed(2)+"亿"}else if(Number(num)>1e4){p=(num/1e4).toFixed(2)+"万"}else{p=num}return p}let html=request(input);let jo=JSON.parse(html).result;let id=jo["season_id"];let title=jo["title"];let pic=jo["cover"];let areas=jo["areas"][0]["name"];let typeName=jo["share_sub_title"];let date=jo["publish"]["pub_time"].substr(0,4);let dec=jo["evaluate"];let remark=jo["new_ep"]["desc"];let stat=jo["stat"];let status="弹幕: "+zh(stat["danmakus"])+" 点赞: "+zh(stat["likes"])+" 投币: "+zh(stat["coins"])+" 追番追剧: "+zh(stat["favorites"]);let score=jo.hasOwnProperty("rating")?"评分: "+jo["rating"]["score"]+" "+jo["subtitle"]:"暂无评分"+" "+jo["subtitle"];let vod={vod_id:id,vod_name:title,vod_pic:pic,type_name:typeName,vod_year:date,vod_area:areas,vod_remarks:remark,vod_actor:status,vod_director:score,vod_content:dec};let ja=jo["episodes"];let playurls=[];ja.forEach(function(tmpJo){let eid=tmpJo["id"];let cid=tmpJo["cid"];let part=tmpJo["title"].replace("#","-")+" "+tmpJo["long_title"];playurls.push(part+"$"+eid+"_"+cid)});let playUrl=playurls.join("#");vod["vod_play_from"]="B站";vod["vod_play_url"]=playUrl;VOD=vod;', + 二级:'js:function zh(num){let p="";if(Number(num)>1e8){p=(num/1e8).toFixed(2)+"亿"}else if(Number(num)>1e4){p=(num/1e4).toFixed(2)+"万"}else{p=num}return p}let html=request(input);let jo=JSON.parse(html).result;let id=jo["season_id"];let title=jo["title"];let pic=jo["cover"];let areas=jo["areas"][0]["name"];let typeName=jo["share_sub_title"];let date=jo["publish"]["pub_time"].substr(0,4);let dec=jo["evaluate"];let remark=jo["new_ep"]["desc"];let stat=jo["stat"];let status="弹幕: "+zh(stat["danmakus"])+" 点赞: "+zh(stat["likes"])+" 投币: "+zh(stat["coins"])+" 追番追剧: "+zh(stat["favorites"]);let score=jo.hasOwnProperty("rating")?"评分: "+jo["rating"]["score"]+" "+jo["subtitle"]:"暂无评分"+" "+jo["subtitle"];let vod={vod_id:id,vod_name:title,vod_pic:pic,type_name:typeName,vod_year:date,vod_area:areas,vod_remarks:remark,vod_actor:status,vod_director:score,vod_content:dec};let ja=jo["episodes"];let playurls1=[];let playurls2=[];ja.forEach(function(tmpJo){let eid=tmpJo["id"];let cid=tmpJo["cid"];let link=tmpJo["link"];let part=tmpJo["title"].replace("#","-")+" "+tmpJo["long_title"];playurls1.push(part+"$"+eid+"_"+cid);playurls2.push(part+"$"+link)});let playUrl=playurls1.join("#")+"$$$"+playurls2.join("#");vod["vod_play_from"]="B站$$$bilibili";vod["vod_play_url"]=playUrl;VOD=vod;', 搜索:'', 搜索:'js:let url1=input+"media_bangumi";let url2=input+"media_ft";let html=request(url1);let msg=JSON.parse(html).message;if(msg!=="0"){VODS=[{vod_name:KEY+"➢"+msg,vod_id:"no_data",vod_remarks:"别点,缺少bili_cookie",vod_pic:"https://ghproxy.com/https://raw.githubusercontent.com/hjdhnx/dr_py/main/404.jpg"}]}else{let jo1=JSON.parse(html).data;html=request(url2);let jo2=JSON.parse(html).data;let videos=[];let vodList=[];if(jo1["numResults"]===0){vodList=jo2["result"]}else if(jo2["numResults"]===0){vodList=jo1["result"]}else{vodList=jo1["result"].concat(jo2["result"])}vodList.forEach(function(vod){let aid=(vod["season_id"]+"").trim();let title=KEY+"➢"+vod["title"].trim().replace(\'\',"").replace("","");let img=vod["cover"].trim();let remark=vod["index_show"];videos.push({vod_id:aid,vod_name:title,vod_pic:img,vod_remarks:remark})});VODS=videos}', lazy:'', - lazy:'js:let ids=input.split("_");let result={};let url="https://api.bilibili.com/pgc/player/web/playurl?qn=116&ep_id="+ids[0]+"&cid="+ids[1];let html=request(url);let jRoot=JSON.parse(html);if(jRoot["message"]!=="success"){print("需要大会员权限才能观看");input=""}else{let jo=jRoot["result"];let ja=jo["durl"];let maxSize=-1;let position=-1;ja.forEach(function(tmpJo,i){if(maxSize0){if(position===-1){position=0}url=ja[position]["url"]}result["parse"]=0;result["playUrl"]="";result["url"]=url;result["header"]={Referer:"https://www.bilibili.com","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36"};result["contentType"]="video/x-flv";input=result}', + lazy:'js:if(/^http/.test(input)){input={jx:1,url:input,parse:0}}else{let ids=input.split("_");let result={};let url="https://api.bilibili.com/pgc/player/web/playurl?qn=116&ep_id="+ids[0]+"&cid="+ids[1];let html=request(url);let jRoot=JSON.parse(html);if(jRoot["message"]!=="success"){print("需要大会员权限才能观看");input=""}else{let jo=jRoot["result"];let ja=jo["durl"];let maxSize=-1;let position=-1;ja.forEach(function(tmpJo,i){if(maxSize0){if(position===-1){position=0}url=ja[position]["url"]}result["parse"]=0;result["playUrl"]="";result["url"]=url;result["header"]={Referer:"https://www.bilibili.com","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36"};result["contentType"]="video/x-flv";input=result}}', } \ No newline at end of file diff --git "a/py/\345\223\224\345\223\251\344\272\214\347\272\247.js" "b/py/\345\223\224\345\223\251\344\272\214\347\272\247.js" index 34026dc..7d58d97 100644 --- "a/py/\345\223\224\345\223\251\344\272\214\347\272\247.js" +++ "b/py/\345\223\224\345\223\251\344\272\214\347\272\247.js" @@ -37,14 +37,17 @@ let vod = { "vod_content": dec } let ja = jo['episodes']; -let playurls = []; +let playurls1 = []; +let playurls2 = []; ja.forEach(function (tmpJo){ let eid = tmpJo['id']; let cid = tmpJo['cid']; + let link = tmpJo['link']; let part = tmpJo['title'].replace("#", "-")+' '+tmpJo['long_title']; - playurls.push(part+'$'+eid+'_'+cid); + playurls1.push(part+'$'+eid+'_'+cid); + playurls2.push(part+'$'+link); }); -let playUrl = playurls.join('#'); -vod['vod_play_from'] = 'B站' +let playUrl = playurls1.join('#')+'$$$'+playurls2.join('#'); +vod['vod_play_from'] = 'B站$$$bilibili' vod['vod_play_url'] = playUrl VOD = vod; \ No newline at end of file diff --git "a/py/\345\223\224\345\223\251\345\205\215\345\227\205.js" "b/py/\345\223\224\345\223\251\345\205\215\345\227\205.js" index fe7ff63..d93b28b 100644 --- "a/py/\345\223\224\345\223\251\345\205\215\345\227\205.js" +++ "b/py/\345\223\224\345\223\251\345\205\215\345\227\205.js" @@ -1,4 +1,11 @@ js: +if(/^http/.test(input)){ +input = { + jx:1, + url:input, + parse:0 +}; +}else{ let ids = input.split('_'); let result = {}; let url = 'https://api.bilibili.com/pgc/player/web/playurl?qn=116&ep_id='+ids[0]+'&cid='+ids[1]; @@ -34,4 +41,5 @@ if(jRoot['message'] !== 'success'){ }; result["contentType"] = 'video/x-flv'; input = result; +} } \ No newline at end of file diff --git a/readme.md b/readme.md index 225062a..55e21f5 100644 --- a/readme.md +++ b/readme.md @@ -56,6 +56,7 @@ ``` - [X] 增加分类api无数据时显示一条提示数据防止软件无限请求 - [X] 完善哔哩影视(drpy),共有两个环境变量 vmid,bili_cookie 需要自行设置,否则无法正常播放和搜索 +- [X] 优化哔哩影视(drpy),增加二级页面线路二,通过调用外部解析播放。默认线路1是内置cookie播放 ###### 2022/11/30 - [X] 修复哔哩zb,jrkan zb无法播放问题 ###### 2022/11/29 -- GitLab