教育大全2.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. /* 直播弹幕 -> vod_area:'bilidanmu'
  2. 目前只有皮皮虾大佬的DMBox, 支持弹幕
  3. DMBox下载:https://t.me/pipixiawerun
  4. 设置 > 窗口预览 > 开启
  5. */
  6. /* Cookie设置
  7. Cookie改为预设获取蜂蜜大佬Github的
  8. https://ghproxy.net/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/txt/cookie.txt
  9. Cookie获取方法
  10. https://ghproxy.net/https://raw.githubusercontent.com/UndCover/PyramidStore/main/list.md
  11. Cookie设置方法1: DR-PY 后台管理界面
  12. CMS后台管理 > 设置中心 > 环境变量 > {"bili_cookie":"XXXXXXX","vmid":"XXXXXX"} > 保存
  13. Cookie设置方法2: 手动替换Cookie
  14. 底下代码 headers的
  15. "Cookie":"$bili_cookie"
  16. 手动替换为
  17. "Cookie":"将获取的Cookie黏贴在这"
  18. */
  19. var rule = {
  20. title:'我的哔哩',
  21. host:'https://api.bilibili.com',
  22. homeUrl:'/x/web-interface/search/type?search_type=video&keyword=小姐姐4K&page=1',
  23. url:'/x/web-interface/search/type?search_type=videofyfilter',
  24. class_name:'幼儿启蒙&人教版&沪教版&苏教版&北师大版',
  25. class_url:'幼儿启蒙&人教版&沪教版&苏教版&北师大版',
  26. filterable: 1,
  27. filter_url: '&keyword={{fl.tid}}&page=fypage&duration={{fl.duration}}&order={{fl.order}}',
  28. filter_def:
  29. {
  30. 幼儿启蒙:{tid:'幼儿启蒙'},
  31. 人教版:{tid:'人教版'},
  32. 沪教版:{tid:'沪教版'},
  33. 苏教版:{tid:'苏教版'},
  34. 北师大版:{tid:'北师大版'}
  35. },
  36. filter: {
  37. "幼儿启蒙": [{"key": "tid","name": "分类","value": [{"n": "全部","v": "全部"},{"n":"儿童早教","v":"儿童早教"},{"n":"启蒙故事","v":"儿童启蒙故事"},{"n":"识字启蒙","v":"儿童识字启蒙"},{"n":"数学启蒙","v":"儿童数学启蒙"},{"n":"拼音启蒙","v":"儿童拼音启蒙"},{"n":"英语启蒙","v":"儿童英语启蒙"},{"n":"儿歌","v":"儿童歌曲"},{"n":"绘画","v":"儿童绘画"},{"n":"睡前故事","v":"睡前故事"},{"n":"动画","v":"儿童动画"},{"n":"儿童音乐","v":"儿童音乐"},{"n":"儿童安全教育","v":"儿童安全教育"},{"n":"贝瓦儿歌","v":"贝瓦儿歌"},{"n":"悟空识字","v":"悟空识字"},{"n":"宝宝巴士","v":"宝宝巴士"},{"n":"儿歌多多","v":"儿歌多多"},{"n":"学而思","v":"学而思"}]},{"key": "order","name": "排序","value": [{ "n": "综合排序","v": "0"},{"n": "最多点击","v": "click"},{"n": "最新发布","v": "pubdate"},{"n": "最多弹幕","v": "dm"},{"n": "最多收藏","v": "stow"}]},{"key": "duration","name": "时长","value": [{"n": "全部","v": "0"},{"n": "60分钟以上","v": "4"},{"n": "30~60分钟","v": "3"},{"n": "10~30分钟","v": "2"},{"n": "10分钟以下","v": "1"}]}],
  38. "人教版": [{"key": "tid","name": "分类","value": [{"n": "全部","v": "全部"},{"n":"一年级","v":"一年级人教版"},{"n":"二年级","v":"二年级人教版"},{"n":"三年级","v":"三年级人教版"},{"n":"四年级","v":"四年级人教版"},{"n":"五年级","v":"五年级人教版"},{"n":"六年级","v":"六年级人教版"},{"n":"初一年级","v":"初一人教版"},{"n":"初二年级","v":"初二人教版"},{"n":"初三年级","v":"初三人教版"},{"n":"高一年级","v":"高一人教版"},{"n":"高二年级","v":"高二人教版"},{"n":"高三年级","v":"高三人教版"}]},{"key": "order","name": "排序","value": [{ "n": "综合排序","v": "0"},{"n": "最多点击","v": "click"},{"n": "最新发布","v": "pubdate"},{"n": "最多弹幕","v": "dm"},{"n": "最多收藏","v": "stow"}]},{"key": "duration","name": "时长","value": [{"n": "全部","v": "0"},{"n": "60分钟以上","v": "4"},{"n": "30~60分钟","v": "3"},{"n": "10~30分钟","v": "2"},{"n": "10分钟以下","v": "1"}]}],
  39. "沪教版": [{"key": "tid","name": "分类","value": [{"n": "全部","v": "全部"},{"n":"一年级","v":"一年级沪教版"},{"n":"二年级","v":"二年级沪教版"},{"n":"三年级","v":"三年级沪教版"},{"n":"四年级","v":"四年级沪教版"},{"n":"五年级","v":"五年级沪教版"},{"n":"六年级","v":"六年级沪教版"},{"n":"初一年级","v":"初一沪教版"},{"n":"初二年级","v":"初二沪教版"},{"n":"初三年级","v":"初三沪教版"},{"n":"高一年级","v":"高一沪教版"},{"n":"高二年级","v":"高二沪教版"},{"n":"高三年级","v":"高三沪教版"}]},{"key": "order","name": "排序","value": [{ "n": "综合排序","v": "0"},{"n": "最多点击","v": "click"},{"n": "最新发布","v": "pubdate"},{"n": "最多弹幕","v": "dm"},{"n": "最多收藏","v": "stow"}]},{"key": "duration","name": "时长","value": [{"n": "全部","v": "0"},{"n": "60分钟以上","v": "4"},{"n": "30~60分钟","v": "3"},{"n": "10~30分钟","v": "2"},{"n": "10分钟以下","v": "1"}]}],
  40. "苏教版": [{"key": "tid","name": "分类","value": [{"n": "全部","v": "全部"},{"n":"一年级","v":"一年级苏教版"},{"n":"二年级","v":"二年级苏教版"},{"n":"三年级","v":"三年级苏教版"},{"n":"四年级","v":"四年级苏教版"},{"n":"五年级","v":"五年级苏教版"},{"n":"六年级","v":"六年级苏教版"},{"n":"初一年级","v":"初一苏教版"},{"n":"初二年级","v":"初二苏教版"},{"n":"初三年级","v":"初三苏教版"},{"n":"高一年级","v":"高一苏教版"},{"n":"高二年级","v":"高二苏教版"},{"n":"高三年级","v":"高三苏教版"}]},{"key": "order","name": "排序","value": [{ "n": "综合排序","v": "0"},{"n": "最多点击","v": "click"},{"n": "最新发布","v": "pubdate"},{"n": "最多弹幕","v": "dm"},{"n": "最多收藏","v": "stow"}]},{"key": "duration","name": "时长","value": [{"n": "全部","v": "0"},{"n": "60分钟以上","v": "4"},{"n": "30~60分钟","v": "3"},{"n": "10~30分钟","v": "2"},{"n": "10分钟以下","v": "1"}]}],
  41. "北师大版": [{"key": "tid","name": "分类","value": [{"n": "全部","v": "全部"},{"n":"一年级","v":"一年级北师大版"},{"n":"二年级","v":"二年级北师大版"},{"n":"三年级","v":"三年级北师大版"},{"n":"四年级","v":"四年级北师大版"},{"n":"五年级","v":"五年级北师大版"},{"n":"六年级","v":"六年级北师大版"},{"n":"初一年级","v":"初一北师大版"},{"n":"初二年级","v":"初二北师大版"},{"n":"初三年级","v":"初三北师大版"},{"n":"高一年级","v":"高一北师大版"},{"n":"高二年级","v":"高二北师大版"},{"n":"高三年级","v":"高三北师大版"}]},{"key": "order","name": "排序","value": [{ "n": "综合排序","v": "0"},{"n": "最多点击","v": "click"},{"n": "最新发布","v": "pubdate"},{"n": "最多弹幕","v": "dm"},{"n": "最多收藏","v": "stow"}]},{"key": "duration","name": "时长","value": [{"n": "全部","v": "0"},{"n": "60分钟以上","v": "4"},{"n": "30~60分钟","v": "3"},{"n": "10~30分钟","v": "2"},{"n": "10分钟以下","v": "1"}]}]
  42. },
  43. detailUrl:'/x/web-interface/view?aid=fyid',//二级详情拼接链接(json格式用)
  44. searchUrl:'/x/web-interface/search/type?search_type=video&keyword=**&page=fypage',
  45. searchable:2,
  46. quickSearch:0,
  47. headers:{
  48. "User-Agent":"PC_UA",
  49. "Referer": "https://www.bilibili.com",
  50. // "Cookie":"$bili_cookie"
  51. // "Cookie":"https://ghproxy.net/https://github.com/FongMi/CatVodSpider/raw/main/txt/cookie.txt"
  52. "Cookie":"http://127.0.0.1:9978/file/tvbox/bilicookie.txt"
  53. },
  54. timeout:5000,
  55. limit:8,
  56. play_parse:true,
  57. lazy:`js:
  58. let ids = input.split('_');
  59. let result = {};
  60. let iurl = 'https://api.bilibili.com:443/x/player/playurl?avid=' + ids[0] + '&cid=' + ids[1] + '&qn=116';
  61. let html = request(iurl);
  62. let jRoot = JSON.parse(html);
  63. let jo = jRoot.data;
  64. let ja = jo.durl;
  65. let maxSize = -1;
  66. let position = -1;
  67. ja.forEach(function(tmpJo, i) {
  68. if (maxSize < Number(tmpJo.size)) {
  69. maxSize = Number(tmpJo.size);
  70. position = i
  71. }
  72. });
  73. let purl = '';
  74. if (ja.length > 0) {
  75. if (position === -1) {
  76. position = 0
  77. }
  78. purl = ja[position].url
  79. }
  80. result.parse = 0;
  81. result.playUrl = '';
  82. result.url = unescape(purl);
  83. result.header = {
  84. 'Referer': 'https://live.bilibili.com',
  85. 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36'
  86. };
  87. result.contentType = 'video/x-flv';
  88. input = result
  89. `,
  90. double:false,
  91. 推荐:'*',
  92. // 一级:'js:let html=request(input);let msg=JSON.parse(html).message;function title_rep(title){if(/keyword/.test(title)){title=title.replace(\'<em class="keyword">\',"").replace("</em>","").replace("&quot;","\'");log("名称替换👉"+title)};return title}if(msg!=="0"){VODS=[{vod_name:KEY+"➢"+msg,vod_id:"no_data",vod_remarks:"别点,缺少bili_cookie",vod_pic:"https://ghproxy.net/https://raw.githubusercontent.com/hjdhnx/dr_py/main/404.jpg"}]}else{let videos=[];let vodList=JSON.parse(html).data.result;vodList.forEach(function(vod){let aid=vod["aid"];let title=vod["title"].trim();title=title_rep(title);title=title_rep(title);title=title_rep(title);title=title_rep(title);let img="https:"+vod["pic"];let remark=vod["duration"];videos.push({vod_id:aid,vod_name:title,vod_pic:img,vod_remarks:remark})});VODS=videos}',
  93. 一级:`js:
  94. let html = request(input);
  95. function stripHtmlTag(src) {
  96. return src.replace(/<\\/?[^>]+(>|$)/g, '').replace(/&.{1,5};/g, '').replace(/\\s{2,}/g, ' ');
  97. }
  98. function turnDHM(duration) {
  99. let min = duration.split(':')[0];
  100. let sec = duration.split(':')[1];
  101. if (min == 0) {
  102. return sec + '秒'
  103. } else if (0 < min && min < 60) {
  104. return min + '分'
  105. } else if (60 <= min && min < 1440) {
  106. if (min % 60 == 0) {
  107. let h = min / 60;
  108. return h + '小时'
  109. } else {
  110. let h = min / 60;
  111. h = (h + '').split('.')[0];
  112. let m = min % 60;
  113. return h + '小时' + m + '分';
  114. }
  115. } else if (min >= 1440) {
  116. let d = min / 60 / 24;
  117. d = (d + '').split('.')[0];
  118. let h = min / 60 % 24;
  119. h = (h + '').split('.')[0];
  120. let m = min % 60;
  121. let dhm = '';
  122. if (d > 0) {
  123. dhm = d + '天'
  124. }
  125. if (h >= 1) {
  126. dhm = dhm + h + '小时'
  127. }
  128. if (m > 0) {
  129. dhm = dhm + m + '分'
  130. }
  131. return dhm
  132. }
  133. return null
  134. }
  135. let videos = [];
  136. let vodList = JSON.parse(html).data.result;
  137. vodList.forEach(function(vod) {
  138. let aid = vod.aid;
  139. let title = stripHtmlTag(vod.title);
  140. let img = 'https:' + vod.pic;
  141. let remark = turnDHM(vod.duration);
  142. videos.push({
  143. vod_id: aid,
  144. vod_name: title,
  145. vod_pic: img,
  146. vod_remarks: remark
  147. })
  148. });
  149. VODS = videos
  150. `,
  151. 二级:`js:
  152. function stripHtmlTag(src) {
  153. return src.replace(/<\\/?[^>]+(>|$)/g, '').replace(/&.{1,5};/g, '').replace(/\\s{2,}/g, ' ');
  154. }
  155. let html = request(input);
  156. let jo = JSON.parse(html).data;
  157. let aid = jo.aid;
  158. let title = stripHtmlTag(jo.title);
  159. let pic = jo.pic;
  160. let desc = jo.desc;
  161. let year = jo.pubdate;
  162. let dire = jo.owner.name;
  163. let typeName = jo.tname;
  164. let remark = jo.duration;
  165. let vod = {
  166. vod_id: aid,
  167. vod_name: title,
  168. vod_pic: pic,
  169. type_name: typeName,
  170. vod_year: year,
  171. vod_area: 'bilidanmu',
  172. vod_remarks: remark,
  173. vod_tags: 'mv',
  174. vod_director: dire,
  175. vod_content: desc
  176. };
  177. let ja = jo.pages;
  178. let playurls = [];
  179. ja.forEach(function(tmpJo) {
  180. let cid = tmpJo.cid;
  181. let part = tmpJo.part.replace('#', '﹟').replace('$', '﹩');
  182. playurls.push(
  183. part + '$' + aid + '_' + cid
  184. )
  185. });
  186. let playUrl = playurls.join('#');
  187. vod.vod_play_from = 'B站';
  188. vod.vod_play_url = playUrl;
  189. VOD = vod;
  190. `,
  191. 搜索:'*',
  192. // 预处理:'if(rule_fetch_params.headers.Cookie.startsWith("http")){rule_fetch_params.headers.Cookie=fetch(rule_fetch_params.headers.Cookie);setItem(RULE_CK,cookie)};log(rule_fetch_params.headers.Cookie)',
  193. }