Skip to content
This repository has been archived by the owner on Oct 31, 2020. It is now read-only.

Commit

Permalink
Fixed hitomi.la from riderkick#1696
Browse files Browse the repository at this point in the history
  • Loading branch information
SDXC committed Mar 29, 2019
1 parent 46612bc commit ec03f0a
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions lua/modules/HitomiLa.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ end
function getpagenumber()
task.pagelinks.clear()
if http.get(MaybeFillHost(module.rooturl, url)) then
local subdomain = nil
local subdomain = nil
local isfixed = 0
local galleryid = tonumber(ReplaceRegExpr('(?i)^.*reader/(\\d+).*$', url, '$1'))
local prefix = string.char(97 + (galleryid % 2)) .. 'a.'
if galleryid ~= nil then
subdomain = string.char(97 + (galleryid % 2)) .. 'a.' ..domain
subdomain = prefix ..domain
end
local x=TXQuery.Create(http.Document)
local v=x.xpath('//div[@class="img-url"]')
Expand All @@ -43,6 +45,21 @@ function getpagenumber()
s=s:gsub('//[^/]+/', '//'..subdomain..'/')
end
s = set_https(s)

if isfixed == 0 then
if http.get(s) then
err=TXQuery.Create(http.Document)
e = err.xpathstring('//center/h1')
if e == '403 Forbidden' then
prefix = string.char(97 + (galleryid % 2) - 1) .. 'a.'
subdomain = prefix ..domain
s=v.get(i).toString
s=s:gsub('//[^/]+/', '//'..subdomain..'/')
s = set_https(s)
end
isfixed = 1
end
end
task.pagelinks.add(s)
end
else
Expand Down Expand Up @@ -73,6 +90,7 @@ function Init()
m.website = 'HitomiLa'
m.rooturl = 'https://'..domain
m.category = 'H-Sites'
m.lastupdated = 'March 29, 2019'
m.sortedlist=true
m.ongetinfo='getinfo'
m.ongetpagenumber='getpagenumber'
Expand Down

0 comments on commit ec03f0a

Please sign in to comment.