From 0906b4fd5fda839fe01dfdff1d0b9bbde6e15c81 Mon Sep 17 00:00:00 2001 From: Slasar41 Date: Wed, 8 Apr 2020 14:17:23 +0700 Subject: [PATCH] MangaKakalots: Added website support (Issue #894) --- lua/modules/MangaKakalot.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lua/modules/MangaKakalot.lua b/lua/modules/MangaKakalot.lua index 0fb4b7b8f..69eaa0794 100644 --- a/lua/modules/MangaKakalot.lua +++ b/lua/modules/MangaKakalot.lua @@ -17,7 +17,7 @@ function getinfo() end mangainfo.url=u local x=TXQuery.Create(http.document) - if module.website == 'MangaKakalot' then + if module.website == 'MangaKakalot' or module.website == 'MangaKakalots' then mangainfo.title=x.xpathstring('//ul[@class="manga-info-text"]/li/h1') mangainfo.coverlink=MaybeFillHost(module.RootURL, x.xpathstring('//div[@class="manga-info-pic"]/img/@src')) mangainfo.authors=x.xpathstringall('//ul[@class="manga-info-text"]/li[contains(., "Author")]/a') @@ -74,6 +74,9 @@ function getpagenumber() if task.pagelinks.count == 0 then x.xpathstringall('//div[@class="container-chapter-reader"]/img/@src', task.pagelinks) end + if task.pagelinks.count == 0 then + x.xpathstringall('//div[@id="vungdoc"]/img/@data-src', task.pagelinks) + end return true else return false @@ -84,7 +87,7 @@ local dirurl = '/manga_list?type=newest&category=all&state=all&page=' local dirs = '/genre-all/' function getnameandlink() - if module.website == 'MangaKakalot' then + if module.website == 'MangaKakalot' or module.website == 'MangaKakalots' then if http.get(module.rooturl .. dirurl .. IncStr(url)) then local x = TXQuery.Create(http.Document) x.XPathHREFAll('//div[@class="truyen-list"]/div[@class="list-truyen-item-wrap"]/h3/a', links, names) @@ -104,7 +107,7 @@ function getnameandlink() end function getdirectorypagenumber() - if module.website == 'MangaKakalot' then + if module.website == 'MangaKakalot' or module.website == 'MangaKakalots' then if http.GET(module.RootURL .. dirurl .. '1') then page = tonumber(TXQuery.Create(http.Document).xpathstring('//a[contains(@class, "page_last")]/@href'):match('page=(%d+)')) return no_error @@ -136,4 +139,5 @@ end function Init() AddWebsiteModule('MangaKakalot', 'https://mangakakalot.com') AddWebsiteModule('MangaNelo', 'https://manganelo.com') + AddWebsiteModule('MangaKakalots', 'https://mangakakalots.com') end