Witness-senpai / fakku-downloader

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

dies on get_page_count #52

Open TeaInLungs opened 1 week ago

TeaInLungs commented 1 week ago

Ever since last week I cant download from any url. I always get

PS C:\Users\xxx\Documents\jewcob> python.exe .\main.py -w 15 -t 15
Using cookies file: cookies.pickle

DevTools listening on ws://127.0.0.1:60692/devtools/browser/a1707bc8-2408-40d8-b900-97da885001c9
Created TensorFlow Lite XNNPACK delegate for CPU.
<class 'str'>
Traceback (most recent call last):
  File "C:\Users\xxx\Documents\jewcob\main.py", line 144, in <module>
    main()
  File "C:\Users\xxx\Documents\jewcob\main.py", line 140, in main
    loader.load_all()
  File "C:\Users\xxx\Documents\jewcob\downloader.py", line 225, in load_all
    page_count = self.__get_page_count(self.browser.page_source)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\xxx\Documents\jewcob\downloader.py", line 308, in __get_page_count
    raise ValueError("Page count are not found.")
ValueError: Page count are not found.

Deleting cookies and re-login doesnt help. Also tried to reinstall (download new source, rerun install.bat)

Python 3.12.4

Chromedriver updated to ChromeDriver 129.0.6668.100 same as local chrome.

It used to fail on SOME urls ever so often, such as https://www.fakku.net/hentai/futuregraph-191-english, Actually it used to fail quite regularly when grabbing single page color covers - Then it would for some reason assume the number of Favorites is the page count. Ok, thats bugged, I avoided those pages.

But recently, it fails to download just anything.

TeaInLungs commented 1 week ago

So I looked into it and here's the parser discrepency

fakku has html

<div class="table-cell w-full align-top text-left space-y-2 text-default-link">34 pages</div>

while the parser, if I understand it correctly, expects exactly

div class="table-cell w-full align-top text-left space-y-2 link:text-blue-700 dark:link:text-white">34 pages</div>

Imo this is too strict check. In my experience, those classes can change on whim, or may even be different per case.

I created a PR #53. Hope this helps someone