Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Closed Thread
 
Thread Tools Search this Thread
Old 01-21-2015, 09:53 PM   #3661
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 7,037
Karma: 4604637
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by JimmXinu View Post
FYI, Twisting the Hellmouth (one of my personal favorite fanfic sites) is in the process of moving servers and domains.
More FYI, looks like TtH is still going to be tthfanfic.org after all. It's mostly back up.
JimmXinu is offline  
Old 01-21-2015, 09:55 PM   #3662
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,484
Karma: 28005164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by JimmXinu View Post
I don't know where calibre gets its initial cert store from, but it could be from the OS.
python's ssl module leaves certificate loading upto the OS. On most linux distributions, that means /etc/ssl/certs

On windows it uses the windows certificate stores.
kovidgoyal is offline  
Advert
Old 01-23-2015, 12:01 AM   #3663
Amalthia
Wizard
Amalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beauty
 
Amalthia's Avatar
 
Posts: 1,188
Karma: 32196
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
Hi, I'm using the code
Code:
replace_br_with_p: false
on this story: http://archiveofourown.org/works/1740875 and it doesn't appear to be working.

Did I need a space before "replace_br_with_p: false" or was I supposed to change "false" to "true?"

Thanks,
Amalthia
Amalthia is offline  
Old 01-23-2015, 01:13 AM   #3664
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 7,037
Karma: 4604637
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by Amalthia View Post
Hi, I'm using the code
Code:
replace_br_with_p: false
on this story: http://archiveofourown.org/works/1740875 and it doesn't appear to be working.

Did I need a space before "replace_br_with_p: false" or was I supposed to change "false" to "true?"
The space doesn't matter. However, if your intention is to turn the feature on, yes, you should set it to true instead of false.

As for 'not working', you'll have to be more specific. That's a feature one of the other developers added. I don't use it, so I'm not terribly familiar with it.
JimmXinu is offline  
Old 01-23-2015, 02:22 AM   #3665
Amalthia
Wizard
Amalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beauty
 
Amalthia's Avatar
 
Posts: 1,188
Karma: 32196
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
Quote:
Originally Posted by JimmXinu View Post
The space doesn't matter. However, if your intention is to turn the feature on, yes, you should set it to true instead of false.

As for 'not working', you'll have to be more specific. That's a feature one of the other developers added. I don't use it, so I'm not terribly familiar with it.
I should have been clearer when I said it wasn't working, what I meant was when I viewed the HTML the <br> tags were still in the story, they were not replaced with <p> tags.

I tried again with "replace_br_with_p: true" and still the same results.

Thanks,
Amalthia
Amalthia is offline  
Advert
Old 01-23-2015, 12:55 PM   #3666
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 7,037
Karma: 4604637
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by Amalthia View Post
I should have been clearer when I said it wasn't working, what I meant was when I viewed the HTML the <br> tags were still in the story, they were not replaced with <p> tags.
I've dropped a note to the developer who added that feature asking them to come take a look.
JimmXinu is offline  
Old 01-23-2015, 12:58 PM   #3667
Feynor
Enthusiast
Feynor began at the beginning.
 
Posts: 38
Karma: 10
Join Date: Sep 2013
Device: Samsung Galaxy Note 10.1 2014 ed. with Moon Reader+ and Google Books.
Quote:
Originally Posted by Amalthia View Post
I should have been clearer when I said it wasn't working, what I meant was when I viewed the HTML the <br> tags were still in the story, they were not replaced with <p> tags.

I tried again with "replace_br_with_p: true" and still the same results.

Thanks,
Amalthia
br to P tries to determine which number of breaks are to be seen as paragraph breaks, and are to be converted. Mostly that means two consecutive breaks are seen as a paragraph break, and all singles are removed, but if it then run into three or more, it really can't do anything but leave them be.

I'll have a look though.
Feynor is offline  
Old 01-23-2015, 01:14 PM   #3668
Feynor
Enthusiast
Feynor began at the beginning.
 
Posts: 38
Karma: 10
Join Date: Sep 2013
Device: Samsung Galaxy Note 10.1 2014 ed. with Moon Reader+ and Google Books.
Addition, it's been a long time since I wrote that code, and IIRC it won't convert breaks inside a paragraph (<p>) tag.

I'll see if I can add a rule to ignore that rule. in cases where there are lot of the breaks.

Additional: (again)
It is as I suspected, the function shields break tags inside existing block tags (table, blockquote, p etc) as they usually mean that the text in question is pre-formatted with line breaks, rather than paragraph breaks. This could be for songs or poetry, or quotes inside a story.
The trick is to come up with a rule that'll allow me to determine if I should overrule this, and when, without breaking the cases the old rule was meant to shield.

I know where it fails, I just need to figure out how to best fix it, as it is really something AO3 is doing. However others might be doing the same thing.
Heuristics are hard!

P.S.: Jimm, I pushed a modified hpfanficarchive adapter, as I found that it left HTML comments in the story body, which would then become a garbled mess later, I don't know if that was something my br_to_p function did, but the result was that for instance Google Books wouldn't parse the output. So I simply remove all HTML comments. They serve no purpose in a story anyway.

Last edited by Feynor; 01-23-2015 at 05:14 PM. Reason: Additional data
Feynor is offline  
Old 01-23-2015, 05:58 PM   #3669
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 7,037
Karma: 4604637
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by Feynor View Post
...
I know where it fails, I just need to figure out how to best fix it, as it is really something AO3 is doing. However others might be doing the same thing.
Heuristics are hard!
Are you ready for a test version of your heuristics code to be posted for others to try?

