From 1dfee1592d2170c9db11cd32bfdb60e31810f97a Mon Sep 17 00:00:00 2001 From: rs3mk Date: Thu, 2 Apr 2026 22:37:54 -0500 Subject: [PATCH 1/3] Create LectorHentai.lua --- lua/modules/LectorHentai.lua | 85 ++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 lua/modules/LectorHentai.lua diff --git a/lua/modules/LectorHentai.lua b/lua/modules/LectorHentai.lua new file mode 100644 index 000000000..36e89324c --- /dev/null +++ b/lua/modules/LectorHentai.lua @@ -0,0 +1,85 @@ +function Init() + local m = NewWebsiteModule() + m.ID = '4ac85000451741f990569381e0e10752' + m.Name = 'LectorHentai' + m.RootURL = 'https://lectorhentai.com' + m.Category = 'Spanish' + m.OnGetDirectoryPageNumber = 'GetDirectoryPageNumber' + m.OnGetNameAndLink = 'GetNameAndLink' + m.OnGetInfo = 'GetInfo' + m.OnGetPageNumber = 'GetPageNumber' + m.OnBeforeDownloadImage = 'BeforeDownloadImage' +end + +-- Número de páginas (aproximado hasta que no haya resultados) +function GetDirectoryPageNumber() + PAGENUMBER = 9999 -- no hay paginación clara + return no_error +end + +-- Lista de mangas +function GetNameAndLink() + if HTTP.GET(MODULE.RootURL .. '/tipo/all?lenguaje=all&page=' .. (URL + 1)) then + local x = CreateTXQuery(HTTP.Document) + + x.XPathHREFTitleAll( + '//div[@class="listupd"]//div[@class="bsx"]/a', + LINKS, NAMES + ) + + return no_error + else + return net_problem + end +end + +-- Info del manga +function GetInfo() + MANGAINFO.URL = MaybeFillHost(MODULE.RootURL, URL) + + if not HTTP.GET(MANGAINFO.URL) then return net_problem end + + local x = CreateTXQuery(HTTP.Document) + + MANGAINFO.Title = x.XPathString('//b[contains(.,"Título")]/following-sibling::span') + MANGAINFO.CoverLink = 'https:' .. x.XPathString('//div[@class="bigcover"]//img/@src') + MANGAINFO.Authors = x.XPathString('//b[contains(.,"Artista")]/following-sibling::span') + MANGAINFO.Genres = x.XPathStringAll('//b[contains(.,"Generos")]/following-sibling::span/a') + MANGAINFO.Summary = MANGAINFO.Title + + -- SOLO 1 capitulo + local link = x.XPathString('//a[contains(@class,"leer")]/@href') + + if link ~= '' then + MANGAINFO.ChapterLinks.Add(link) + MANGAINFO.ChapterNames.Add(MANGAINFO.Title) + end + + return no_error + +end + +-- Extraer imágenes +function GetPageNumber() + if not HTTP.GET(MaybeFillHost(MODULE.RootURL, URL)) then return net_problem end + + local html = HTTP.Document.ToString() + + -- Extraer JSON dentro de ts_reader.run(...) + local json = html:match('ts_reader%.run%((.-)%)') + + if json then + -- Extraer URLs de imágenes + for img in json:gmatch('"//(.-)"') do + TASK.PageLinks.Add('https://' .. img) + end + end + + return true + +end + +function BeforeDownloadImage() + HTTP.Headers.Values['Referer'] = MaybeFillHost(MODULE.RootURL, TASK.ChapterLinks[TASK.CurrentDownloadChapterPtr]) + return true +end From 12719574a6c54ba05590efb9e149d3b4a09ff168 Mon Sep 17 00:00:00 2001 From: rs3mk Date: Sun, 5 Apr 2026 04:48:09 -0500 Subject: [PATCH 2/3] Update LectorHentai.lua Update get mangas --- lua/modules/LectorHentai.lua | 38 +++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/lua/modules/LectorHentai.lua b/lua/modules/LectorHentai.lua index 36e89324c..cb235c4f0 100644 --- a/lua/modules/LectorHentai.lua +++ b/lua/modules/LectorHentai.lua @@ -4,33 +4,39 @@ function Init() m.Name = 'LectorHentai' m.RootURL = 'https://lectorhentai.com' m.Category = 'Spanish' - m.OnGetDirectoryPageNumber = 'GetDirectoryPageNumber' m.OnGetNameAndLink = 'GetNameAndLink' m.OnGetInfo = 'GetInfo' m.OnGetPageNumber = 'GetPageNumber' m.OnBeforeDownloadImage = 'BeforeDownloadImage' end --- Número de páginas (aproximado hasta que no haya resultados) -function GetDirectoryPageNumber() - PAGENUMBER = 9999 -- no hay paginación clara - return no_error -end - -- Lista de mangas function GetNameAndLink() - if HTTP.GET(MODULE.RootURL .. '/tipo/all?lenguaje=all&page=' .. (URL + 1)) then - local x = CreateTXQuery(HTTP.Document) + local url = MODULE.RootURL .. '/tipo/all?lenguaje=all&page=1' + + if not HTTP.GET(url) then return net_problem end + + local x = CreateTXQuery(HTTP.Document) - x.XPathHREFTitleAll( - '//div[@class="listupd"]//div[@class="bsx"]/a', - LINKS, NAMES - ) + while true do + -- Extraer mangas + for v in x.XPath('//div[@class="listupd"]//div[@class="bsx"]/a').Get() do + LINKS.Add(v.GetAttribute('href')) + NAMES.Add(x.XPathString('div[@class="bigor"]/div[@class="tt"]', v)) + end + + -- Buscar siguiente página + local next_url = x.XPathString('//div[@class="hpage"]/a[contains(@class,"r")]/@href') + + if next_url == '' then break end - return no_error - else - return net_problem + UPDATELIST.UpdateStatusText('Cargando ' .. next_url) + + if not HTTP.GET(next_url) then break end + x.ParseHTML(HTTP.Document) end + + return no_error end -- Info del manga From bcdc475192feb149c3b6d02218ad462a40ba1011 Mon Sep 17 00:00:00 2001 From: rs3mk Date: Sun, 5 Apr 2026 04:58:34 -0500 Subject: [PATCH 3/3] Update LectorHentai.lua Update get mangas. --- lua/modules/LectorHentai.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/modules/LectorHentai.lua b/lua/modules/LectorHentai.lua index cb235c4f0..90f7cef5f 100644 --- a/lua/modules/LectorHentai.lua +++ b/lua/modules/LectorHentai.lua @@ -22,7 +22,7 @@ function GetNameAndLink() -- Extraer mangas for v in x.XPath('//div[@class="listupd"]//div[@class="bsx"]/a').Get() do LINKS.Add(v.GetAttribute('href')) - NAMES.Add(x.XPathString('div[@class="bigor"]/div[@class="tt"]', v)) + NAMES.Add(x.XPathString('.//div[@class="tt"]', v)) end -- Buscar siguiente página