KTV歌厅.js 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. globalThis.post2 = function (_url, _data) {
  2. // let data = buildUrl(_url,_data).split('?')[1];
  3. // return post(_url,{body:encodeURIComponent(data),headers:rule.headers});
  4. return post(_url, {data: _data, headers: rule.headers});
  5. }
  6. var rule = {
  7. 类型: '听歌',//影视|听书|漫画|小说
  8. title: 'KTV歌厅[听]',
  9. // host: 'https://vpsdn.leuse.top',
  10. host: 'https://api.cloudflare.com',
  11. root: 'https://api.cloudflare.com/client/v4/accounts/1ecc4a947c5a518427141f4a68c86ea1/d1/database/4f1385ab-f952-404a-870a-e4cfef4bd9fd/query',
  12. mktvUrl: 'http://txysong.mysoto.cc/songs/',
  13. url: '/searchmv?table=fyclass&pg=fypage#fyfilter',
  14. searchUrl: '/searchmv?keywords=**&pg=fypage',
  15. pic: 'https://api.paugram.com/wallpaper/?source=sina&category=us',
  16. searchable: 2,
  17. quickSearch: 0,
  18. filterable: 1,
  19. filter: 'H4sIAAAAAAAAA52STU/CMBjHv0vPHATfuerFkwePhgOHSRZhmIEmhJBgBLIIBEgI0/BqAgFEwgYRDbjwZWzpvoUr2tGlXOTW/p+n7a+/Ng4iohQQZOC9jINrIQa8QBYCYlgCLiD5Q4I1hzUN5mbWXJTEqDW3Rnf+4K2wWiKRhnTPfOiRmFQTrvhq4CY7kGq7az5n7NjzF6PPESxodrxLu6sGbFdAwkcKvzxXYTm0plnqc6gMtqZZlj84FNiZcBzLeQoWFcLhc4FIWAowgoJ+xg4eDXEvuebx/BMIqwVrC56parAxxTKbfTbeozLVDhvv027VgHmVrRzQU7M6Gx/SW4/bbHxEYdLT73nFjo/p9v03VHcc7N6hQBPNkdufIa9B7ctRojfG00cKyzx+NHYjOB+/kd368dH7PX7J8a6LCizrnGuUTCK1y7mGqQUa5njX9T4sGZxopJXYbioaKw1UHfOiKzU4y3Ci8eLVHDxtsKy2UL55enZxcr5BtaHjbmb1gxM/8si9TOYDAAA=',
  20. filter_url: '{{fl}}',
  21. headers: {
  22. 'User-Agent': 'MOBILE_UA',
  23. 'Content-Type': 'application/json',
  24. 'Authorization': 'Bearer LueNrycW-6jks7xBjPqX9mjFq2A2M5Kul6Ig3D8z',
  25. },
  26. timeout: 5000,
  27. class_name: '歌手&曲库',
  28. class_url: 'singer&song',
  29. 一级: $js.toString(() => {
  30. let d = [];
  31. // let _url = input.split('#')[0];
  32. let _url = rule.root;
  33. let params = [];
  34. let sql = '';
  35. let size = 20;
  36. let pg = MY_PAGE;
  37. if (MY_CATE === 'singer') {
  38. sql = 'select name, id from singer where 1=1';
  39. if (MY_FL.region) {
  40. params.push(MY_FL.region);
  41. sql += ' and region_id = ?';
  42. // _url += '&where=region_id&keywords=' + MY_FL.region + '&size=21';
  43. } else if (MY_FL.form) {
  44. params.push(MY_FL.form);
  45. sql += ' and form_id = ?';
  46. // _url += '&where=form_id&keywords=' + MY_FL.form + '&size=21';
  47. }
  48. sql += ` order by id limit ${(pg - 1) * size},${size};`;
  49. let html = post2(_url, {params: params, sql: sql});
  50. let json = JSON.parse(html);
  51. d = json.result[0].results.map(item => {
  52. let pic = rule.mktvUrl + item.id + '.jpg';
  53. return {
  54. vod_id: item.name + '@@' + item.name + '@@' + pic,
  55. vod_name: item.name,
  56. vod_pic: pic,
  57. vod_remarks: '',
  58. }
  59. });
  60. } else if (MY_CATE === 'song') {
  61. sql = 'select number, name from song where 1=1';
  62. if (MY_FL.lan) {
  63. params.push(MY_FL.lan);
  64. sql += ' and language_id = ?';
  65. // _url += '&where=language_id&keywords=' + MY_FL.lan + '&size=21';
  66. } else if (MY_FL.type) {
  67. params.push(MY_FL.type);
  68. sql += ' and type_id = ?';
  69. // _url += '&where=type_id&keywords=' + MY_FL.type + '&size=21';
  70. }
  71. sql += ` order by number limit ${(pg - 1) * size},${size};`;
  72. let html = post2(_url, {params: params, sql: sql});
  73. let json = JSON.parse(html);
  74. d = json.result[0].results.map(item => {
  75. return {
  76. vod_id: rule.mktvUrl + item.number + '.mkv' + '@@' + item.name + '@@' + '',
  77. vod_name: item.name,
  78. vod_pic: rule.pic,
  79. vod_remarks: '',
  80. }
  81. });
  82. }
  83. VODS = d;
  84. }),
  85. 二级: $js.toString(() => {
  86. let _url = rule.root;
  87. let id = orId.split('@@')[0];
  88. let name = orId.split('@@')[1];
  89. if (id.endsWith('.mkv')) {
  90. VOD = {
  91. vod_name: name,
  92. vod_play_from: '四季资源',
  93. vod_content: '四季在线',
  94. }
  95. } else {
  96. VOD = {
  97. vod_name: id,
  98. vod_play_from: '四季在线',
  99. vod_content: '四季在线',
  100. }
  101. }
  102. if (id.endsWith('.mkv')) {
  103. VOD.vod_play_url = '嗅探播放$' + id;
  104. } else {
  105. let params = [id];
  106. let sql = 'select number,name from song where singer_names = ? order by number limit 0,999';
  107. let html = post2(_url, {params: params, sql: sql});
  108. let json = JSON.parse(html);
  109. let data = json.result[0].results;
  110. VOD.vod_play_url = (data.map(item => {
  111. return item.name + '$' + rule.mktvUrl + item.number + '.mkv';
  112. })).join('#');
  113. }
  114. }),
  115. 搜索: $js.toString(() => {
  116. let _url = rule.root;
  117. let wd = KEY;
  118. let sql = "select number,name from song where name like '%" + wd + "%' or singer_names like '%" + wd + "%'";
  119. let d = [];
  120. let html = post2(_url, {sql: sql});
  121. let json = JSON.parse(html);
  122. d = json.result[0].results.map(item => {
  123. return {
  124. vod_id: rule.mktvUrl + item.number + '.mkv' + '@@' + item.name + '@@' + '',
  125. vod_name: item.name,
  126. vod_pic: rule.pic,
  127. vod_remarks: item.singer_names,
  128. }
  129. });
  130. VODS = d;
  131. }),
  132. play_parse: true,
  133. lazy: $js.toString(() => {
  134. input = {parse: 0, url: input};
  135. }),
  136. }