-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NHentai] Updated thumbnail parser #21
close #21
- Loading branch information
1 parent
820daf6
commit b93c41d
Showing
2 changed files
with
5 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
nhentai=Parser:new("nhentai","https://nhentai.to","DIF","NHENTAI",3)nhentai.NSFW=true;local function a(b)return b:gsub("&#([^;]-);",function(c)local d=tonumber("0"..c)or tonumber(c)return d and u8c(d)or"&#"..c..";"end):gsub("&(.-);",function(c)return HTML_entities and HTML_entities[c]and u8c(HTML_entities[c])or"&"..c..";"end)end;local function e(f)local g={}Threads.insertTask(g,{Type="StringRequest",Link=f,Table=g,Index="text"})while Threads.check(g)do coroutine.yield(false)end;return g.text or""end;function nhentai:getManga(f,h)local i=e(f)h.NoPages=true;for j,k,l in i:gmatch('class="gallery".-href="(%S-)".-data%-src="(%S-)".->([^<]-)</div>')do h[#h+1]=CreateManga(a(l),j,k,self.ID,self.Link..j)h.NoPages=false;coroutine.yield(false)end end;function nhentai:getPopularManga(m,h)self:getManga(self.Link.."/?page="..m,h)end;function nhentai:searchManga(n,m,h)self:getManga(self.Link.."/search/?q="..n.."&page="..m,h)end;function nhentai:getChapters(o,h)h[#h+1]={Name="Read chapter",Link=o.Link,Pages={},Manga=o}end;function nhentai:prepareChapter(p,h)local i=e(self.Link..p.Link)for f in i:gmatch('class="gallerythumb".-href="(%S-)"')do h[#h+1]=self.Link..f end end;function nhentai:loadChapterPage(f,h)h.Link=e(f):match('image%-container".-src="(%S-)"')end | ||
nhentai=Parser:new("nhentai","https://nhentai.to","DIF","NHENTAI",4)nhentai.NSFW=true;local function a(b)return b:gsub("&#([^;]-);",function(c)local d=tonumber("0"..c)or tonumber(c)return d and u8c(d)or"&#"..c..";"end):gsub("&(.-);",function(c)return HTML_entities and HTML_entities[c]and u8c(HTML_entities[c])or"&"..c..";"end)end;local function e(f)local g={}Threads.insertTask(g,{Type="StringRequest",Link=f,Table=g,Index="text"})while Threads.check(g)do coroutine.yield(false)end;return g.text or""end;function nhentai:getManga(f,h)local i=e(f)h.NoPages=true;for j,k,l in i:gmatch('class="gallery".-href="(%S-)".-data%-src="(%S-)".->([^<]-)</div>')do if k:match("^http")==nil then k="https://cdn.nload.xyz"..k end;h[#h+1]=CreateManga(a(l),j,k,self.ID,self.Link..j)h.NoPages=false;coroutine.yield(false)end end;function nhentai:getPopularManga(m,h)self:getManga(self.Link.."/?page="..m,h)end;function nhentai:searchManga(n,m,h)self:getManga(self.Link.."/search/?q="..n.."&page="..m,h)end;function nhentai:getChapters(o,h)h[#h+1]={Name="Read chapter",Link=o.Link,Pages={},Manga=o}end;function nhentai:prepareChapter(p,h)local i=e(self.Link..p.Link)for f in i:gmatch('class="gallerythumb".-href="(%S-)"')do h[#h+1]=self.Link..f end end;function nhentai:loadChapterPage(f,h)h.Link=e(f):match('image%-container".-src="(%S-)"')end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters