buosn.js 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. const baseParse = _ => {
  2. addListener('onClose', $.toString(() => {
  3. clearItem('buosn.fold')
  4. clearItem('buosn.cate_id')
  5. clearItem('buosn.click_url')
  6. clearItem('buosn.category')
  7. clearItem('buosn.cate_tab')
  8. clearItem('buosn.list_sort')
  9. }))
  10. let d = [];
  11. const empty = "hiker://empty"
  12. const current_page = MY_URL.split('##')[1]
  13. const fold = getItem("buosn.fold", "0")
  14. const cate_id = getItem("buosn.cate_id", "1")
  15. let click_url = getItem('buosn.click_url', "https://buosn.com/vodshow/"+cate_id+"-----------/")
  16. const category = [
  17. {id: 1, name: '电影'},
  18. {id: 2, name: '连续剧'},
  19. {id: 3, name: '综艺'},
  20. {id: 4, name: '动漫'},
  21. ];
  22. const cate_temp_json = getItem("buosn.category", JSON.stringify(new Array('-----------'.length).fill('0')))
  23. let cate_temp = JSON.parse(cate_temp_json)
  24. let url_params = click_url.match(/vodshow\/(.*?)\//)[1].split('-')
  25. url_params[8] = current_page
  26. const true_url = "https://buosn.com/vodshow/"+url_params.join('-')+"/"
  27. const html = fetch(true_url)
  28. const box = pdfa(html, '.slideDown-box&&ul')
  29. if (parseInt(current_page) === 1) {
  30. d.push({
  31. title: fold === '1' ? '““””<b><span style="color: #FF0000">∨</span></b>': '““””<b><span style="color: #1aad19">∧</span></b>',
  32. url: $(empty).lazyRule((fold) => {
  33. setItem("buosn.fold", fold === '1' ? '0' : '1');
  34. refreshPage(true);
  35. return "hiker://empty"
  36. }, fold),
  37. col_type: 'scroll_button',
  38. })
  39. category.forEach(item => {
  40. d.push({
  41. title: item.id.toString() === cate_id ? '““””<b><span style="color: #FF0000">'+item.name+"</span></b>" : item.name,
  42. url: $(empty).lazyRule((id) => {
  43. setItem("buosn.cate_id", id)
  44. setItem("buosn.click_url", "https://buosn.com/vodshow/"+id+"-----------/")
  45. clearItem('buosn.category')
  46. refreshPage(true)
  47. return "hiker://empty"
  48. }, item.id.toString()),
  49. col_type: 'scroll_button',
  50. })
  51. })
  52. d.push({
  53. col_type:"blank_block"
  54. })
  55. if (fold === '1') {
  56. box.forEach((item, index) => {
  57. let cates = pdfa(item, 'ul&&li')
  58. cates.forEach((cate, key) => {
  59. let name = pdfh(cate, 'a&&Text')
  60. let href = pd(cate, 'a&&href')
  61. if (key !== 0) {
  62. d.push({
  63. title: 1 === key - cate_temp[index] ? '““””<b><span style="color: #FF0000">'+name+"</span></b>" : name,
  64. url: $(empty).lazyRule((key, index, cate_temp, href) => {
  65. let new_cate = []
  66. cate_temp.forEach(item => new_cate.push(item))
  67. new_cate[index] = parseInt(key)-1
  68. setItem("buosn.click_url", href)
  69. setItem("buosn.category", JSON.stringify(new_cate))
  70. refreshPage(true)
  71. return "hiker://empty"
  72. }, key.toString(), index.toString(), cate_temp, href),
  73. col_type: 'scroll_button',
  74. })
  75. }
  76. })
  77. d.push({
  78. col_type:"blank_block"
  79. })
  80. })
  81. }
  82. }
  83. const list = pdfa(html, '.myui-panel-bg&&ul&&li')
  84. list.forEach(item => {
  85. d.push({
  86. title: pdfh(item, 'h4&&Text'),
  87. desc: pdfh(item, '.pic-tag&&Text'),
  88. url: pd(item, 'a&&href')+'#immersiveTheme#',
  89. pic_url: pd(item, '.myui-vodlist__thumb&&data-original'),
  90. col_type: 'movie_3_marquee',
  91. })
  92. })
  93. setResult(d);
  94. }
  95. const secParse = _ => {
  96. addListener('onClose', $.toString(() => {
  97. clearItem('buosn.cate_tab')
  98. clearItem('buosn.list_sort')
  99. }))
  100. let d = [];
  101. const html = getResCode()
  102. const empty = "hiker://empty"
  103. const cate_tab = getItem("buosn.cate_tab", "0")
  104. const list_sort = getItem("buosn.list_sort", "0")
  105. const video_array = pdfa(html, 'body&&.myui-panel-bg')
  106. const video_info = video_array[0]
  107. const video_desc = video_array[1]
  108. const list_box = video_array[2]
  109. d.push({
  110. title: pdfa(video_info, '.myui-content__detail&&.data').map(item => pdfh(item, '.data&&Text')).join('\n'),
  111. desc: pdfh(video_desc, '.content&&.sketch&&Text'),
  112. url: MY_URL,
  113. pic_url: pd(video_info, 'img&&data-original'),
  114. col_type: 'movie_1_vertical_pic_blur',
  115. })
  116. d.push({
  117. col_type: 'line_blank'
  118. })
  119. d.push({
  120. col_type: 'big_blank_block'
  121. })
  122. const tabs = pdfa(list_box, 'ul&&li')
  123. const playlistTab = pdfa(list_box, '.tab-content&&.tab-pane')
  124. if (tabs.length > 0) {
  125. tabs.forEach((tab, index) => {
  126. let title = pdfh(tab, 'a&&Text')
  127. d.push({
  128. title: cate_tab === index.toString() ? '““””<b><span style="color: #FF0000">'+title+"</span></b>" : title,
  129. url: $(empty).lazyRule((index) => {
  130. setItem("buosn.cate_tab", index)
  131. refreshPage(true)
  132. return "hiker://empty"
  133. }, index.toString()),
  134. col_type: 'scroll_button',
  135. })
  136. })
  137. let playlist = pdfa(playlistTab[cate_tab], 'ul&&li')
  138. if (list_sort === '1') playlist = playlist.reverse()
  139. d.push({
  140. title: '当前线路:'+pdfh(tabs[cate_tab], 'a&&Text')+' 共'+playlist.length+'集',
  141. pic_url: list_sort === '0' ? 'https://git.tyrantg.com/tyrantgenesis/hikerViewRules/raw/master/assets/icons/sort-ascending.png' : 'https://git.tyrantg.com/tyrantgenesis/hikerViewRules/raw/master/assets/icons/sort-descending.png',
  142. url: $(empty).lazyRule((list_sort) => {
  143. setItem("buosn.list_sort", list_sort === '0' ? '1' : '0')
  144. refreshPage(true)
  145. return "hiker://empty"
  146. }, list_sort),
  147. col_type: 'avatar',
  148. })
  149. playlist.forEach(item => {
  150. d.push({
  151. title: pdfh(item, 'a&&Text'),
  152. url: $(pd(item, 'a&&href')).lazyRule(() => {
  153. try {
  154. eval(getCryptoJS())
  155. const html = fetch(input)
  156. const content = html.match(/var player_aaaa=(.*?)<\/script>/)
  157. const url = "https://jx.buosn.la/?url="+decodeURIComponent(base64Decode(JSON.parse(content[1]).url))
  158. const parseHtml = fetch(url)
  159. const le_token = parseHtml.match(/var le_token = "(.*?)";/)[1]
  160. const le_url = parseHtml.match(/"url": "(.*?)"/)[1]
  161. const _token_key = CryptoJS.enc.Utf8.parse("A42EAC0C2B408472");
  162. const _token_iv = CryptoJS.enc.Utf8.parse(le_token);
  163. return CryptoJS.AES.decrypt(le_url, _token_key, {'iv': _token_iv}).toString(CryptoJS.enc.Utf8);
  164. } catch (e) {
  165. return 'toast://解析失败'
  166. }
  167. }),
  168. col_type: 'text_4',
  169. })
  170. })
  171. } else {
  172. d.push({
  173. title: '暂无剧集',
  174. col_type: 'text_center_1'
  175. })
  176. }
  177. setResult(d);
  178. }
  179. const searchParse = () => {
  180. let d = [];
  181. const html = getResCode()
  182. const list = pdfa(html, '.myui-vodlist__media&&li')
  183. list.forEach(item => {
  184. d.push({
  185. title: pdfh(item, 'h4&&Text'),
  186. desc: pdfh(item, '.text-muted&&Text'),
  187. url: pd(item, 'a&&href')+'#immersiveTheme#',
  188. pic_url: pd(item, '.myui-vodlist__thumb&&data-original'),
  189. })
  190. })
  191. setResult(d);
  192. }