0
0

免费小说网.txt 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. // ==MiruExtension==
  2. // @name 免费小说网
  3. // @version v0.0.1
  4. // @author MiaoMint
  5. // @lang zh-cn
  6. // @license MIT
  7. // @package ren.0u0.miru.mfxs
  8. // @type fikushon
  9. // @webSite https://www.493d.com/
  10. // @nsfw true
  11. // ==/MiruExtension==
  12. export default class Biquge extends Extension {
  13. async latest() {
  14. const res = await this.request("/top_allvipvote/1.html")
  15. const liList = res.match(/<li class="g_col_6">([\s\S]+?)<\/li>/g)
  16. const manga = []
  17. liList.forEach(element => {
  18. const url = element.match(/href="https:\/\/www.493d.com(.+?)"/)[1]
  19. const title = element.match(/title="(.+?)"/)[1]
  20. const cover = element.match(/src="(.+?)"/)[1]
  21. manga.push({
  22. title,
  23. url,
  24. cover
  25. })
  26. });
  27. return manga
  28. }
  29. async search(kw, page) {
  30. const res = await this.request(`/modules/article/search.php?searchkey=${kw}&searchtype=articlename&page=${page}`)
  31. console.log(res);
  32. let trList
  33. const manga = []
  34. try {
  35. trList = res.match(/<li class="pr pb20 mb20" id="hism">([\s\S]+?)<\/li>/g)
  36. trList.forEach(element => {
  37. const url = element.match(/href="https:\/\/www.493d.com(.+?)"/)[1]
  38. const title = element.match(/class="c_strong" title="(.+?)"/)[1]
  39. const cover = element.match(/src="(.+?)"/)[1]
  40. const update = element.match(/<span class="vam">最新章节: <a href="(.+?)" target="_blank">(.+?)<\/a><\/span>/)[2]
  41. manga.push({
  42. title,
  43. url,
  44. cover,
  45. update
  46. })
  47. });
  48. } catch (error) {
  49. return []
  50. }
  51. return manga
  52. }
  53. async detail(url) {
  54. const res = await this.request(`/${url}`, {
  55. headers: {
  56. "miru-referer": "https://www.493d.com/"
  57. }
  58. })
  59. console.log(res);
  60. const title = res.match(/property="og:title" content="(.+?)"/)[1]
  61. const cover = res.match(/property="og:image" content="(.+?)"/)[1]
  62. const desc = res.match(/<meta property="og:description" content="([\s\S]+?)"\/>/)[1]
  63. const li = res.match(/<li class="w33p">([\s\S]+?)<\/li>/g)
  64. const episodes = []
  65. li.forEach(e => {
  66. const episode = e.match(/href="https:\/\/www.493d.com(.+?)" class="c_strong vam ell db"><span class="vam">([\s\S]+?)<\/span><\/a>/)
  67. episodes.push({
  68. name: episode[2],
  69. url: episode[1]
  70. })
  71. })
  72. return {
  73. title,
  74. cover,
  75. desc,
  76. episodes: [{
  77. title: "目录",
  78. urls: episodes
  79. }]
  80. }
  81. }
  82. async watch(url) {
  83. const res = await this.request(`/${url}`)
  84. const title = res.match(/<h1>(.+?)<\/h1>/)[1]
  85. const contents = res.match(/&emsp;&emsp;(.+?)<br \/>/g)
  86. let content = []
  87. contents.forEach((e) => {
  88. content.push(e.match(/&emsp;&emsp;(.+?)<br \/>/)[1])
  89. })
  90. return {
  91. content,
  92. title,
  93. }
  94. }
  95. }