Quote:
Originally Posted by Feynor View Post
P.S.: Jimm, I pushed a modified hpfanficarchive adapter, as I found that it left HTML comments in the story body, which would then become a garbled mess later, I don't know if that was something my br_to_p function did, but the result was that for instance Google Books wouldn't parse the output. So I simply remove all HTML comments. They serve no purpose in a story anyway.
Please post a story url or two that showed the problem. I've seen some comments issues with other sites and came up with a different solution (using the BS4 parser). And I fear your comment replacement code is too aggressive. Won't it remove all of "<!-- comment --> story <!-- comment -->", not just the comments?
JimmXinu is offline  
Old 01-23-2015, 07:03 PM   #3670
Feynor
Enthusiast
Feynor began at the beginning.
 
Posts: 38
Karma: 10
Join Date: Sep 2013
Device: Samsung Galaxy Note 10.1 2014 ed. with Moon Reader+ and Google Books.
The ? means the expression is lazy, and will match as few times as possible.
"<!-- comment --> story <!-- comment -->" will leave " story "

Any hpfanficarchive story will do, they all have the comments.
Here's the first story in latest:
http://hpfanficarchive.com/stories/v...=834&chapter=1
the body found by the adapter starts with <!-- STORY START --> and ends with <!-- STORY END -->

The heuristics code only really have one change, an if was changed to a while loop, to remove multiple layers of divs. AO3 uses 2.
That really should be changed to using beautiful soup for safety, as it might be a problem for this structure:
<div>
<div>something</div>
<div>Something else</div>
</div>

I didn't realize that till just now, so it might be a good idea to roll back that change for now..
Edit: I just reverted that change, so there is nothing to test in the heuristics for now. I have to figure out how to solve this.

Last edited by Feynor; 01-23-2015 at 07:10 PM.
Feynor is offline  
Old 01-23-2015, 08:36 PM   #3671
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 7,037
Karma: 4604637
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by Feynor View Post
The ? means the expression is lazy, and will match as few times as possible.
"<!-- comment --> story <!-- comment -->" will leave " story "
I knew that. I just didn't see the '?'. My bad.

Quote:
Originally Posted by Feynor View Post
Any hpfanficarchive story will do, they all have the comments.
Here's the first story in latest:
http://hpfanficarchive.com/stories/v...=834&chapter=1
the body found by the adapter starts with <!-- STORY START --> and ends with <!-- STORY END -->
...
So wait, it's not that hpfanficarchive has bad comments, the problem is that Google Books doesn't like any comments?

Because if that's true, we should add an option to remove comments for all sites, not just hpfanficarchive.
JimmXinu is offline  
Old 01-23-2015, 09:42 PM   #3672
Feynor
Enthusiast
Feynor began at the beginning.
 
Posts: 38
Karma: 10
Join Date: Sep 2013
Device: Samsung Galaxy Note 10.1 2014 ed. with Moon Reader+ and Google Books.
Google Books don't mind comments, but somehow the comments from hpfanficarchive becomes messed up, looking like "<!-- <!-- STORY START --> <p>--></p>" if I recall

The nesting of comments is what's illegal, regular browsers just tries to ignore it.

I only noticed it from hpfanficarcive, but it is a good idea to filter out them all, really, but it'll have to be done right after the adapter returns then, before any further processing.

Last edited by Feynor; 01-23-2015 at 09:44 PM.
Feynor is offline  
Old 01-23-2015, 09:58 PM   #3673
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 7,037
Karma: 4604637
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by Feynor View Post
Google Books don't mind comments, but somehow the comments from hpfanficarchive becomes messed up, looking like "<!-- <!-- STORY START --> <p>--></p>" if I recall
...
That problem (comments becoming nested comments) should already be fixed.

We saw it last month when I changed how base_adapter converted soups to unicode so it was the same for BS3 and BS4. I had to make a change to the bundled BeautifulSoup3. See change rev 1537.

Plus, I'm not seeing it the epub I generate from that hpfanficarchive story. Is your code base up to date?

Last edited by JimmXinu; 01-23-2015 at 09:59 PM. Reason: Grammar fix.
JimmXinu is offline  
Old 01-23-2015, 10:27 PM   #3674
Feynor
Enthusiast
Feynor began at the beginning.
 
Posts: 38
Karma: 10
Join Date: Sep 2013
Device: Samsung Galaxy Note 10.1 2014 ed. with Moon Reader+ and Google Books.
Quote:
Originally Posted by JimmXinu View Post
That problem (comments becoming nested comments) should already be fixed.

We saw it last month when I changed how base_adapter converted soups to unicode so it was the same for BS3 and BS4. I had to make a change to the bundled BeautifulSoup3. See change rev 1537.

Plus, I'm not seeing it the epub I generate from that hpfanficarchive story. Is your code base up to date?
It is, I just hadn't loaded a fic from hopfanficarchive for a while, so I hadn't noticed the bug being fixed, just that the comment was removed with my apparently unnecessary addition.
I'm not having a good day it seems :P
Feynor is offline  
Old 01-26-2015, 05:50 PM   #3675
wp709
Junior Member
wp709 began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jan 2015
Device: Android
Is it possible to include more than the story summary in the "comments" metadata section in Calibre? I'd also like to automatically include ratings and word counts if possible. I've tried reading the wiki but it's all a bit confusing for this beginner.
wp709 is offline  
Closed Thread


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Count Pages kiwidude Plugins 1849 08-30-2025 01:22 PM
[GUI Plugin] Resize Cover kiwidude Plugins 100 07-10-2025 08:50 AM
[GUI Plugin] Find Duplicates kiwidude Plugins 1124 04-18-2025 09:19 AM
[GUI Plugin] Open With kiwidude Plugins 404 02-21-2025 05:42 AM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM


All times are GMT -4. The time now is 03:56 PM.


MobileRead.com is a privately owned, operated and funded community.