Skip to content

Commit

Permalink
Added TruyengiHot #1
Browse files Browse the repository at this point in the history
request from #1 (comment)

(Search doesn't work on site so in Noboru too)
  • Loading branch information
Creckeryop committed Jul 15, 2022
1 parent c5f77be commit 03456df
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 23 deletions.
46 changes: 23 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# NOBORU - Parsers
This repo is created to store parsers for NOBORU app on PS vita
## Supported Parsers:
| Different | Russian | English | Japan | Spanish | Portuguese | French | Turkish | Italian | Vietnamese | Polish | German | Brazil | Indonesian | Korean | Thai |
| :-------------: | :-----------: | :---------------: | :-----------: | :----------------: | :--------------: | :---------------: | :-------------: | :-----------: | :--------: | :-----------: | :--------: | :-------: | :--------: | :--------: | :------------: |
| MangaDex | ~~ReadManga~~ | ~~MangaHub~~ | SenManga | LeoManga | Animaregia | ~~LelScanVF~~ | ~~Mabushimajo~~ | ~~MangaEden~~ | TruyenQQ | Phoenix-Scans | NineManga | NineManga | Komikid | manatoki95 | NiceOppai |
| ~~Bato.to*~~ | МангаПоиск | ~~MangaReader~~ | ~~Manga1000~~ | InManga | UnionMangas | ScanFR | Puzzmos | NineManga | | | Wie Manga! | | | | Oremanga |
| LoveHug (RAW) | ~~MintManga~~ | ~~MangaPanda~~ | | ~~Submanga~~ | ~~GoldenMangas~~ | NineManga | ~~MangaTR~~ | | | | | | | | CartoonClub-TH |
| RawDevArt (RAW) | ~~SelfManga~~ | MangaTown | | NineManga | BRMangas | | SeriManga | | | | | | | | |
| | Desu | ~~MangaOwl~~ | | HeavenManga | | | MangaDenizi | | | | | | | | |
| | NineManga | ReadComicsOnline | | ~~TumangaOnline~~ | | | | | | | | | | | |
| | MangaOneLove | MangaKakalot | | ~~MangaDoor~~ | | | | | | | | | | | |
| | Манга-Тян! | MangaNelo | | MangaLibros | | | | | | | | | | | |
| | MangaHubRu | ~~VLComic~~ | | | | | | | | | | | | | |
| | | ~~MangaEden~~ | | | | | | | | | | | | | |
| | | NineManga | | | | | | | | | | | | | |
| | | ~~MangaSee~~ | | | | | | | | | | | | | |
| | | XoXoComics | | | | | | | | | | | | | |
| | | ReadComicOnlineTo | | | | | | | | | | | | | |
| | | Mangafast | | | | | | | | | | | | | |
| | | Reaper Scans | | | | | | | | | | | | | |
| **NSFW** | **NSFW** | **NSFW** | **NSFW** | **NSFW** | **NSFW** | **NSFW** | **NSFW** | **NSFW** | **NSFW** | **NSFW** | **NSFW** | **NSFW** | **NSFW** | **NSFW** | **NSFW** |
| nhentai | Nude-Moon | PervEden | | DoujinHentai | | Histoire d'Hentai | | PervEden | | | | | | | |
| HentaiRead | ~~AllHentai~~ | ~~HentaiCafe~~ | | VerComicsPorno.xxx | | | | | | | | | | | |
| 9hentai | Яой-Тян! | MyHentaiGallery | | | | | | | | | | | | | |
| Hentai Shark | Хентай-Тян! | Hentai20 | | | | | | | | | | | | | |
| Different | Russian | English | Japan | Spanish | Portuguese | French | Turkish | Italian | Vietnamese | Polish | German | Brazil | Indonesian | Korean | Thai |
| :-------------: | :-----------: | :---------------: | :-----------: | :----------------: | :--------------: | :---------------: | :-------------: | :-----------: | :---------: | :-----------: | :--------: | :-------: | :--------: | :--------: | :------------: |
| MangaDex | ~~ReadManga~~ | ~~MangaHub~~ | SenManga | LeoManga | Animaregia | ~~LelScanVF~~ | ~~Mabushimajo~~ | ~~MangaEden~~ | TruyenQQ | Phoenix-Scans | NineManga | NineManga | Komikid | manatoki95 | NiceOppai |
| ~~Bato.to*~~ | МангаПоиск | ~~MangaReader~~ | ~~Manga1000~~ | InManga | UnionMangas | ScanFR | Puzzmos | NineManga | TruyengiHot | | Wie Manga! | | | | Oremanga |
| LoveHug (RAW) | ~~MintManga~~ | ~~MangaPanda~~ | | ~~Submanga~~ | ~~GoldenMangas~~ | NineManga | ~~MangaTR~~ | | | | | | | | CartoonClub-TH |
| RawDevArt (RAW) | ~~SelfManga~~ | MangaTown | | NineManga | BRMangas | | SeriManga | | | | | | | | |
| | Desu | ~~MangaOwl~~ | | HeavenManga | | | MangaDenizi | | | | | | | | |
| | NineManga | ReadComicsOnline | | ~~TumangaOnline~~ | | | | | | | | | | | |
| | MangaOneLove | MangaKakalot | | ~~MangaDoor~~ | | | | | | | | | | | |
| | Манга-Тян! | MangaNelo | | MangaLibros | | | | | | | | | | | |
| | MangaHubRu | ~~VLComic~~ | | | | | | | | | | | | | |
| | | ~~MangaEden~~ | | | | | | | | | | | | | |
| | | NineManga | | | | | | | | | | | | | |
| | | ~~MangaSee~~ | | | | | | | | | | | | | |
| | | XoXoComics | | | | | | | | | | | | | |
| | | ReadComicOnlineTo | | | | | | | | | | | | | |
| | | Mangafast | | | | | | | | | | | | | |
| | | Reaper Scans | | | | | | | | | | | | | |
| **NSFW** | **NSFW** | **NSFW** | **NSFW** | **NSFW** | **NSFW** | **NSFW** | **NSFW** | **NSFW** | **NSFW** | **NSFW** | **NSFW** | **NSFW** | **NSFW** | **NSFW** | **NSFW** |
| nhentai | Nude-Moon | PervEden | | DoujinHentai | | Histoire d'Hentai | | PervEden | | | | | | | |
| HentaiRead | ~~AllHentai~~ | ~~HentaiCafe~~ | | VerComicsPorno.xxx | | | | | | | | | | | |
| 9hentai | Яой-Тян! | MyHentaiGallery | | | | | | | | | | | | | |
| Hentai Shark | Хентай-Тян! | Hentai20 | | | | | | | | | | | | | |

**Catalog works with option Preferred Language and deletes extra manga from it*<br>
*strikethrough parsers don't work*
Expand Down
1 change: 1 addition & 0 deletions parsers/[VI]TruyengiHot.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TruyengiHot=Parser:new("TruyengiHot","https://www.truyengihot.vip","VIE","TRUYENGIHOTVI",1)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 TruyengiHot:getManga(f,h)local i=e(f)h.NoPages=true;for j,k,l in i:gmatch('href="[^"]*/([^"/]-)%.html" class="cw%-list%-item.-src="([^"]-)" alt="([^"]-)"')do h[#h+1]=CreateManga(a(l),j,k,self.ID,self.Link.."/truyen/"..j..".html")h.NoPages=false;coroutine.yield(false)end end;function TruyengiHot:getPopularManga(m,h)self:getManga(self.Link.."/danh-sach-truyen.html?sort=hot&sort_type=DESC&page="..m,h)end;function TruyengiHot:getLatestManga(m,h)self:getManga(self.Link.."/danh-sach-truyen.html?sort=last_update&sort_type=DESC&page="..m,h)end;function TruyengiHot:searchManga(n,m,h)self:getManga(self.Link.."/danh-sach-truyen.html?name="..n.."&sort=hot&sort_type=DESC&page="..m,h)end;function TruyengiHot:getChapters(o,h)local i=e(self.Link.."/truyen/"..o.Link..".html")local p={}for j,l in i:gmatch('class="episode%-item"[^>]-href="[^"]*/([^"/]-)%.html">.->%s*([^<]-)%s*</span>')do p[#p+1]={Name=a(l),Link=j,Pages={},Manga=o}end;for q=#p,1,-1 do h[#h+1]=p[q]end end;function TruyengiHot:prepareChapter(r,h)local i=e(self.Link.."/chapter/"..r.Link..".html")for j in i:gmatch('data%-src="([^"]-)"')do h[#h+1]=j end end;function TruyengiHot:loadChapterPage(f,h)h.Link=f end
82 changes: 82 additions & 0 deletions source/[VI]TruyengiHot.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
TruyengiHot = Parser:new("TruyengiHot", "https://www.truyengihot.vip", "VIE", "TRUYENGIHOTVI", 1)

local function stringify(string)
return string:gsub(
"&#([^;]-);",
function(a)
local x = tonumber("0" .. a) or tonumber(a)
return x and u8c(x) or "&#" .. a .. ";"
end
):gsub(
"&(.-);",
function(a)
return HTML_entities and HTML_entities[a] and u8c(HTML_entities[a]) or "&" .. a .. ";"
end
)
end

local function downloadContent(link)
local f = {}
Threads.insertTask(
f,
{
Type = "StringRequest",
Link = link,
Table = f,
Index = "text"
}
)
while Threads.check(f) do
coroutine.yield(false)
end
return f.text or ""
end

function TruyengiHot:getManga(link, dt)
local content = downloadContent(link)
dt.NoPages = true
for Link, ImageLink, Name in content:gmatch('href="[^"]*/([^"/]-)%.html" class="cw%-list%-item.-src="([^"]-)" alt="([^"]-)"') do
dt[#dt + 1] = CreateManga(stringify(Name), Link, ImageLink, self.ID, self.Link .. "/truyen/" .. Link .. ".html")
dt.NoPages = false
coroutine.yield(false)
end
end

function TruyengiHot:getPopularManga(page, dt)
self:getManga(self.Link .. "/danh-sach-truyen.html?sort=hot&sort_type=DESC&page=" .. page, dt)
end

function TruyengiHot:getLatestManga(page, dt)
self:getManga(self.Link .. "/danh-sach-truyen.html?sort=last_update&sort_type=DESC&page=" .. page, dt)
end

function TruyengiHot:searchManga(search, page, dt)
self:getManga(self.Link .. "/danh-sach-truyen.html?name=" .. search .. "&sort=hot&sort_type=DESC&page=" .. page, dt)
end

function TruyengiHot:getChapters(manga, dt)
local content = downloadContent(self.Link .. "/truyen/" .. manga.Link .. ".html")
local t = {}
for Link, Name in content:gmatch('class="episode%-item"[^>]-href="[^"]*/([^"/]-)%.html">.->%s*([^<]-)%s*</span>') do
t[#t + 1] = {
Name = stringify(Name),
Link = Link,
Pages = {},
Manga = manga
}
end
for i = #t, 1, -1 do
dt[#dt + 1] = t[i]
end
end

function TruyengiHot:prepareChapter(chapter, dt)
local content = downloadContent(self.Link .. "/chapter/" .. chapter.Link .. ".html")
for Link in content:gmatch('data%-src="([^"]-)"') do
dt[#dt + 1] = Link
end
end

function TruyengiHot:loadChapterPage(link, dt)
dt.Link = link
end

0 comments on commit 03456df

Please sign in to comment.