模板.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  1. if (typeof Object.assign !== 'function') {
  2. Object.assign = function () {
  3. let target = arguments[0];
  4. for (let i = 1; i < arguments.length; i++) {
  5. let source = arguments[i];
  6. for (let key in source) {
  7. if (Object.prototype.hasOwnProperty.call(source, key)) {
  8. target[key] = source[key];
  9. }
  10. }
  11. }
  12. return target;
  13. };
  14. }
  15. // 通用免嗅探播放
  16. let common_lazy = `js:
  17. let html = request(input);
  18. let hconf = html.match(/r player_.*?=(.*?)</)[1];
  19. let json = JSON5.parse(hconf);
  20. let url = json.url;
  21. if (json.encrypt == '1') {
  22. url = unescape(url);
  23. } else if (json.encrypt == '2') {
  24. url = unescape(base64Decode(url));
  25. }
  26. if (/\\.(m3u8|mp4|m4a|mp3)/.test(url)) {
  27. input = {
  28. parse: 0,
  29. jx: 0,
  30. url: url,
  31. };
  32. } else {
  33. input;
  34. }`;
  35. // 默认嗅探播放
  36. let def_lazy = `js:
  37. input = { parse: 1, url: input, js: '' };`;
  38. // 采集站播放
  39. let cj_lazy = `js:
  40. if (/\\.(m3u8|mp4)/.test(input)) {
  41. input = { parse: 0, url: input };
  42. } else {
  43. if (rule.parse_url.startsWith('json:')) {
  44. let purl = rule.parse_url.replace('json:', '') + input;
  45. let html = request(purl);
  46. let json = JSON.parse(html);
  47. if (json.url) {
  48. input = { parse: 0, url: json.url };
  49. }
  50. } else {
  51. input = rule.parse_url + input;
  52. }
  53. }`;
  54. function getMubans() {
  55. const mubanDict = { // 模板字典
  56. mx: {
  57. title: '',
  58. host: '',
  59. url: '/vodshow/fyclass--------fypage---/',
  60. searchUrl: '/vodsearch/**----------fypage---/',
  61. class_parse: '.top_nav li;a&&Text;a&&href;.*/(.*?)/',
  62. searchable: 2,
  63. quickSearch: 0,
  64. filterable: 0,
  65. headers: {
  66. 'User-Agent': 'MOBILE_UA',
  67. },
  68. play_parse: true,
  69. lazy: common_lazy,
  70. limit: 6,
  71. double: true,
  72. 推荐: '.cbox_list;*;*;*;*;*',
  73. 一级: 'ul.vodlist li;a&&title;a&&data-original;.pic_text&&Text;a&&href',
  74. 二级: {
  75. title: 'h2&&Text;.content_detail:eq(1)&&li&&a:eq(2)&&Text',
  76. img: '.vodlist_thumb&&data-original',
  77. desc: '.content_detail:eq(1)&&li:eq(1)&&Text;.content_detail:eq(1)&&li&&a&&Text;.content_detail:eq(1)&&li&&a:eq(1)&&Text;.content_detail:eq(1)&&li:eq(2)&&Text;.content_detail:eq(1)&&li:eq(3)&&Text',
  78. content: '.content_desc&&span&&Text',
  79. tabs: '.play_source_tab&&a',
  80. lists: '.content_playlist:eq(#id) li',
  81. },
  82. 搜索: '*',
  83. },
  84. mxpro: {
  85. title: '',
  86. host: '', // homeUrl:'/',
  87. url: '/vodshow/fyclass--------fypage---.html',
  88. searchUrl: '/vodsearch/**----------fypage---.html',
  89. searchable: 2,//是否启用全局搜索,
  90. quickSearch: 0,//是否启用快速搜索,
  91. filterable: 0,//是否启用分类筛选,
  92. headers: {//网站的请求头,完整支持所有的,常带ua和cookies
  93. 'User-Agent': 'MOBILE_UA', // "Cookie": "searchneed=ok"
  94. },
  95. class_parse: '.navbar-items li:gt(0):lt(10);a&&Text;a&&href;/(\\d+)',
  96. play_parse: true,
  97. lazy: common_lazy,
  98. limit: 6,
  99. double: true, // 推荐内容是否双层定位
  100. 推荐: '.tab-list.active;a.module-poster-item.module-item;.module-poster-item-title&&Text;.lazyload&&data-original;.module-item-note&&Text;a&&href',
  101. 一级: 'body a.module-poster-item.module-item;a&&title;.lazyload&&data-original;.module-item-note&&Text;a&&href',
  102. 二级: {
  103. title: 'h1&&Text;.module-info-tag-link:eq(-1)&&Text',
  104. img: '.lazyload&&data-original||data-src||src',
  105. desc: '.module-info-item:eq(-2)&&Text;.module-info-tag-link&&Text;.module-info-tag-link:eq(1)&&Text;.module-info-item:eq(2)&&Text;.module-info-item:eq(1)&&Text',
  106. content: '.module-info-introduction&&Text',
  107. tabs: '.module-tab-item',
  108. lists: '.module-play-list:eq(#id) a',
  109. tab_text: 'div--small&&Text',
  110. },
  111. 搜索: 'body .module-item;.module-card-item-title&&Text;.lazyload&&data-original;.module-item-note&&Text;a&&href;.module-info-item-content&&Text',
  112. }, mxone5: {
  113. title: '',
  114. host: '',
  115. url: '/show/fyclass--------fypage---.html',
  116. searchUrl: '/search/**----------fypage---.html',
  117. searchable: 2,//是否启用全局搜索,
  118. quickSearch: 0,//是否启用快速搜索,
  119. filterable: 0,//是否启用分类筛选,
  120. class_parse: '.nav-menu-items&&li;a&&Text;a&&href;.*/(.*?)\.html',
  121. play_parse: true,
  122. lazy: common_lazy,
  123. limit: 6,
  124. double: true, // 推荐内容是否双层定位
  125. 推荐: '.module-list;.module-items&&.module-item;a&&title;img&&data-src;.module-item-text&&Text;a&&href',
  126. 一级: '.module-items .module-item;a&&title;img&&data-src;.module-item-text&&Text;a&&href',
  127. 二级: {
  128. title: 'h1&&Text;.tag-link&&Text',
  129. img: '.module-item-pic&&img&&data-src',
  130. desc: '.video-info-items:eq(3)&&Text;.tag-link:eq(2)&&Text;.tag-link:eq(1)&&Text;.video-info-items:eq(1)&&Text;.video-info-items:eq(0)&&Text',
  131. content: '.vod_content&&Text',
  132. tabs: '.module-tab-item',
  133. lists: '.module-player-list:eq(#id)&&.scroll-content&&a',
  134. tab_text: 'div--small&&Text',
  135. },
  136. 搜索: '.module-items .module-search-item;a&&title;img&&data-src;.video-serial&&Text;a&&href',
  137. }, 首图: {
  138. title: '',
  139. host: '',
  140. url: '/vodshow/fyclass--------fypage---/',
  141. searchUrl: '/vodsearch/**----------fypage---.html',
  142. searchable: 2,//是否启用全局搜索,
  143. quickSearch: 0,//是否启用快速搜索,
  144. filterable: 0,//是否启用分类筛选,
  145. headers: {//网站的请求头,完整支持所有的,常带ua和cookies
  146. 'User-Agent': 'MOBILE_UA', // "Cookie": "searchneed=ok"
  147. },
  148. class_parse: '.myui-header__menu li.hidden-sm:gt(0):lt(7);a&&Text;a&&href;/(\\d+).html',
  149. play_parse: true,
  150. lazy: common_lazy,
  151. limit: 6,
  152. double: true, // 推荐内容是否双层定位
  153. 推荐: 'ul.myui-vodlist.clearfix;li;a&&title;a&&data-original;.pic-text&&Text;a&&href',
  154. 一级: '.myui-vodlist li;a&&title;a&&data-original;.pic-text&&Text;a&&href',
  155. 二级: {
  156. title: '.myui-content__detail .title--span&&Text;.myui-content__detail p.data:eq(3)&&Text',
  157. img: '.myui-content__thumb .lazyload&&data-original',
  158. desc: '.myui-content__detail p.otherbox&&Text;.year&&Text;.myui-content__detail p.data:eq(4)&&Text;.myui-content__detail p.data:eq(2)&&Text;.myui-content__detail p.data:eq(0)&&Text',
  159. content: '.content&&Text',
  160. tabs: '.myui-panel__head&&li',
  161. // tabs: '.nav-tabs&&li',
  162. lists: '.myui-content__list:eq(#id) li',
  163. },
  164. 搜索: '#searchList li;a&&title;.lazyload&&data-original;.pic-text&&Text;a&&href;.detail&&Text',
  165. }, 首图2: {
  166. title: '',
  167. host: '',
  168. url: '/list/fyclass-fypage.html',
  169. searchUrl: '/vodsearch/**----------fypage---.html',
  170. searchable: 2,//是否启用全局搜索,
  171. quickSearch: 0,//是否启用快速搜索,
  172. filterable: 0,//是否启用分类筛选,
  173. headers: {
  174. 'User-Agent': 'UC_UA', // "Cookie": ""
  175. },
  176. class_parse: '.stui-header__menu li:gt(0):lt(7);a&&Text;a&&href;.*/(.*?).html',
  177. play_parse: true,
  178. lazy: common_lazy,
  179. limit: 6,
  180. double: true, // 推荐内容是否双层定位
  181. 推荐: 'ul.stui-vodlist.clearfix;li;a&&title;.lazyload&&data-original;.pic-text&&Text;a&&href',
  182. 一级: '.stui-vodlist li;a&&title;a&&data-original;.pic-text&&Text;a&&href',
  183. 二级: {
  184. title: '.stui-content__detail .title&&Text;.stui-content__detail&&p:eq(-2)&&a&&Text',
  185. title1: '.stui-content__detail .title&&Text;.stui-content__detail&&p&&Text',
  186. img: '.stui-content__thumb .lazyload&&data-original',
  187. desc: '.stui-content__detail p&&Text;.stui-content__detail&&p:eq(-2)&&a:eq(2)&&Text;.stui-content__detail&&p:eq(-2)&&a:eq(1)&&Text;.stui-content__detail p:eq(2)&&Text;.stui-content__detail p:eq(1)&&Text',
  188. desc1: '.stui-content__detail p:eq(4)&&Text;;;.stui-content__detail p:eq(1)&&Text',
  189. content: '.detail&&Text',
  190. tabs: '.stui-pannel__head h3',
  191. tabs1: '.stui-vodlist__head h3',
  192. lists: '.stui-content__playlist:eq(#id) li',
  193. },
  194. 搜索: 'ul.stui-vodlist__media,ul.stui-vodlist,#searchList li;a&&title;.lazyload&&data-original;.pic-text&&Text;a&&href;.detail&&Text',
  195. }, 默认: {
  196. title: '',
  197. host: '',
  198. url: '',
  199. searchUrl: '',
  200. searchable: 2,
  201. quickSearch: 0,
  202. filterable: 0,
  203. filter: '',
  204. filter_url: '',
  205. filter_def: {},
  206. headers: {
  207. 'User-Agent': 'MOBILE_UA',
  208. },
  209. timeout: 5000,
  210. class_parse: '#side-menu li;a&&Text;a&&href;/(.*?)\.html',
  211. cate_exclude: '',
  212. play_parse: true,
  213. lazy: def_lazy,
  214. double: true,
  215. 推荐: '列表1;列表2;标题;图片;描述;链接;详情',
  216. 一级: '列表;标题;图片;描述;链接;详情',
  217. 二级: {
  218. title: 'vod_name;vod_type',
  219. img: '图片链接',
  220. desc: '主要信息;年代;地区;演员;导演',
  221. content: '简介',
  222. tabs: '',
  223. lists: 'xx:eq(#id)&&a',
  224. tab_text: 'body&&Text',
  225. list_text: 'body&&Text',
  226. list_url: 'a&&href',
  227. },
  228. 搜索: '列表;标题;图片;描述;链接;详情',
  229. }, vfed: {
  230. title: '',
  231. host: '',
  232. url: '/index.php/vod/show/id/fyclass/page/fypage.html',
  233. searchUrl: '/index.php/vod/search/page/fypage/wd/**.html',
  234. searchable: 2,//是否启用全局搜索,
  235. quickSearch: 0,//是否启用快速搜索,
  236. filterable: 0,//是否启用分类筛选,
  237. headers: {
  238. 'User-Agent': 'UC_UA',
  239. },
  240. class_parse: '.fed-pops-navbar&&ul.fed-part-rows&&a;a&&Text;a&&href;.*/(.*?).html',
  241. play_parse: true,
  242. lazy: common_lazy,
  243. limit: 6,
  244. double: true, // 推荐内容是否双层定位
  245. 推荐: 'ul.fed-list-info.fed-part-rows;li;a.fed-list-title&&Text;a&&data-original;.fed-list-remarks&&Text;a&&href',
  246. 一级: '.fed-list-info&&li;a.fed-list-title&&Text;a&&data-original;.fed-list-remarks&&Text;a&&href',
  247. 二级: {
  248. title: 'h1.fed-part-eone&&Text;.fed-deta-content&&.fed-part-rows&&li&&Text',
  249. img: '.fed-list-info&&a&&data-original',
  250. desc: '.fed-deta-content&&.fed-part-rows&&li:eq(1)&&Text;.fed-deta-content&&.fed-part-rows&&li:eq(2)&&Text;.fed-deta-content&&.fed-part-rows&&li:eq(3)&&Text',
  251. content: '.fed-part-esan&&Text',
  252. tabs: '.fed-drop-boxs&&.fed-part-rows&&li',
  253. lists: '.fed-play-item:eq(#id)&&ul:eq(1)&&li',
  254. },
  255. 搜索: '.fed-deta-info;h1&&Text;.lazyload&&data-original;.fed-list-remarks&&Text;a&&href;.fed-deta-content&&Text',
  256. }, 海螺3: {
  257. title: '',
  258. host: '',
  259. searchUrl: '/v_search/**----------fypage---.html',
  260. url: '/vod_____show/fyclass--------fypage---.html',
  261. headers: {
  262. 'User-Agent': 'MOBILE_UA',
  263. },
  264. timeout: 5000,
  265. class_parse: 'body&&.hl-nav li:gt(0);a&&Text;a&&href;.*/(.*?).html',
  266. cate_exclude: '明星|专题|最新|排行',
  267. limit: 40,
  268. play_parse: true,
  269. lazy: common_lazy,
  270. double: true,
  271. 推荐: '.hl-vod-list;li;a&&title;a&&data-original;.remarks&&Text;a&&href',
  272. 一级: '.hl-vod-list&&.hl-list-item;a&&title;a&&data-original;.remarks&&Text;a&&href',
  273. 二级: {
  274. title: '.hl-dc-title&&Text;.hl-dc-content&&li:eq(6)&&Text',
  275. img: '.hl-lazy&&data-original',
  276. desc: '.hl-dc-content&&li:eq(10)&&Text;.hl-dc-content&&li:eq(4)&&Text;.hl-dc-content&&li:eq(5)&&Text;.hl-dc-content&&li:eq(2)&&Text;.hl-dc-content&&li:eq(3)&&Text',
  277. content: '.hl-content-text&&Text',
  278. tabs: '.hl-tabs&&a',
  279. tab_text: 'a--span&&Text',
  280. lists: '.hl-plays-list:eq(#id)&&li',
  281. },
  282. 搜索: '.hl-list-item;a&&title;a&&data-original;.remarks&&Text;a&&href',
  283. searchable: 2,//是否启用全局搜索,
  284. quickSearch: 0,//是否启用快速搜索,
  285. filterable: 0,//是否启用分类筛选,
  286. }, 海螺2: {
  287. title: '',
  288. host: '',
  289. searchUrl: '/index.php/vod/search/page/fypage/wd/**/',
  290. url: '/index.php/vod/show/id/fyclass/page/fypage/',
  291. headers: {
  292. 'User-Agent': 'MOBILE_UA',
  293. },
  294. timeout: 5000,
  295. class_parse: '#nav-bar li;a&&Text;a&&href;id/(.*?)/',
  296. limit: 40,
  297. play_parse: true,
  298. lazy: common_lazy,
  299. double: true,
  300. 推荐: '.list-a.size;li;a&&title;.lazy&&data-original;.bt&&Text;a&&href',
  301. 一级: '.list-a&&li;a&&title;.lazy&&data-original;.list-remarks&&Text;a&&href',
  302. 二级: {
  303. title: 'h2&&Text;.deployment&&Text',
  304. img: '.lazy&&data-original',
  305. desc: '.deployment&&Text',
  306. content: '.ec-show&&Text',
  307. tabs: '#tag&&a',
  308. lists: '.play_list_box:eq(#id)&&li',
  309. },
  310. 搜索: '.search-list;a&&title;.lazy&&data-original;.deployment&&Text;a&&href',
  311. searchable: 2,//是否启用全局搜索,
  312. quickSearch: 0,//是否启用快速搜索,
  313. filterable: 0,//是否启用分类筛选,
  314. }, 短视: {
  315. title: '',
  316. host: '', // homeUrl:'/',
  317. url: '/channel/fyclass-fypage.html',
  318. searchUrl: '/search.html?wd=**',
  319. searchable: 2,//是否启用全局搜索,
  320. quickSearch: 0,//是否启用快速搜索,
  321. filterable: 0,//是否启用分类筛选,
  322. headers: {//网站的请求头,完整支持所有的,常带ua和cookies
  323. 'User-Agent': 'MOBILE_UA', // "Cookie": "searchneed=ok"
  324. },
  325. class_parse: '.menu_bottom ul li;a&&Text;a&&href;.*/(.*?).html',
  326. cate_exclude: '解析|动态',
  327. play_parse: true,
  328. lazy: common_lazy,
  329. limit: 6,
  330. double: true, // 推荐内容是否双层定位
  331. 推荐: '.indexShowBox;ul&&li;a&&title;img&&data-src;.s1&&Text;a&&href',
  332. 一级: '.pic-list&&li;a&&title;img&&data-src;.s1&&Text;a&&href',
  333. 二级: {
  334. title: 'h1&&Text;.content-rt&&p:eq(0)&&Text',
  335. img: '.img&&img&&data-src',
  336. desc: '.content-rt&&p:eq(1)&&Text;.content-rt&&p:eq(2)&&Text;.content-rt&&p:eq(3)&&Text;.content-rt&&p:eq(4)&&Text;.content-rt&&p:eq(5)&&Text',
  337. content: '.zkjj_a&&Text',
  338. tabs: '.py-tabs&&option',
  339. lists: '.player:eq(#id) li',
  340. },
  341. 搜索: '.sr_lists&&ul&&li;h3&&Text;img&&data-src;.int&&p:eq(0)&&Text;a&&href',
  342. }, 短视2: {
  343. title: '',
  344. host: '',
  345. class_name: '电影&电视剧&综艺&动漫',
  346. class_url: '1&2&3&4',
  347. searchUrl: '/index.php/ajax/suggest?mid=1&wd=**&limit=50',
  348. searchable: 2,
  349. quickSearch: 0,
  350. headers: {'User-Agent': 'MOBILE_UA'},
  351. url: '/index.php/api/vod#type=fyclass&page=fypage',
  352. filterable: 0,//是否启用分类筛选,
  353. filter_url: '',
  354. filter: {},
  355. filter_def: {},
  356. detailUrl: '/index.php/vod/detail/id/fyid.html',
  357. play_parse: true,
  358. lazy: common_lazy,
  359. limit: 6,
  360. 推荐: '.list-vod.flex .public-list-box;a&&title;.lazy&&data-original;.public-list-prb&&Text;a&&href',
  361. 一级: 'js:let body=input.split("#")[1];let t=Math.round(new Date/1e3).toString();let key=md5("DS"+t+"DCC147D11943AF75");let url=input.split("#")[0];body=body+"&time="+t+"&key="+key;print(body);fetch_params.body=body;let html=post(url,fetch_params);let data=JSON.parse(html);VODS=data.list.map(function(it){it.vod_pic=urljoin2(input.split("/i")[0],it.vod_pic);return it});',
  362. 二级: {
  363. title: '.slide-info-title&&Text;.slide-info:eq(2)--strong&&Text',
  364. img: '.detail-pic&&data-original',
  365. desc: '.slide-info-remarks&&Text;.slide-info-remarks:eq(1)&&Text;.slide-info-remarks:eq(2)&&Text;.slide-info:eq(1)--strong&&Text;.info-parameter&&ul&&li:eq(3)&&Text',
  366. content: '#height_limit&&Text',
  367. tabs: '.anthology.wow.fadeInUp.animated&&.swiper-wrapper&&a',
  368. tab_text: 'a--span&&Text',
  369. lists: '.anthology-list-box:eq(#id) li',
  370. },
  371. 搜索: 'json:list;name;pic;;id',
  372. }, 采集1: {
  373. title: '',
  374. host: '',
  375. homeTid: '13',
  376. homeUrl: '/api.php/provide/vod/?ac=detail&t={{rule.homeTid}}',
  377. detailUrl: '/api.php/provide/vod/?ac=detail&ids=fyid',
  378. searchUrl: '/api.php/provide/vod/?wd=**&pg=fypage',
  379. url: '/api.php/provide/vod/?ac=detail&pg=fypage&t=fyclass',
  380. headers: {'User-Agent': 'MOBILE_UA'},
  381. timeout: 5000, // class_name: '电影&电视剧&综艺&动漫',
  382. // class_url: '1&2&3&4',
  383. // class_parse:'js:let html=request(input);input=JSON.parse(html).class;',
  384. class_parse: 'json:class;',
  385. limit: 20,
  386. multi: 1,
  387. searchable: 2,//是否启用全局搜索,
  388. quickSearch: 1,//是否启用快速搜索,
  389. filterable: 0,//是否启用分类筛选,
  390. play_parse: true,
  391. parse_url: '',
  392. lazy: cj_lazy,
  393. 推荐: '*',
  394. 一级: 'json:list;vod_name;vod_pic;vod_remarks;vod_id;vod_play_from',
  395. 二级: `js:
  396. let html=request(input);
  397. html=JSON.parse(html);
  398. let data=html.list;
  399. VOD=data[0];`,
  400. 搜索: '*',
  401. },
  402. };
  403. return JSON.parse(JSON.stringify(mubanDict));
  404. }
  405. var mubanDict = getMubans();
  406. var muban = getMubans();
  407. export default {muban, getMubans};