View Single Post
Old 02-20-2022, 11:07 AM   #6916
estherflails
Member
estherflails began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Jul 2021
Device: none
Hello again!
It's been a little bit, but I wanted to thank you for all your help regarding merengo.hu. I finally had some time to figure out my personal.ini and download most of the fics I wanted.

I'm sorry to bother you about this again, but another issue popped up and I have no idea what might be causing it. Some stories are still getting errors when I try to download them. Here are some examples:

'NoneType' object has no attribute 'find_all' https://merengo.hu/viewstory.php?sid=10050
'NoneType' object has no attribute 'find_all' https://merengo.hu/viewstory.php?sid=80621
'NoneType' object has no attribute 'parent' https://merengo.hu/viewstory.php?sid=140935

'find_all' happens more often, 'parent' is relatively rare.

Comparison stories I could downloaded without problems:
https://merengo.hu/viewstory.php?sid=52296
https://merengo.hu/viewstory.php?sid=80371
https://merengo.hu/viewstory.php?sid=66968


Also, the titlepage of downloaded stories contains an extra section called 'Story Notes', which are usually the author notes for the first chapter.
Here's one where there are no author notes, but there are end notes, and those still end up on the title page instead of at the end of the chapter: https://merengo.hu/viewstory.php?sid=147485
This section also lacks any formatting like line breaks or bold text.
I tried to find a story that had author notes and end notes as well, to see what happens then, but had no luck.

I found the reason for this is this section in base_efiction_adapter:

Code:
	## Retrieving the story notes
        sn = soup.find('div', {'class':'noteinfo'})
        if sn:
            self.story.setMetadata('storynotes', stripHTML(sn))
I saw that other efiction sites have a section like this instead of story and endnotes.
By changing it to this, I managed to make it so only "Story Notes" labelled ones show up, like on this site: http://www.libraryofmoria.com/a/viewstory.php?sid=4023

Code:
        ## Retrieving the story notes
        sn = soup.find('div', {'class':'noteinfo'})
        if sn:
            if soup.find('span', {'class':'label'},text='Story Notes:'):
                self.story.setMetadata('storynotes', stripHTML(sn))
But I couldn't figure out how to add the "Author's Notes" and "End Notes" labelled parts into the correct places.
If this would be too complicated to fix, don't worry about it, it's not a huge deal.

Thank you!
estherflails is offline   Reply With Quote