400.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. const baseParse = _ => {
  2. let d = []
  3. let [url, page] = MY_URL.split('##')
  4. const class_url = getMyVar('400.tyrantgenesis.class_url')
  5. if (class_url !== MY_RULE.class_url) {
  6. clearMyVar('400.tyrantgenesis.url')
  7. putMyVar('400.tyrantgenesis.class_url', MY_RULE.class_url)
  8. }
  9. url = getMyVar('400.tyrantgenesis.url', url)
  10. url = url.replace('.html', '-'+page+'.html')
  11. const html = fetch(url)
  12. if (parseInt(page) === 1) {
  13. const category = pdfa(html, '.gm-meta&&a')
  14. category.forEach(cate => {
  15. let className = pdfh(cate, 'a&&class')
  16. let title = pdfh(cate, 'a&&Text')
  17. d.push({
  18. title: className === 'on' ? '““””<b><span style="color: #1cb96f">'+title+"</span></b>" : title,
  19. url: $(pd(cate, 'a&&href')).lazyRule(() => {
  20. putMyVar('400.tyrantgenesis.url', input)
  21. refreshPage(true)
  22. return "hiker://empty"
  23. }),
  24. col_type: 'scroll_button',
  25. })
  26. })
  27. d.push({
  28. col_type:"blank_block"
  29. })
  30. }
  31. const list = pdfa(html, '.gm-list&&.item')
  32. list.forEach(item => {
  33. let pic_url = pdfh(item, 'img&&data-src')
  34. d.push({
  35. title: pdfh(item, '.info&&.title&&Text'),
  36. desc: pdfh(item, '.tag2&&Text'),
  37. pic_url: pic_url.startsWith('http') ? pic_url : 'https:'+pic_url,
  38. url: pd(item, '.title&&href')+'#immersiveTheme#',
  39. col_type: 'movie_3_marquee',
  40. })
  41. })
  42. setResult(d);
  43. }
  44. const secParse = _ => {
  45. let d = [];
  46. const html = getResCode()
  47. const video_info = pdfh(html, '.gm-vod&&Html')
  48. const video_content = pdfa(video_info, '.more&&.info')
  49. d.push(
  50. {
  51. title: video_content.filter((item, index) => index < 3).map(item => pdfh(item, '.info&&Text')).join('\n'),
  52. desc: pdfh(video_content[video_content.length - 1], '.info&&Text'),
  53. url: MY_URL,
  54. pic_url: pd(video_info, 'img&&src'),
  55. col_type: 'movie_1_vertical_pic_blur',
  56. },
  57. {
  58. col_type: 'line_blank'
  59. },
  60. )
  61. const video_source_json = html.match(/var post = (.*?);/)[1]
  62. const video_source = JSON.parse(video_source_json).vods
  63. video_source.forEach(source => {
  64. let list = source.source
  65. d.push({
  66. title: source.name,
  67. url: list[0][1],
  68. pic_url: 'https://lanmeiguojiang.com/tubiao/movie/6.svg',
  69. col_type: 'avatar',
  70. })
  71. list.forEach(item => {
  72. d.push({
  73. title: item[0],
  74. url: item[1],
  75. col_type: 'text_3',
  76. })
  77. })
  78. d.push({
  79. col_type: 'line'
  80. })
  81. })
  82. setResult(d);
  83. }