mgtv.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. globalThis.getHeaders= function(input){
  2. let t = Math.round(new Date().getTime()/1000).toString();
  3. let headers = {
  4. 'User-Agent': 'Dalvik/2.1.0(Linux;U;Android10;PDHM00Build/QKQ1.191222.002)'
  5. };
  6. return headers
  7. }
  8. globalThis.removeBTags= function(title) {
  9. title = title.replace(/<B>|<\/B>/g, "");
  10. return title;
  11. }
  12. var rule = {
  13. title:'百忙无果',
  14. host:'http://tv.jsp47.com',
  15. homeUrl:'',
  16. detailUrl:'https://v5m.api.mgtv.com/remaster/vrs/getByPartId?abroad=0&src=mgtv&partId=fyid',
  17. searchUrl:'https://mobileso.bz.%6d%67%74%76.com/msite/search/v2?pc=30&pn=1&q=**',
  18. searchable:2,
  19. quickSearch:1,
  20. multi:1,
  21. filterable:1,
  22. url:'https://pianku.api.%6d%67%74%76.com/rider/list/pcweb/v3?platform=pcweb&channelId=fyclass&pn=fypage&pc=80&hudong=1&_support=10000000&kind=a1&area=a1',
  23. filter_url:'year={{fl.year or "all"}}&sort={{fl.sort or "all"}}&chargeInfo={{fl.chargeInfo or "all"}}',
  24. headers:{
  25. 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.5735.289 Safari/537.36'
  26. },
  27. timeout:5000,
  28. class_name:'电影&电视剧&综艺&少儿',
  29. class_url:'3&2&1&10',
  30. filter:{'2': [{'key': 'chargeInfo', 'name': '付费类型', 'value': [{'n': '全部', 'v': 'all'}, {'n': '免费', 'v': 'b1'}, {'n': 'vip', 'v': 'b2'}, {'n': 'VIP用券', 'v': 'b3'}, {'n': '付费点播', 'v': 'b4'}]}, {'key': 'sort', 'name': '排序', 'value': [{'n': '最新', 'v': 'c1'}, {'n': '最热', 'v': 'c2'}, {'n': '知乎高分', 'v': 'c4'}]}, {'key': 'year', 'name': '年代', 'value': [{'n': '全部', 'v': 'all'}, {'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': '2014', 'v': '2014'}, {'n': '2013', 'v': '2013'}, {'n': '2012', 'v': '2012'}, {'n': '2011', 'v': '2011'}, {'n': '2010', 'v': '2010'}, {'n': '2009', 'v': '2009'}, {'n': '2008', 'v': '2008'}, {'n': '2007', 'v': '2007'}, {'n': '2006', 'v': '2006'}, {'n': '2005', 'v': '2005'}, {'n': '2004', 'v': '2004'}]}], '3': [{'key': 'chargeInfo', 'name': '付费类型', 'value': [{'n': '全部', 'v': 'all'}, {'n': '免费', 'v': 'b1'}, {'n': 'vip', 'v': 'b2'}, {'n': 'VIP用券', 'v': 'b3'}, {'n': '付费点播', 'v': 'b4'}]}, {'key': 'sort', 'name': '排序', 'value': [{'n': '最新', 'v': 'c1'}, {'n': '最热', 'v': 'c2'}, {'n': '知乎高分', 'v': 'c4'}]}, {'key': 'year', 'name': '年代', 'value': [{'n': '全部', 'v': 'all'}, {'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': '2014', 'v': '2014'}, {'n': '2013', 'v': '2013'}, {'n': '2012', 'v': '2012'}, {'n': '2011', 'v': '2011'}, {'n': '2010', 'v': '2010'}, {'n': '2009', 'v': '2009'}, {'n': '2008', 'v': '2008'}, {'n': '2007', 'v': '2007'}, {'n': '2006', 'v': '2006'}, {'n': '2005', 'v': '2005'}, {'n': '2004', 'v': '2004'}]}], '1': [{'key': 'chargeInfo', 'name': '付费类型', 'value': [{'n': '全部', 'v': 'all'}, {'n': '免费', 'v': 'b1'}, {'n': 'vip', 'v': 'b2'}, {'n': 'VIP用券', 'v': 'b3'}, {'n': '付费点播', 'v': 'b4'}]}, {'key': 'sort', 'name': '排序', 'value': [{'n': '最新', 'v': 'c1'}, {'n': '最热', 'v': 'c2'}, {'n': '知乎高分', 'v': 'c4'}]}, {'key': 'year', 'name': '年代', 'value': [{'n': '全部', 'v': 'all'}, {'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': '2014', 'v': '2014'}, {'n': '2013', 'v': '2013'}, {'n': '2012', 'v': '2012'}, {'n': '2011', 'v': '2011'}, {'n': '2010', 'v': '2010'}, {'n': '2009', 'v': '2009'}, {'n': '2008', 'v': '2008'}, {'n': '2007', 'v': '2007'}, {'n': '2006', 'v': '2006'}, {'n': '2005', 'v': '2005'}, {'n': '2004', 'v': '2004'}]}], '50': [{'key': 'chargeInfo', 'name': '付费类型', 'value': [{'n': '全部', 'v': 'all'}, {'n': '免费', 'v': 'b1'}, {'n': 'vip', 'v': 'b2'}, {'n': 'VIP用券', 'v': 'b3'}, {'n': '付费点播', 'v': 'b4'}]}, {'key': 'sort', 'name': '排序', 'value': [{'n': '最新', 'v': 'c1'}, {'n': '最热', 'v': 'c2'}, {'n': '知乎高分', 'v': 'c4'}]}, {'key': 'year', 'name': '年代', 'value': [{'n': '全部', 'v': 'all'}, {'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': '2014', 'v': '2014'}, {'n': '2013', 'v': '2013'}, {'n': '2012', 'v': '2012'}, {'n': '2011', 'v': '2011'}, {'n': '2010', 'v': '2010'}, {'n': '2009', 'v': '2009'}, {'n': '2008', 'v': '2008'}, {'n': '2007', 'v': '2007'}, {'n': '2006', 'v': '2006'}, {'n': '2005', 'v': '2005'}, {'n': '2004', 'v': '2004'}]}], '51': [{'key': 'chargeInfo', 'name': '付费类型', 'value': [{'n': '全部', 'v': 'all'}, {'n': '免费', 'v': 'b1'}, {'n': 'vip', 'v': 'b2'}, {'n': 'VIP用券', 'v': 'b3'}, {'n': '付费点播', 'v': 'b4'}]}, {'key': 'sort', 'name': '排序', 'value': [{'n': '最新', 'v': 'c1'}, {'n': '最热', 'v': 'c2'}, {'n': '知乎高分', 'v': 'c4'}]}, {'key': 'year', 'name': '年代', 'value': [{'n': '全部', 'v': 'all'}, {'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': '2014', 'v': '2014'}, {'n': '2013', 'v': '2013'}, {'n': '2012', 'v': '2012'}, {'n': '2011', 'v': '2011'}, {'n': '2010', 'v': '2010'}, {'n': '2009', 'v': '2009'}, {'n': '2008', 'v': '2008'}, {'n': '2007', 'v': '2007'}, {'n': '2006', 'v': '2006'}, {'n': '2005', 'v': '2005'}, {'n': '2004', 'v': '2004'}]}], '115': [{'key': 'chargeInfo', 'name': '付费类型', 'value': [{'n': '全部', 'v': 'all'}, {'n': '免费', 'v': 'b1'}, {'n': 'vip', 'v': 'b2'}, {'n': 'VIP用券', 'v': 'b3'}, {'n': '付费点播', 'v': 'b4'}]}, {'key': 'sort', 'name': '排序', 'value': [{'n': '最新', 'v': 'c1'}, {'n': '最热', 'v': 'c2'}, {'n': '知乎高分', 'v': 'c4'}]}, {'key': 'year', 'name': '年代', 'value': [{'n': '全部', 'v': 'all'}, {'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': '2014', 'v': '2014'}, {'n': '2013', 'v': '2013'}, {'n': '2012', 'v': '2012'}, {'n': '2011', 'v': '2011'}, {'n': '2010', 'v': '2010'}, {'n': '2009', 'v': '2009'}, {'n': '2008', 'v': '2008'}, {'n': '2007', 'v': '2007'}, {'n': '2006', 'v': '2006'}, {'n': '2005', 'v': '2005'}, {'n': '2004', 'v': '2004'}]}]},
  31. limit:20,
  32. play_parse:true,
  33. lazy:`js:
  34. try {
  35. function getvideo(url) {
  36. let jData = JSON.parse(request(url, {
  37. headers: getHeaders(url)
  38. }));
  39. return jData.url
  40. }
  41. let videoUrl = getvideo('https://jxjson.icu/neibu.php?url=' + input);
  42. input = {
  43. jx: 0,
  44. url: videoUrl,
  45. parse: 0
  46. }
  47. } catch (e) {
  48. log(e.toString())
  49. }
  50. `,
  51. 推荐:`js:
  52. let d = [];
  53. let html = request("https://pianku.api.mgtv.com/rider/list/pcweb/v3?allowedRC=1&platform=pcweb&channelId=3&pn=1&pc=40&hudong=1&_support=10000000&kind=a1&year=all&chargeInfo=a1&sort=c2&edition=a1&area=a1");
  54. let json = JSON.parse(html);
  55. json.data.hitDocs.forEach(function(data,index) {
  56. d.push({
  57. url: data.playPartId,
  58. title: data.title,
  59. img: data.img,
  60. desc: data.year
  61. })
  62. });
  63. setResult(d);
  64. `,
  65. 一级:`js:
  66. let d = [];
  67. let html = request(input);
  68. let json = JSON.parse(html);
  69. json.data.hitDocs.forEach(function(data) {
  70. if (MY_CATE === "3") {
  71. desc = data.rightCorner.text
  72. } else {
  73. desc = data.updateInfo
  74. }
  75. if (desc !== "预告") {
  76. d.push({
  77. url: data.playPartId,
  78. title: data.title,
  79. img: data.img,
  80. desc: desc
  81. })
  82. }
  83. });
  84. setResult(d);
  85. `,
  86. 二级:`js:
  87. let d = [];
  88. let html = request(input);
  89. let partId = input.split('partId=')[1].split('&')[0];
  90. let json = JSON.parse(html).data;
  91. VOD = {
  92. vod_name: "",
  93. type_name: "",
  94. vod_actor: "",
  95. vod_year: "",
  96. vod_content: "",
  97. vod_remarks: "",
  98. vod_pic: ""
  99. };
  100. VOD.vod_name = json.title;
  101. VOD.type_name = json.mediaInfo.detail.font
  102. VOD.vod_pic = json.colImage;
  103. const info = {};
  104. json.intro.forEach(item => {
  105. const [key, value] = item.split(':');
  106. info[key.trim()] = value.trim();
  107. });
  108. VOD.vod_year = info['年份'];
  109. VOD.vod_actor = info['演员'];
  110. VOD.vod_content = info['简介'];
  111. let playlists = [];
  112. if (json.locateChannel === '3') {
  113. let listUrl = "https://pcweb.api.mgtv.com/episode/list?page=1&size=50&video_id=" + json.collPlayPartId;
  114. let jsons = JSON.parse(request(listUrl)).data;
  115. playlists = [{
  116. playUrl: "https://www.mgtv.com" + jsons.list[0].url,
  117. imageUrl: json.colImage,
  118. shortTitle: "正片",
  119. period: info['简介']
  120. }]
  121. } else {
  122. let listUrl = "https://pcweb.api.mgtv.com/episode/list?page=1&size=50&video_id=" + json.collPlayPartId;
  123. let data = JSON.parse(request(listUrl)).data;
  124. let total = data.count;
  125. if (total <= 50) {
  126. let playData = data.list;
  127. playData.forEach(function(it) {
  128. if (it.isIntact === "1") {
  129. playlists.push({
  130. playUrl: "https://www.mgtv.com" + it.url,
  131. imageUrl: json.colImage,
  132. shortTitle: it.t4,
  133. period: info['简介']
  134. })
  135. }
  136. })
  137. } else {
  138. for (let i = 1; i < total / 50 + 1; i++) {
  139. let listUrl = "https://pcweb.api.mgtv.com/episode/list?page=" + i + "&size=50&video_id=" + json.collPlayPartId;
  140. let data = JSON.parse(request(listUrl)).data;
  141. let playData = data.list;
  142. playData.forEach(function(it) {
  143. if (it.isIntact === "1") {
  144. playlists.push({
  145. playUrl: "https://www.mgtv.com" + it.url,
  146. imageUrl: json.colImage,
  147. shortTitle: it.t4,
  148. period: info['简介']
  149. })
  150. }
  151. })
  152. }
  153. }
  154. }
  155. playlists.forEach(function(it) {
  156. d.push({
  157. title: it.shortTitle,
  158. desc: it.period,
  159. img: it.imageUrl,
  160. url: it.playUrl
  161. })
  162. });
  163. VOD.vod_play_from = "芒果TV";
  164. VOD.vod_play_url = d.map(function(it) {
  165. return it.title + "$" + it.url
  166. }).join("#");
  167. `,
  168. 搜索:`js:
  169. let d = [];
  170. let json = JSON.parse(request(input));
  171. json.data.contents.forEach(function(content) {
  172. if (content.type === 'media') {
  173. content.data.forEach(function(item) {
  174. const url = item.url;
  175. const parts = url.split('/');
  176. const number = parts[parts.length - 1].replace('.html', "");
  177. item.title = removeBTags(item.title);
  178. const typeDesc = item.desc.find(desc => desc.startsWith("类型:"));
  179. const typeInfo = typeDesc.split("类型: ")[1];
  180. if (!isNaN(number)) {
  181. d.push({
  182. url: number,
  183. title: item.title,
  184. img: item.img,
  185. desc: typeInfo,
  186. });
  187. }
  188. });
  189. }
  190. });
  191. setResult(d);
  192. `
  193. }