ednovas.js 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. const baseParse = _ => {
  2. let d = [];
  3. let true_url = getVar("tyrantgenesis.ednovas.url", MY_URL)
  4. const page = MY_URL.match(/page\/(.*?)\.html/)[1]
  5. true_url = true_url.replace('.html', '/page/'+page+'.html')
  6. const html = fetch(true_url)
  7. const empty = "hiker://empty"
  8. const categories = pdfa(html, '.box&&.library-box');
  9. let init_cate = []
  10. for (let i = 0; i < 10; i ++) {
  11. init_cate.push("0")
  12. }
  13. // 取缓存
  14. const fold = getVar("tyrantgenesis.ednovas.fold", "0")
  15. const cate_temp_json = getVar("tyrantgenesis.ednovas.category", JSON.stringify(init_cate))
  16. const cate_temp = JSON.parse(cate_temp_json)
  17. if (parseInt(page) === 1) {
  18. d.push({
  19. title: fold === '1' ? '““””<b><span style="color: #FF0000">∨</span></b>': '““””<b><span style="color: #1aad19">∧</span></b>',
  20. url: $(empty).lazyRule((fold) => {
  21. putVar("tyrantgenesis.ednovas.fold", fold === '1' ? '0' : '1');
  22. refreshPage(false);
  23. return "hiker://empty"
  24. }, fold),
  25. col_type: 'scroll_button',
  26. })
  27. categories.forEach((category, index) => {
  28. let sub_categories = pdfa(category, '.library-box&&a');
  29. if (index === 0) {
  30. sub_categories.forEach((item, key) => {
  31. let title = pdfh(item, 'a&&Text')
  32. d.push({
  33. title: key.toString()===cate_temp[index]? "““"+title+"””":title,
  34. url: $(parseDom(item, 'a&&href')).lazyRule((params) => {
  35. let new_cate = []
  36. params.cate_temp.forEach((cate, index) => {
  37. new_cate.push(index === 0 ? params.key.toString() : "0")
  38. })
  39. putVar("tyrantgenesis.ednovas.category", JSON.stringify(new_cate))
  40. putVar("tyrantgenesis.ednovas.url", input)
  41. refreshPage(true)
  42. return "hiker://empty"
  43. }, {
  44. cate_temp: cate_temp,
  45. key: key,
  46. page: page,
  47. }),
  48. col_type: 'scroll_button',
  49. })
  50. })
  51. d.push({
  52. col_type:"blank_block"
  53. });
  54. } else if (fold === '1') {
  55. sub_categories.forEach((item, key) => {
  56. let title = pdfh(item, 'a&&Text')
  57. d.push({
  58. title: key.toString()===cate_temp[index]? "““"+title+"””":title,
  59. url: $(parseDom(item, 'a&&href')).lazyRule((params) => {
  60. params.cate_temp[params.index] = params.key.toString()
  61. putVar("tyrantgenesis.ednovas.category", JSON.stringify(params.cate_temp))
  62. putVar("tyrantgenesis.ednovas.url", input)
  63. refreshPage(true)
  64. return "hiker://empty"
  65. }, {
  66. cate_temp: cate_temp,
  67. index: index,
  68. key: key,
  69. page: page,
  70. }),
  71. col_type: 'scroll_button',
  72. })
  73. })
  74. d.push({
  75. col_type:"blank_block"
  76. });
  77. }
  78. })
  79. }
  80. const video_list = pdfa(html, '.module-items&&.module-item')
  81. video_list.forEach(video => {
  82. d.push({
  83. title: pdfh(video, '.module-item-title&&Text'),
  84. desc: pdfh(video, '.module-item-caption&&Text'),
  85. pic_url: pdfh(video, 'img&&data-src')+"@Referer=https://ednovas.video/",
  86. url: parseDom(video, 'a&&href')+'#immersiveTheme#',
  87. col_type: 'movie_3_marquee',
  88. })
  89. })
  90. setResult(d);
  91. }
  92. const secParse = _ => {
  93. let d = [];
  94. const empty = "hiker://empty"
  95. const html = getResCode()
  96. let current_tab = getVar("tyrantgenesis.ednovas.select_tab", '0')
  97. const video_info = pdfh(html, '#main&&Html')
  98. d.push(
  99. {
  100. title: pdfh(video_info, 'h1&&Text'),
  101. desc: pdfh(video_info, '.sqjj_a&&Text'),
  102. pic_url: pdfh(video_info, '.video-cover&&img&&data-src')+"@Referer=https://ednovas.video/",
  103. url: MY_URL,
  104. col_type: 'movie_1_vertical_pic_blur'
  105. },
  106. {
  107. col_type: 'blank_block'
  108. }
  109. )
  110. const tabs = pdfa(html, '.module-player-tab&&.module-tab-content&&.module-tab-item')
  111. const lists = pdfa(html, '.module&&.module-list')
  112. d.push({
  113. title: '选择线路',
  114. url: empty,
  115. col_type: 'scroll_button',
  116. })
  117. tabs.forEach((item, index) => {
  118. let title = pdfh(item, 'span&&Text')
  119. d.push({
  120. title: index.toString() === current_tab? "““"+title+"””":title,
  121. url: $(empty).lazyRule((params) => {
  122. putVar("tyrantgenesis.ednovas.select_tab", params.index.toString())
  123. refreshPage(true)
  124. return "hiker://empty"
  125. }, {
  126. index: index,
  127. }),
  128. col_type: 'scroll_button',
  129. })
  130. })
  131. d.push({
  132. col_type: 'blank_block'
  133. })
  134. const list = pdfa(lists[parseInt(current_tab)], '.scroll-content&&a')
  135. list.forEach(item => {
  136. d.push({
  137. title: pdfh(item, 'a&&Text'),
  138. url: $(parseDom(item, 'a&&href')).lazyRule(() => {
  139. eval(fetch(input).match(/var player_aaaa=(.*?)}/)[0])
  140. const pre_url = player_aaaa.url
  141. const host = pre_url.split('/')[2]
  142. const info = fetch(pre_url)
  143. let match = info.match(/'(.*?)m3u8'/)
  144. if (! match) match = info.match(/:"(.*?)m3u8"/)
  145. if (match) {
  146. return "https://"+host+match[1]+'m3u8'
  147. } else {
  148. return pre_url
  149. }
  150. }),
  151. // col_type: 'text_5',
  152. col_type: 'flex_button',
  153. })
  154. })
  155. setResult(d);
  156. }
  157. const searchParse = _ => {
  158. let d = [];
  159. const html = getResCode()
  160. const list = pdfa(html, '.module-items&&.module-item')
  161. list.forEach(item => {
  162. d.push({
  163. title: pdfh(item, 'a&&Text'),
  164. desc: pdfh(item, '.video-info-aux&&Text'),
  165. pic_url: pdfh(item, 'img&&data-src')+"@Referer=https://ednovas.video/",
  166. url: parseDom(item, 'a&&href')+'#immersiveTheme#',
  167. })
  168. })
  169. setResult(d);
  170. }