模板.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  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. },
  113. mxone5: {
  114. title: '',
  115. host: '',
  116. url: '/show/fyclass--------fypage---.html',
  117. searchUrl: '/search/**----------fypage---.html',
  118. searchable: 2, //是否启用全局搜索,
  119. quickSearch: 0, //是否启用快速搜索,
  120. filterable: 0, //是否启用分类筛选,
  121. class_parse: '.nav-menu-items&&li;a&&Text;a&&href;.*/(.*?)\.html',
  122. play_parse: true,
  123. lazy: common_lazy,
  124. limit: 6,
  125. double: true, // 推荐内容是否双层定位
  126. 推荐: '.module-list;.module-items&&.module-item;a&&title;img&&data-src;.module-item-text&&Text;a&&href',
  127. 一级: '.module-items .module-item;a&&title;img&&data-src;.module-item-text&&Text;a&&href',
  128. 二级: {
  129. title: 'h1&&Text;.tag-link&&Text',
  130. img: '.module-item-pic&&img&&data-src',
  131. 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',
  132. content: '.vod_content&&Text',
  133. tabs: '.module-tab-item',
  134. lists: '.module-player-list:eq(#id)&&.scroll-content&&a',
  135. tab_text: 'div--small&&Text',
  136. },
  137. 搜索: '.module-items .module-search-item;a&&title;img&&data-src;.video-serial&&Text;a&&href',
  138. },
  139. 首图: {
  140. title: '',
  141. host: '',
  142. url: '/vodshow/fyclass--------fypage---/',
  143. searchUrl: '/vodsearch/**----------fypage---.html',
  144. searchable: 2, //是否启用全局搜索,
  145. quickSearch: 0, //是否启用快速搜索,
  146. filterable: 0, //是否启用分类筛选,
  147. headers: { //网站的请求头,完整支持所有的,常带ua和cookies
  148. 'User-Agent': 'MOBILE_UA', // "Cookie": "searchneed=ok"
  149. },
  150. class_parse: '.myui-header__menu li.hidden-sm:gt(0):lt(7);a&&Text;a&&href;/(\\d+).html',
  151. play_parse: true,
  152. lazy: common_lazy,
  153. limit: 6,
  154. double: true, // 推荐内容是否双层定位
  155. 推荐: 'ul.myui-vodlist.clearfix;li;a&&title;a&&data-original;.pic-text&&Text;a&&href',
  156. 一级: '.myui-vodlist li;a&&title;a&&data-original;.pic-text&&Text;a&&href',
  157. 二级: {
  158. title: '.myui-content__detail .title--span&&Text;.myui-content__detail p.data:eq(3)&&Text',
  159. img: '.myui-content__thumb .lazyload&&data-original',
  160. 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',
  161. content: '.content&&Text',
  162. tabs: '.myui-panel__head&&li',
  163. // tabs: '.nav-tabs&&li',
  164. lists: '.myui-content__list:eq(#id) li',
  165. },
  166. 搜索: '#searchList li;a&&title;.lazyload&&data-original;.pic-text&&Text;a&&href;.detail&&Text',
  167. },
  168. 首图2: {
  169. title: '',
  170. host: '',
  171. url: '/list/fyclass-fypage.html',
  172. searchUrl: '/vodsearch/**----------fypage---.html',
  173. searchable: 2, //是否启用全局搜索,
  174. quickSearch: 0, //是否启用快速搜索,
  175. filterable: 0, //是否启用分类筛选,
  176. headers: {
  177. 'User-Agent': 'UC_UA', // "Cookie": ""
  178. },
  179. class_parse: '.stui-header__menu li:gt(0):lt(7);a&&Text;a&&href;.*/(.*?).html',
  180. play_parse: true,
  181. lazy: common_lazy,
  182. limit: 6,
  183. double: true, // 推荐内容是否双层定位
  184. 推荐: 'ul.stui-vodlist.clearfix;li;a&&title;.lazyload&&data-original;.pic-text&&Text;a&&href',
  185. 一级: '.stui-vodlist li;a&&title;a&&data-original;.pic-text&&Text;a&&href',
  186. 二级: {
  187. title: '.stui-content__detail .title&&Text;.stui-content__detail&&p:eq(-2)&&a&&Text',
  188. title1: '.stui-content__detail .title&&Text;.stui-content__detail&&p&&Text',
  189. img: '.stui-content__thumb .lazyload&&data-original',
  190. 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',
  191. desc1: '.stui-content__detail p:eq(4)&&Text;;;.stui-content__detail p:eq(1)&&Text',
  192. content: '.detail&&Text',
  193. tabs: '.stui-pannel__head h3',
  194. tabs1: '.stui-vodlist__head h3',
  195. lists: '.stui-content__playlist:eq(#id) li',
  196. },
  197. 搜索: 'ul.stui-vodlist__media,ul.stui-vodlist,#searchList li;a&&title;.lazyload&&data-original;.pic-text&&Text;a&&href;.detail&&Text',
  198. },
  199. 默认: {
  200. title: '',
  201. host: '',
  202. url: '',
  203. searchUrl: '',
  204. searchable: 2,
  205. quickSearch: 0,
  206. filterable: 0,
  207. filter: '',
  208. filter_url: '',
  209. filter_def: {},
  210. headers: {
  211. 'User-Agent': 'MOBILE_UA',
  212. },
  213. timeout: 5000,
  214. class_parse: '#side-menu li;a&&Text;a&&href;/(.*?)\.html',
  215. cate_exclude: '',
  216. play_parse: true,
  217. lazy: def_lazy,
  218. double: true,
  219. 推荐: '列表1;列表2;标题;图片;描述;链接;详情',
  220. 一级: '列表;标题;图片;描述;链接;详情',
  221. 二级: {
  222. title: 'vod_name;vod_type',
  223. img: '图片链接',
  224. desc: '主要信息;年代;地区;演员;导演',
  225. content: '简介',
  226. tabs: '',
  227. lists: 'xx:eq(#id)&&a',
  228. tab_text: 'body&&Text',
  229. list_text: 'body&&Text',
  230. list_url: 'a&&href',
  231. },
  232. 搜索: '列表;标题;图片;描述;链接;详情',
  233. },
  234. vfed: {
  235. title: '',
  236. host: '',
  237. url: '/index.php/vod/show/id/fyclass/page/fypage.html',
  238. searchUrl: '/index.php/vod/search/page/fypage/wd/**.html',
  239. searchable: 2, //是否启用全局搜索,
  240. quickSearch: 0, //是否启用快速搜索,
  241. filterable: 0, //是否启用分类筛选,
  242. headers: {
  243. 'User-Agent': 'UC_UA',
  244. },
  245. class_parse: '.fed-pops-navbar&&ul.fed-part-rows&&a;a&&Text;a&&href;.*/(.*?).html',
  246. play_parse: true,
  247. lazy: common_lazy,
  248. limit: 6,
  249. double: true, // 推荐内容是否双层定位
  250. 推荐: 'ul.fed-list-info.fed-part-rows;li;a.fed-list-title&&Text;a&&data-original;.fed-list-remarks&&Text;a&&href',
  251. 一级: '.fed-list-info&&li;a.fed-list-title&&Text;a&&data-original;.fed-list-remarks&&Text;a&&href',
  252. 二级: {
  253. title: 'h1.fed-part-eone&&Text;.fed-deta-content&&.fed-part-rows&&li&&Text',
  254. img: '.fed-list-info&&a&&data-original',
  255. 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',
  256. content: '.fed-part-esan&&Text',
  257. tabs: '.fed-drop-boxs&&.fed-part-rows&&li',
  258. lists: '.fed-play-item:eq(#id)&&ul:eq(1)&&li',
  259. },
  260. 搜索: '.fed-deta-info;h1&&Text;.lazyload&&data-original;.fed-list-remarks&&Text;a&&href;.fed-deta-content&&Text',
  261. },
  262. 海螺3: {
  263. title: '',
  264. host: '',
  265. searchUrl: '/v_search/**----------fypage---.html',
  266. url: '/vod_____show/fyclass--------fypage---.html',
  267. headers: {
  268. 'User-Agent': 'MOBILE_UA',
  269. },
  270. timeout: 5000,
  271. class_parse: 'body&&.hl-nav li:gt(0);a&&Text;a&&href;.*/(.*?).html',
  272. cate_exclude: '明星|专题|最新|排行',
  273. limit: 40,
  274. play_parse: true,
  275. lazy: common_lazy,
  276. double: true,
  277. 推荐: '.hl-vod-list;li;a&&title;a&&data-original;.remarks&&Text;a&&href',
  278. 一级: '.hl-vod-list&&.hl-list-item;a&&title;a&&data-original;.remarks&&Text;a&&href',
  279. 二级: {
  280. title: '.hl-dc-title&&Text;.hl-dc-content&&li:eq(6)&&Text',
  281. img: '.hl-lazy&&data-original',
  282. 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',
  283. content: '.hl-content-text&&Text',
  284. tabs: '.hl-tabs&&a',
  285. tab_text: 'a--span&&Text',
  286. lists: '.hl-plays-list:eq(#id)&&li',
  287. },
  288. 搜索: '.hl-list-item;a&&title;a&&data-original;.remarks&&Text;a&&href',
  289. searchable: 2, //是否启用全局搜索,
  290. quickSearch: 0, //是否启用快速搜索,
  291. filterable: 0, //是否启用分类筛选,
  292. },
  293. 海螺2: {
  294. title: '',
  295. host: '',
  296. searchUrl: '/index.php/vod/search/page/fypage/wd/**/',
  297. url: '/index.php/vod/show/id/fyclass/page/fypage/',
  298. headers: {
  299. 'User-Agent': 'MOBILE_UA',
  300. },
  301. timeout: 5000,
  302. class_parse: '#nav-bar li;a&&Text;a&&href;id/(.*?)/',
  303. limit: 40,
  304. play_parse: true,
  305. lazy: common_lazy,
  306. double: true,
  307. 推荐: '.list-a.size;li;a&&title;.lazy&&data-original;.bt&&Text;a&&href',
  308. 一级: '.list-a&&li;a&&title;.lazy&&data-original;.list-remarks&&Text;a&&href',
  309. 二级: {
  310. title: 'h2&&Text;.deployment&&Text',
  311. img: '.lazy&&data-original',
  312. desc: '.deployment&&Text',
  313. content: '.ec-show&&Text',
  314. tabs: '#tag&&a',
  315. lists: '.play_list_box:eq(#id)&&li',
  316. },
  317. 搜索: '.search-list;a&&title;.lazy&&data-original;.deployment&&Text;a&&href',
  318. searchable: 2, //是否启用全局搜索,
  319. quickSearch: 0, //是否启用快速搜索,
  320. filterable: 0, //是否启用分类筛选,
  321. },
  322. 短视: {
  323. title: '',
  324. host: '', // homeUrl:'/',
  325. url: '/channel/fyclass-fypage.html',
  326. searchUrl: '/search.html?wd=**',
  327. searchable: 2, //是否启用全局搜索,
  328. quickSearch: 0, //是否启用快速搜索,
  329. filterable: 0, //是否启用分类筛选,
  330. headers: { //网站的请求头,完整支持所有的,常带ua和cookies
  331. 'User-Agent': 'MOBILE_UA', // "Cookie": "searchneed=ok"
  332. },
  333. class_parse: '.menu_bottom ul li;a&&Text;a&&href;.*/(.*?).html',
  334. cate_exclude: '解析|动态',
  335. play_parse: true,
  336. lazy: common_lazy,
  337. limit: 6,
  338. double: true, // 推荐内容是否双层定位
  339. 推荐: '.indexShowBox;ul&&li;a&&title;img&&data-src;.s1&&Text;a&&href',
  340. 一级: '.pic-list&&li;a&&title;img&&data-src;.s1&&Text;a&&href',
  341. 二级: {
  342. title: 'h1&&Text;.content-rt&&p:eq(0)&&Text',
  343. img: '.img&&img&&data-src',
  344. 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',
  345. content: '.zkjj_a&&Text',
  346. tabs: '.py-tabs&&option',
  347. lists: '.player:eq(#id) li',
  348. },
  349. 搜索: '.sr_lists&&ul&&li;h3&&Text;img&&data-src;.int&&p:eq(0)&&Text;a&&href',
  350. },
  351. 短视2: {
  352. title: '',
  353. host: '',
  354. class_name: '电影&电视剧&综艺&动漫',
  355. class_url: '1&2&3&4',
  356. searchUrl: '/index.php/ajax/suggest?mid=1&wd=**&limit=50',
  357. searchable: 2,
  358. quickSearch: 0,
  359. headers: {
  360. 'User-Agent': 'MOBILE_UA'
  361. },
  362. url: '/index.php/api/vod#type=fyclass&page=fypage',
  363. filterable: 0, //是否启用分类筛选,
  364. filter_url: '',
  365. filter: {},
  366. filter_def: {},
  367. detailUrl: '/index.php/vod/detail/id/fyid.html',
  368. play_parse: true,
  369. lazy: common_lazy,
  370. limit: 6,
  371. 推荐: '.list-vod.flex .public-list-box;a&&title;.lazy&&data-original;.public-list-prb&&Text;a&&href',
  372. 一级: '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});',
  373. 二级: {
  374. title: '.slide-info-title&&Text;.slide-info:eq(2)--strong&&Text',
  375. img: '.detail-pic&&data-original',
  376. 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',
  377. content: '#height_limit&&Text',
  378. tabs: '.anthology.wow.fadeInUp.animated&&.swiper-wrapper&&a',
  379. tab_text: 'a--span&&Text',
  380. lists: '.anthology-list-box:eq(#id) li',
  381. },
  382. 搜索: 'json:list;name;pic;;id',
  383. },
  384. 采集1: {
  385. title: '',
  386. host: '',
  387. homeTid: '13',
  388. homeUrl: '/api.php/provide/vod/?ac=detail&t={{rule.homeTid}}',
  389. detailUrl: '/api.php/provide/vod/?ac=detail&ids=fyid',
  390. searchUrl: '/api.php/provide/vod/?wd=**&pg=fypage',
  391. url: '/api.php/provide/vod/?ac=detail&pg=fypage&t=fyclass',
  392. headers: {
  393. 'User-Agent': 'MOBILE_UA'
  394. },
  395. timeout: 5000, // class_name: '电影&电视剧&综艺&动漫',
  396. // class_url: '1&2&3&4',
  397. // class_parse:'js:let html=request(input);input=JSON.parse(html).class;',
  398. class_parse: 'json:class;',
  399. limit: 20,
  400. multi: 1,
  401. searchable: 2, //是否启用全局搜索,
  402. quickSearch: 1, //是否启用快速搜索,
  403. filterable: 0, //是否启用分类筛选,
  404. play_parse: true,
  405. parse_url: '',
  406. lazy: cj_lazy,
  407. 推荐: '*',
  408. 一级: 'json:list;vod_name;vod_pic;vod_remarks;vod_id;vod_play_from',
  409. 二级: `js:
  410. let html=request(input);
  411. html=JSON.parse(html);
  412. let data=html.list;
  413. VOD=data[0];`,
  414. 搜索: '*',
  415. },
  416. };
  417. return JSON.parse(JSON.stringify(mubanDict));
  418. }
  419. var mubanDict = getMubans();
  420. var muban = getMubans();
  421. export default {
  422. muban,
  423. getMubans
  424. };