酷云77.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. // 注意事项:此源仅支持tvbox的js1以及c#版drpy的js0,暂不支持drpy官方py版的js0
  2. // 注入全局方法,方便
  3. globalThis.getTime = function(){
  4. let ts= Math.round(new Date().getTime()/1000).toString();
  5. log('获取时间戳:'+ts);
  6. return ts
  7. }
  8. globalThis.getHeaders= function(input,ts){
  9. let tkstr=input.split('?')[1].split('&').map(function(it){
  10. return it.split('=')[1]
  11. }).join('');
  12. tkstr=input.split('?')[0].replace('https://api.tyun77.cn','')+tkstr+ts+'XSpeUFjJ';
  13. log('tk加密前:'+tkstr);
  14. let TK=md5(tkstr);
  15. log('tk加密后:'+TK);
  16. let headers={
  17. "User-Agent":"okhttp/3.12.0",
  18. "TK":TK
  19. };
  20. return headers
  21. }
  22. var rule = {
  23. title:'酷云77',
  24. host:'https://api.tyun77.cn',
  25. hostJs:'let html=request(HOST+"/api.php/provide/getDomain");',
  26. homeUrl:'/api.php/provide/homeBlock?type_id=0',
  27. searchUrl:'/api.php/provide/searchVideo?searchName=**',
  28. searchable:2,
  29. quickSearch:0,
  30. filterable:1,
  31. multi:1,
  32. // 分类链接fypage参数支持1个()表达式
  33. // url:'/api.php/provide/searchFilter?type_id=fyclass&pagesize=24&pagenum=fypage', // 旧的写法注释掉
  34. url:'/api.php/provide/searchFilter?devid=453CA5D864457C7DB4D0EAA93DE96E66&package=com.sevenVideo.app.android&pagenum=fypage&pagesize=24&version=&sj=$ts&type_id=fyclass',
  35. // detailUrl:'/api.php/provide/videoDetail?devid=453CA5D864457C7DB4D0EAA93DE96E66&package=com.sevenVideo.app.android&version=&ids=fyid', //旧的写法注释掉
  36. detailUrl:'/api.php/provide/videoDetail?devid=453CA5D864457C7DB4D0EAA93DE96E66&ids=fyid&package=com.sevenVideo.app.android&version=',
  37. filter_url:'year={{fl.y}}&category={{fl.scat}}&area={{fl.a}}',
  38. filter:{0: [{'key': 'y', 'name': '年代', 'value': [{'n': '全部', 'v': ''},{'n': '2023', 'v': '2023'}, {'n': '2022', 'v': '2022'}, {'n': '2021', 'v': '2021'}, {'n': '2020', 'v': '2020'}, {'n': '2019', 'v': '2019'}, {'n': '2018', 'v': '2018'}, {'n': '2017', 'v': '2017'}, {'n': '2016', 'v': '2016'}, {'n': '2015', 'v': '2015'}, {'n': '2015之前', 'v': 'lt|2015'}]}, {'key': 'a', 'name': '地区', 'value': [{'n': '全部', 'v': ''}, {'n': '中国大陆', 'v': '中国大陆'}, {'n': '美国', 'v': '美国'}, {'n': '日本', 'v': '日本'}, {'n': '中国香港', 'v': '中国香港'}, {'n': '中国台湾', 'v': '中国台湾'}, {'n': '韩国', 'v': '韩国'}, {'n': '欧洲', 'v': '欧洲'}, {'n': '其他', 'v': '泰国'}]}, {'key': 'scat', 'name': '类型', 'value': [{'n': '全部', 'v': ''}, {'n': '剧情', 'v': '剧情'}, {'n': '动作', 'v': '动作'}, {'n': '科幻', 'v': '科幻'}, {'n': '喜剧', 'v': '喜剧'}, {'n': '战争', 'v': '战争'}, {'n': '爱情', 'v': '爱情'}, {'n': '恐怖', 'v': '恐怖'}, {'n': '伦理', 'v': '伦理'}]}], 1: [{'key': 'y', 'name': '年代', 'value': [{'n': '全部', 'v': ''},{'n': '2023', 'v': '2023'}, {'n': '2022', 'v': '2022'}, {'n': '2021', 'v': '2021'}, {'n': '2020', 'v': '2020'}, {'n': '2019', 'v': '2019'}, {'n': '2018', 'v': '2018'}, {'n': '2017', 'v': '2017'}, {'n': '2016', 'v': '2016'}, {'n': '2015', 'v': '2015'}, {'n': '2015之前', 'v': 'lt|2015'}]}, {'key': 'a', 'name': '地区', 'value': [{'n': '全部', 'v': ''}, {'n': '中国大陆', 'v': '中国大陆'}, {'n': '美国', 'v': '美国'}, {'n': '日本', 'v': '日本'}, {'n': '中国香港', 'v': '中国香港'}, {'n': '中国台湾', 'v': '中国台湾'}, {'n': '韩国', 'v': '韩国'}, {'n': '欧洲', 'v': '欧洲'}, {'n': '其他', 'v': '泰国'}]}, {'key': 'scat', 'name': '类型', 'value': [{'n': '全部', 'v': ''}, {'n': '剧情', 'v': '剧情'}, {'n': '动作', 'v': '动作'}, {'n': '科幻', 'v': '科幻'}, {'n': '喜剧', 'v': '喜剧'}, {'n': '战争', 'v': '战争'}, {'n': '爱情', 'v': '爱情'}, {'n': '恐怖', 'v': '恐怖'}, {'n': '伦理', 'v': '伦理'}]}], 2: [{'key': 'y', 'name': '年代', 'value': [{'n': '全部', 'v': ''},{'n': '2023', 'v': '2023'}, {'n': '2022', 'v': '2022'}, {'n': '2021', 'v': '2021'}, {'n': '2020', 'v': '2020'}, {'n': '2019', 'v': '2019'}, {'n': '2018', 'v': '2018'}, {'n': '2017', 'v': '2017'}, {'n': '2016', 'v': '2016'}, {'n': '2015', 'v': '2015'}, {'n': '2015之前', 'v': 'lt|2015'}]}, {'key': 'a', 'name': '地区', 'value': [{'n': '全部', 'v': ''}, {'n': '中国大陆', 'v': '中国大陆'}, {'n': '美国', 'v': '美国'}, {'n': '日本', 'v': '日本'}, {'n': '中国香港', 'v': '中国香港'}, {'n': '中国台湾', 'v': '中国台湾'}, {'n': '韩国', 'v': '韩国'}, {'n': '欧洲', 'v': '欧洲'}, {'n': '其他', 'v': '泰国'}]}, {'key': 'scat', 'name': '类型', 'value': [{'n': '全部', 'v': ''}, {'n': '剧情', 'v': '剧情'}, {'n': '动作', 'v': '动作'}, {'n': '科幻', 'v': '科幻'}, {'n': '喜剧', 'v': '喜剧'}, {'n': '战争', 'v': '战争'}, {'n': '爱情', 'v': '爱情'}, {'n': '恐怖', 'v': '恐怖'}, {'n': '伦理', 'v': '伦理'}]}], 3: [{'key': 'y', 'name': '年代', 'value': [{'n': '全部', 'v': ''},{'n': '2023', 'v': '2023'}, {'n': '2022', 'v': '2022'}, {'n': '2021', 'v': '2021'}, {'n': '2020', 'v': '2020'}, {'n': '2019', 'v': '2019'}, {'n': '2018', 'v': '2018'}, {'n': '2017', 'v': '2017'}, {'n': '2016', 'v': '2016'}, {'n': '2015', 'v': '2015'}, {'n': '2015之前', 'v': 'lt|2015'}]}, {'key': 'a', 'name': '地区', 'value': [{'n': '全部', 'v': ''}, {'n': '中国大陆', 'v': '中国大陆'}, {'n': '美国', 'v': '美国'}, {'n': '日本', 'v': '日本'}, {'n': '中国香港', 'v': '中国香港'}, {'n': '中国台湾', 'v': '中国台湾'}, {'n': '韩国', 'v': '韩国'}, {'n': '欧洲', 'v': '欧洲'}, {'n': '其他', 'v': '泰国'}]}, {'key': 'scat', 'name': '类型', 'value': [{'n': '全部', 'v': ''}, {'n': '剧情', 'v': '剧情'}, {'n': '动作', 'v': '动作'}, {'n': '科幻', 'v': '科幻'}, {'n': '喜剧', 'v': '喜剧'}, {'n': '战争', 'v': '战争'}, {'n': '爱情', 'v': '爱情'}, {'n': '恐怖', 'v': '恐怖'}, {'n': '伦理', 'v': '伦理'}]}], 4: [{'key': 'y', 'name': '年代', 'value': [{'n': '全部', 'v': ''},{'n': '2023', 'v': '2023'}, {'n': '2022', 'v': '2022'}, {'n': '2021', 'v': '2021'}, {'n': '2020', 'v': '2020'}, {'n': '2019', 'v': '2019'}, {'n': '2018', 'v': '2018'}, {'n': '2017', 'v': '2017'}, {'n': '2016', 'v': '2016'}, {'n': '2015', 'v': '2015'}, {'n': '2015之前', 'v': 'lt|2015'}]}, {'key': 'a', 'name': '地区', 'value': [{'n': '全部', 'v': ''}, {'n': '中国大陆', 'v': '中国大陆'}, {'n': '美国', 'v': '美国'}, {'n': '日本', 'v': '日本'}, {'n': '中国香港', 'v': '中国香港'}, {'n': '中国台湾', 'v': '中国台湾'}, {'n': '韩国', 'v': '韩国'}, {'n': '欧洲', 'v': '欧洲'}, {'n': '其他', 'v': '泰国'}]}, {'key': 'scat', 'name': '类型', 'value': [{'n': '全部', 'v': ''}, {'n': '剧情', 'v': '剧情'}, {'n': '动作', 'v': '动作'}, {'n': '科幻', 'v': '科幻'}, {'n': '喜剧', 'v': '喜剧'}, {'n': '战争', 'v': '战争'}, {'n': '爱情', 'v': '爱情'}, {'n': '恐怖', 'v': '恐怖'}, {'n': '伦理', 'v': '伦理'}]}]},
  39. headers:{
  40. "User-Agent":"okhttp/3.12.0"
  41. },
  42. timeout:5000,
  43. class_name:'全部&电影&电视剧&综艺&动漫',
  44. class_url:'0&1&2&3&4',
  45. limit:20,
  46. play_parse:true,
  47. play_json:0,
  48. // 手动调用解析请求json的url,此lazy不方便
  49. // lazy:'js:input={parse:1,url:input};',
  50. lazy:'',
  51. lazy:'js:function GetPlayUrl(playUrl){let realPlay={parse:0,url:playUrl};if(/mgtv|sohu/.test(playUrl)){realPlay.headers={"User-Agent":"Mozilla/5.0"}}else if(/bili/.test(playUrl)){realPlay.headers={"User-Agent":"Mozilla/5.0",Referer:"https://www.bilibili.com"}}else if(/ixigua/.test(playUrl)){realPlay.headers={"User-Agent":"Mozilla/5.0",Referer:"https://www.ixigua.com"}}return realPlay}if(/\\.m3u8|\\.mp4/.test(input)){input={parse:0,url:input}}else{try{let jxUrl="http://api.tyun77.cn/api.php/provide/parserUrl?url=";var t=Math.floor((new Date).getTime()/1e3).toString();let jxExt="&retryNum=0&pcode=010110002&version=2.1&devid=f9c9ce5bb5827a266829383718e6131a&package=com.sevenVideo.app.android&sys=android&sysver=12&brand=Xiaomi&model=Mi_10_Pro&sj="+t;let url=jxUrl+input+jxExt;let TK="/api.php/provide/parserUrl"+"Xiaomif9c9ce5bb5827a266829383718e6131aMi_10_Procom.sevenVideo.app.android010110002"+0+t+"android12"+encodeURIComponent(vipUrl)+"2.1"+t+"XSpeUFjJ";let html=request(url,{headers:{Referer:jxUrl,"User-Agent":"okhttp/3.12.0",TK:md5(TK)}});let urll=JSON.parse(html).data.url;let playhtml=request(urll);let playurl=JSON.parse(playhtml).url;input=GetPlayUrl(playurl)}catch(e){input={parse:1,jx:1,url:input}}}',
  52. 推荐:'json:data.blocks;contents;title;videoCover;msg;id',
  53. double:true,
  54. // 一级:'json:data.result;title;videoCover;msg;id', 旧的写法注释掉
  55. 一级:`js:
  56. var d=[];
  57. let ts= getTime();
  58. input=input.replace('$ts',ts);
  59. let html = request(input,{
  60. headers:getHeaders(input,ts)
  61. });
  62. //print(html);
  63. html = JSON.parse(html);
  64. html.data.result.forEach(function(it){
  65. d.push({
  66. title:it.title,
  67. img:it.videoCover,
  68. desc:it.msg,
  69. url:it.id
  70. })
  71. });
  72. setResult(d);
  73. `,
  74. 二级:`js: var d = [];
  75. VOD = {
  76. vod_id: input
  77. };
  78. let ts= getTime();
  79. try {
  80. input=input+'&sj='+ts;
  81. let html = request(input,{
  82. headers:getHeaders(input,ts)
  83. });
  84. //print(html);
  85. html = JSON.parse(html);
  86. let node = html.data;
  87. VOD = {
  88. vod_id: node["id"],
  89. vod_name: node["videoName"],
  90. vod_pic: node["videoCover"],
  91. type_name: node["subCategory"],
  92. vod_year: node["year"],
  93. vod_area: node["area"],
  94. vod_remarks: node["msg"],
  95. vod_actor: node["actor"],
  96. vod_director: node["director"],
  97. vod_content: node["brief"].strip()
  98. };
  99. let tid = input.split("ids=")[1].split('&')[0];
  100. let listUrl='https://api.tyun77.cn/api.php/provide/videoPlaylist?devid=453CA5D864457C7DB4D0EAA93DE96E66&ids='+tid+'&package=com.sevenVideo.app.android&version=&sj='+ts;
  101. html = request(listUrl,{
  102. headers:getHeaders(listUrl,ts)
  103. });
  104. html = JSON.parse(html);
  105. let episodes = html.data.episodes;
  106. let playMap = {};
  107. if (typeof play_url === "undefined") {
  108. var play_url = ""
  109. }
  110. play_url = play_url.replace("&play_url=", "&type=json&play_url=");
  111. episodes.forEach(function(ep) {
  112. let playurls = ep["playurls"];
  113. playurls.forEach(function(playurl) {
  114. let source = playurl["playfrom"];
  115. if (!playMap.hasOwnProperty(source)) {
  116. playMap[source] = []
  117. }
  118. playMap[source].append(playurl["title"].strip() + "$" + play_url + urlencode(playurl["playurl"]))
  119. })
  120. });
  121. let playFrom = [];
  122. let playList = [];
  123. Object.keys(playMap)
  124. .forEach(function(key) {
  125. playFrom.append(key);
  126. playList.append(playMap[key].join("#"))
  127. });
  128. let vod_play_from = playFrom.join("$$$");
  129. let vod_play_url = playList.join("$$$");
  130. VOD["vod_play_from"] = vod_play_from;
  131. VOD["vod_play_url"] = vod_play_url
  132. } catch (e) {
  133. log("获取二级详情页发生错误:" + e.message)
  134. }`,
  135. 搜索:'',
  136. 搜索:'json:data;videoName;videoCover;msg;id',
  137. }