Skip to content

Commit

Permalink
[readcomiconline] update (#5866)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Jul 23, 2024
1 parent 5207a0c commit 7b445ec
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions gallery_dl/extractor/readcomiconline.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,16 @@ def metadata(self, page):
}

def images(self, page):
return [
(beau(url), None)
for url in text.extract_iter(
page, "lstImages.push('", "'",
)
]
results = []

for block in page.split(" pth = '")[1:]:
pth = text.extr(block, "", "'")
for needle, repl in re.findall(
r"pth = pth\.replace\(/([^/]+)/g, [\"']([^\"']*)", block):
pth = pth.replace(needle, repl)
results.append((beau(pth), None))

return results


class ReadcomiconlineComicExtractor(ReadcomiconlineBase, MangaExtractor):
Expand Down Expand Up @@ -116,18 +120,18 @@ def chapters(self, page):


def beau(url):
"""https://readcomiconline.li/Scripts/rguard.min.js"""
url = url.replace("_x236", "d")
url = url.replace("_x945", "g")
"""https://readcomiconline.li/Scripts/rguard.min.js?v=1.5.1"""
url = url.replace("pw_.g28x", "b")
url = url.replace("d2pr.x_27", "h")

if url.startswith("https"):
return url

url, sep, rest = url.partition("?")
containsS0 = "=s0" in url
url = url[:-3 if containsS0 else -6]
url = url[4:22] + url[25:]
url = url[0:-6] + url[-2:]
url = url[15:33] + url[50:]
url = url[0:-11] + url[-2:]
url = binascii.a2b_base64(url).decode()
url = url[0:13] + url[17:]
url = url[0:-2] + ("=s0" if containsS0 else "=s1600")
Expand Down

0 comments on commit 7b445ec

Please sign in to comment.