This repository was archived by the owner on Oct 31, 2020. It is now read-only.
forked from riderkick/FMD
-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathKissManga.lua
More file actions
79 lines (74 loc) · 2.57 KB
/
KissManga.lua
File metadata and controls
79 lines (74 loc) · 2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
function GetInfo()
mangainfo.url=MaybeFillHost(module.RootURL, url)
if http.get(mangainfo.url) then
local x=TXQuery.Create(http.document)
if mangainfo.title == '' then
mangainfo.title = x.xpathstring('//strong[@class="bigChar"]')
end
local coverlink = x.xpathstring('//div[@class="a_center"]//img/@src')
if coverlink ~= '' then
if coverlink:find('^//') then coverlink = 'https:' .. coverlink; end
mangainfo.coverlink=MaybeFillHost(module.RootURL, coverlink)
end
mangainfo.authors=x.xpathstringall('//*[@class="info"][2]//a[@class="dotUnder"]')
--mangainfo.artists=x.xpathstringall('//*[@class="rightBox"]/a[contains(@href,"/?artist=")]')
mangainfo.genres=x.xpathstringall('//*[@class="info"][3]//a[@class="dotUnder"]')
mangainfo.genres = mangainfo.genres:gsub("%s+Manga", "")
mangainfo.summary=x.xpathstring('//div[@class="summary"]//p')
mangainfo.status = MangaInfoStatusIfPos(x.xpathstring('//*[@class="item_static"][1]'), 'Ongoing', 'Completed')
x.xpathhrefall('//div[@class="listing listing8515 full"]//div//div//h3//a', mangainfo.chapterlinks, mangainfo.chapternames)
InvertStrings(mangainfo.chapterlinks, mangainfo.chapternames)
return no_error
else
return net_problem
end
end
function GetPageNumber()
if http.get(MaybeFillHost(module.rooturl,url)) then
x=TXQuery.Create(http.Document)
x.xpathstringall('//div[@id="centerDivVideo"]/img/@src', task.PageLinks)
return true
else
return false
end
end
function GetDirectoryPageNumber()
if http.GET(AppendURLDelim(module.RootURL)..'/manga_list') then
x = TXQuery.Create(http.Document)
page = x.XPathString('//ul[@class="pager"]/li/a[last()-1]')
page = page:gsub("Last (", "")
page = page:gsub(")", "")
page = tonumber(page)
if page == nil then
page = 1
end
return true
else
return false
end
end
function GetNameAndLink()
if http.get(module.rooturl..'/manga_list?page='..IncStr(url)) then
x=TXQuery.Create(http.Document)
x.xpathhrefall('//a[@class="item_movies_link"]', links, names)
return no_error
else
return net_problem
end
end
function BeforeDownloadImage()
http.headers.values['Referer'] = task.PageContainerLinks.text
return true
end
function Init()
m=NewModule()
m.category='English'
m.website='KissManga'
m.rooturl='https://kissmanga.org'
m.lastupdated='Oct 08, 2020'
m.ongetinfo='GetInfo'
m.ongetpagenumber='GetPageNumber'
m.ongetdirectorypagenumber='GetDirectoryPageNumber'
m.ongetnameandlink='GetNameAndLink'
m.onbeforedownloadimage='BeforeDownloadImage'
end