酷云77.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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. homeUrl:'/api.php/provide/homeBlock?type_id=0',
  26. searchUrl:'/api.php/provide/searchVideo?searchName=**',
  27. searchable:2,
  28. quickSearch:0,
  29. filterable:1,
  30. multi:1,
  31. // 分类链接fypage参数支持1个()表达式
  32. // url:'/api.php/provide/searchFilter?type_id=fyclass&pagesize=24&pagenum=fypage', // 旧的写法注释掉
  33. url:'/api.php/provide/searchFilter?devid=453CA5D864457C7DB4D0EAA93DE96E66&package=com.sevenVideo.app.android&pagenum=fypage&pagesize=24&version=&sj=$ts&type_id=fyclass',
  34. // detailUrl:'/api.php/provide/videoDetail?devid=453CA5D864457C7DB4D0EAA93DE96E66&package=com.sevenVideo.app.android&version=&ids=fyid', //旧的写法注释掉
  35. detailUrl:'/api.php/provide/videoDetail?devid=453CA5D864457C7DB4D0EAA93DE96E66&ids=fyid&package=com.sevenVideo.app.android&version=',
  36. filter_url:'year={{fl.y}}&category={{fl.scat}}&area={{fl.a}}',
  37. 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': '伦理'}]}]},
  38. headers:{
  39. "User-Agent":"okhttp/3.12.0"
  40. },
  41. timeout:5000,
  42. class_name:'全部&电影&电视剧&综艺&动漫',
  43. class_url:'0&1&2&3&4',
  44. limit:20,
  45. play_parse:true,
  46. play_json:0,
  47. // 手动调用解析请求json的url,此lazy不方便
  48. // lazy:'js:input={parse:1,url:input};',
  49. lazy:'',
  50. 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}}}',
  51. 推荐:'json:data.blocks;contents;title;videoCover;msg;id',
  52. double:true,
  53. // 一级:'json:data.result;title;videoCover;msg;id', 旧的写法注释掉
  54. 一级:`js:
  55. var d=[];
  56. let ts= getTime();
  57. input=input.replace('$ts',ts);
  58. let html = request(input,{
  59. headers:getHeaders(input,ts)
  60. });
  61. //print(html);
  62. html = JSON.parse(html);
  63. html.data.result.forEach(function(it){
  64. d.push({
  65. title:it.title,
  66. img:it.videoCover,
  67. desc:it.msg,
  68. url:it.id
  69. })
  70. });
  71. setResult(d);
  72. `,
  73. 二级:`js: var d = [];
  74. VOD = {
  75. vod_id: input
  76. };
  77. let ts= getTime();
  78. try {
  79. input=input+'&sj='+ts;
  80. let html = request(input,{
  81. headers:getHeaders(input,ts)
  82. });
  83. //print(html);
  84. html = JSON.parse(html);
  85. let node = html.data;
  86. VOD = {
  87. vod_id: node["id"],
  88. vod_name: node["videoName"],
  89. vod_pic: node["videoCover"],
  90. type_name: node["subCategory"],
  91. vod_year: node["year"],
  92. vod_area: node["area"],
  93. vod_remarks: node["msg"],
  94. vod_actor: node["actor"],
  95. vod_director: node["director"],
  96. vod_content: node["brief"].strip()
  97. };
  98. let tid = input.split("ids=")[1].split('&')[0];
  99. let listUrl='https://api.tyun77.cn/api.php/provide/videoPlaylist?devid=453CA5D864457C7DB4D0EAA93DE96E66&ids='+tid+'&package=com.sevenVideo.app.android&version=&sj='+ts;
  100. html = request(listUrl,{
  101. headers:getHeaders(listUrl,ts)
  102. });
  103. html = JSON.parse(html);
  104. let episodes = html.data.episodes;
  105. let playMap = {};
  106. if (typeof play_url === "undefined") {
  107. var play_url = ""
  108. }
  109. play_url = play_url.replace("&play_url=", "&type=json&play_url=");
  110. episodes.forEach(function(ep) {
  111. let playurls = ep["playurls"];
  112. playurls.forEach(function(playurl) {
  113. let source = playurl["playfrom"];
  114. if (!playMap.hasOwnProperty(source)) {
  115. playMap[source] = []
  116. }
  117. playMap[source].append(playurl["title"].strip() + "$" + play_url + urlencode(playurl["playurl"]))
  118. })
  119. });
  120. let playFrom = [];
  121. let playList = [];
  122. Object.keys(playMap)
  123. .forEach(function(key) {
  124. playFrom.append(key);
  125. playList.append(playMap[key].join("#"))
  126. });
  127. let vod_play_from = playFrom.join("$$$");
  128. let vod_play_url = playList.join("$$$");
  129. VOD["vod_play_from"] = vod_play_from;
  130. VOD["vod_play_url"] = vod_play_url
  131. } catch (e) {
  132. log("获取二级详情页发生错误:" + e.message)
  133. }`,
  134. 搜索:'',
  135. 搜索:'json:data;videoName;videoCover;msg;id',
  136. }