Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script is unable to complete download #95

Open
Nekokaburi0 opened this issue May 19, 2024 · 2 comments
Open

Script is unable to complete download #95

Nekokaburi0 opened this issue May 19, 2024 · 2 comments
Assignees

Comments

@Nekokaburi0
Copy link

I saw a previous past where someone had the same issue, so they added the following block of code to the chyoa file:

    soup=BeautifulSoup(page.content, 'html.parser')
    try:
        self.authors.append(soup.find('p', class_='meta').find('a').get_text())
    except:
        self.authors.append("Anon")
    self.chapters.append(soup.find('h1').get_text())
    
    epubCurrLink='\n<a href="'+str(depth)+'.xhtml">'+'Previous Chapter'+'</a>\n<br />'

It seemes to have fixed part of the problem as it gets to about 80% complete before throwing this error

1434/1750 81%Traceback (most recent call last):
File "C:\Users---\Desktop\Ebook-Publisher\Ebook-Publisher.py", line 339, in
clas=MakeClass(i)
^^^^^^^^^^^^
File "C:\Users---\Desktop\Ebook-Publisher\Ebook-Publisher.py", line 202, in MakeClass
site=sitesdomain
^^^^^^^^^^^^^^^^^^
File "C:\Users---\Desktop\Ebook-Publisher\Ebook-Publisher.py", line 21, in
'chyoa.com':lambda x:Chyoa.Chyoa(x),
^^^^^^^^^^^^^^
File "C:\Users---\Desktop\Ebook-Publisher\Site\Chyoa.py", line 239, in init
self.AddNextPage(self.pageQueue.pop(0))
File "C:\Users---\Desktop\Ebook-Publisher\Site\Chyoa.py", line 418, in AddNextPage
self.questions.append(soup.find('header', attrs={'class':"question-header"}).get_text())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get_text'

@theslavicbear
Copy link
Owner

Can you provide the URL to the story you are trying to download? Based on the error, I'm guessing it failed on a chapter that doesn't have an end question, which I thought was impossible. Chyoa normally inserts "What's next?" as the end question if it's left blank.

@theslavicbear theslavicbear self-assigned this Jun 9, 2024
@theslavicbear
Copy link
Owner

This should be fixed with latest release, 3.3.2

I wasn't able to test this without a sample link, so please check and let me know @Nekokaburi0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants