Xonshiz / comic-dl

Comic-dl is a command line tool to download manga and comics from various comic and manga sites. Supported sites : readcomiconline.to, mangafox.me, comic naver and many more.
https://github.com/Xonshiz/comic-dl
MIT License
538 stars 68 forks source link

Some RCO Suggestions #327

Open BarneyTheCantankerous opened 1 year ago

BarneyTheCantankerous commented 1 year ago

I'm having some issues with git locally so couldn't raise a PR but I've got a couple of suggestions which might tighten up the support around RCO...

Looks like some comic issues use single quotes, so need to include support for both: https://github.com/Xonshiz/comic-dl/blob/653b8a48f8daf31ab95452dce2c6199c16eaabe3/comic_dl/sites/readcomicOnlineli.py#L85

img_list = re.findall(r"lstImages.push\([\"\'](.*?)[\"\']\);", str(source))

Before I found your project one issue I was running into with my own implementation, it could just be that I've missed something in your code, I think you might need to include support for decoding the page from br. Here's a really rough and dirty example of something I made for the thing I was working on prior:

def decode_page(page):
    encoding = page.headers.get('content-encoding', '').lower()
    if encoding == 'br':
        return brotli.decompress(page.read())
    elif encoding == 'gzip':
        return gzip.decompress(page.read());

All of that said, whatever mechanism they're using to scramble the image URLs it looks like the get_image_links might be out of date now as I wasn't able to unscramble a couple I tested.

Xonshiz commented 1 year ago

Hey Barney, I never came across the single quote list. That's interesting. Could you please share some of those links? I could try to look into it in a few weeks when I get some time. Thanks for looking into it and for the suggestions, appreciate it.

BarneyTheCantankerous commented 1 year ago

Sure, here's a handful of examples:

Xonshiz commented 1 year ago

Amazing, thanks. I'll try to check it out in few weeks.