Witness-senpai / fakku-downloader

Script that allows download manga directly from fakku.net.
MIT License
53 stars 12 forks source link

Page Number Allocation #27

Open armouredking opened 3 years ago

armouredking commented 3 years ago

Looks like Fakku's changing things again. Not sure where this is broken; it has to be recent because everything was working fine as of Monday.

1) The js element for login has changed yet again. That fix is easy. 2) I am now getting traceback errors for unsupported operands, which appear to be related to the page number function.

TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

AstromTarum commented 3 years ago

Looks like fakku updated their website, im getting the same error

Benjki commented 3 years ago

Here is a REALLY quick fix if anyone really needs it until someone better than me in python (and BeautifulSoup) does a more proper fix. Collections are probably broken too but whatever... Just replace the body of __get_page_count in downloader.py

def __get_page_count(self, page_source):
    soup = bs(page_source, 'html.parser')
    page_count = None
    values = soup.find_all('div', class_="table-cell w-full align-top text-left space-y-2 link:text-blue-700 dark:link:text-white")

    currentstring = None
    try:
        for i in range(len(values)-1, -1, -1):
            currentstring = values[i].string.split(' ')
            if currentstring[1]=="pages":
                break
    except Exception as ex:
        return 1

    return int(currentstring[0])

Don't forget to change l.190 to js-submit too.

(Edit: 2021-11-05: Small modif if you even download a book with 1 page.)

armouredking commented 3 years ago

Looks like this may be related to this announcement.