mr.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. var rule = {
  2. title: '黑木耳资源',//规则标题,没有实际作用,但是可以作为cms类名称依据
  3. 编码: '',//不填就默认utf-8
  4. 搜索编码: '',//不填则不编码,默认都是按utf-8.可优先于全局编码属性.比如网页源码编码是gbk,这里可以指定utf-8搜索独立编码。多数情况这个属性不填或者填写gbk应对特殊的网站搜索
  5. host: 'https://heimuer.tv',//网页的域名根,包含http头如 https://www,baidu.com
  6. //url: '/api.php/provide/vod?ac=detail&t=fyclass&pg=fypage&f=',//网站的分类页面链接
  7. url: '/index.php/ajax/data?mid=1&tid=fyfilter&page=fypage&limit=20',//网站的分类页面链接
  8. class_name: '电影&电视剧&动漫&综艺&短剧',//静态分类名称拼接
  9. class_url: '1&2&3&4&27',//静态分类标识拼接
  10. homeUrl: '/api.php/provide/vod?ac=detail',//网站的首页链接,可以是完整路径或者相对路径,用于分类获取和推荐获取 fyclass是分类标签 fypage是页数
  11. searchUrl: '/api.php/provide/vod?ac=detail&wd=**&pg=fypage', //搜索链接 可以是完整路径或者相对路径,用于分类获取和推荐获取 **代表搜索词 fypage代表页数
  12. detailUrl: '/api.php/provide/vod?ac=detail&ids=fyid', //非必填,二级详情拼接链接,感觉没啥卵用
  13. searchable: 2,//是否启用全局搜索,
  14. quickSearch: 0,//是否启用快速搜索,
  15. filterable: 1,//是否启用筛选,
  16. filter_url: '{{fl.cateId}}',
  17. filter: {
  18. "1": [{ "key": "cateId", "name": "剧情", "value": [{ "n": "全部", "v": "" }, { "n": "剧情片", "v": "6" }, { "n": "动作片", "v": "7" }, { "n": "冒险", "v": "8" }, { "n": "同性", "v": "9" }, { "n": "喜剧", "v": "10" }, { "n": "奇幻", "v": "11" }, { "n": "恐怖", "v": "12" }, { "n": "悬疑", "v": "20" }, { "n": "惊悚", "v": "21" }, { "n": "灾难", "v": "22" }, { "n": "爱情", "v": "23" }, { "n": "犯罪", "v": "24" }, { "n": "科幻", "v": "25" }, { "n": "动画电影", "v": "26" }, { "n": "歌舞", "v": "33" }, { "n": "战争", "v": "34" }, { "n": "经典", "v": "35" }, { "n": "网络电影", "v": "36" }, { "n": "其它", "v": "37" }] }],
  19. "2": [{ "key": "cateId", "name": "剧情", "value": [{ "n": "全部", "v": "" }, { "n": "国产剧", "v": "13" }, { "n": "港剧", "v": "14" }, { "n": "韩剧", "v": "15" }, { "n": "日剧", "v": "16" }, { "n": "泰剧", "v": "28" }, { "n": "台剧", "v": "29" }, { "n": "欧美剧", "v": "30" }, { "n": "新马剧", "v": "31" }, { "n": "其他剧", "v": "32" }] }],
  20. "4": [{ "key": "cateId", "name": "剧情", "value": [{ "n": "全部", "v": "" }, { "n": "国产综艺", "v": "38" }, { "n": "港台综艺", "v": "39" }, { "n": "韩国综艺", "v": "40" }, { "n": "日本综艺", "v": "41" }, { "n": "欧美综艺", "v": "42" }, { "n": "新马泰综艺", "v": "43" }, { "n": "其他综艺", "v": "44" }] }],
  21. "3": [{ "key": "cateId", "name": "剧情", "value": [{ "n": "全部", "v": "" }, { "n": "欧美", "v": "57" }, { "n": "日本", "v": "58" }, { "n": "韩国", "v": "59" }, { "n": "国产", "v": "60" }, { "n": "港台", "v": "61" }, { "n": "新马泰", "v": "62" }, { "n": "其它", "v": "63" }] }]
  22. },
  23. filter_def:{
  24. 1:{cateId:'1'},
  25. 2:{cateId:'2'},
  26. 4:{cateId:'4'},
  27. 3:{cateId:'3'},
  28. 27:{cateId:'27'}
  29. },
  30. play_parse: false,
  31. lazy: '',
  32. multi: 1,
  33. timeout: 5000,//网站的全局请求超时,默认是3000毫秒
  34. limit: 20,// 首页推荐显示数量
  35. 推荐: 'json:list;vod_name;vod_pic;vod_remarks;vod_id', // double: true, // 推荐内容是否双层定位
  36. 一级: 'json:list;vod_name;vod_pic;vod_remarks;vod_id',
  37. /**
  38. * 资源采集站,二级链接解析
  39. */
  40. //二级: `json:list;vod_name;vod_pic;vod_remarks;vod_id`,
  41. 二级: `js:
  42. let html = request(input);
  43. let list = JSON.parse(html).list;
  44. if(list.length===1){
  45. VOD = list[0];
  46. VOD.vod_blurb = VOD.vod_blurb.replace(/ /g, '').replace(/<[^>]*>/g, '');
  47. VOD.vod_content = VOD.vod_content.replace(/ /g, '').replace(/<[^>]*>/g, '');
  48. }
  49. `,
  50. /**
  51. * 搜索解析 过滤部分资源
  52. */
  53. 搜索: 'json:list;vod_name;vod_pic;vod_remarks;vod_id',
  54. }