Skip to content

Commit

Permalink
Merge pull request fmd-project-team#437 from Slasar41/patch-3
Browse files Browse the repository at this point in the history
Fix chapter download [BacaManga]
  • Loading branch information
SDXC authored Aug 19, 2019
2 parents efbe52a + 30f0f32 commit 06d255d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lua/modules/MangaShiro.lua
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,13 @@ function getpagenumber()
if http.get(MaybeFillHost(module.rooturl,url)) then
if module.website == 'BacaManga' then
local x = TXQuery.Create(http.Document)
local s = x.xpathstring('//script[contains(., "atob")]')
s = GetBetween('atob("', '");', s)
s = unescape(DecodeBase64(s))
s = s:gsub('+', ' ')
x.parsehtml(s)
x.xpathstringall('//img/@src', task.pagelinks)
local s = x.xpathstring('//div[contains(@id, "readerarea")]')
local id = GetBetween('atob(', ');', s)
s = GetBetween('var '..id..' = "', '";', s)
s = unescape(DecodeBase64(s))
s = s:gsub('+', ' ')
x.parsehtml(s)
x.xpathstringall('//img/@src', task.pagelinks)
else
if task.pagelinks.count < 1 then TXQuery.Create(http.Document).xpathstringall('//*[@id="readerarea"]/div//img/@src', task.pagelinks) end
if task.pagelinks.count < 1 then TXQuery.Create(http.Document).xpathstringall('//*[@id="readerarea"]//a/@href', task.pagelinks) end
Expand Down

0 comments on commit 06d255d

Please sign in to comment.