Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 11-09-2013, 05:43 PM   #2086
Amalthia
Guru
Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.
 
Amalthia's Avatar
 
Posts: 937
Karma: 1960
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650
Quote:
Originally Posted by JimmXinu View Post
replace_br_with_p shouldn't effect font size unless your CSS lists different size for text in p tags vs other tags.

If you have keep_style_attr set to true, there may also be style attributes from the original site coming through.

Without seeing the source story, your personal.ini and the epub generated, all I can do is speculate.
Here is my personal.ini info:

Quote:
[archiveofourown.org]
username:
password:
is_adult:true
extra_titlepage_entries: collections
replace_br_with_p:true
extra_valid_entries:fandoms,comments,kudos,collect ions
fandoms_label:Fandoms
comments_label:Comments
collections_label:Collections

custom_columns_settings:
comments=>#reviewcount,r
collections=>#fandomchallenges,r

## the site specific metadata using custom_columns_settings (but only
## if 'Allow custom_columns_settings from personal.ini' is checked in
## the plugin GUI config.) There are three parts, the entry name,
## then the label of the calibre custom column, then (optionally) a
## 'mode'. 'r' to Replace any existing values, 'a' to Add to existing
## value (use with tag-like columns), and 'n' for setting on New books
## only. (Default is 'r'.)
## Each metadata=>column mapping must be on a separate line and each
## needs to have one space at the start of each line.

#custom_columns_settings:
# cliches=>#acolumn,r
# themes=>#bcolumn,a
# timeline=>#ccolumn,n



## This section will override anything in the system defaults or other
## sections here.
[overrides]
## output background color--only used by html and epub (and ignored in
## epub by many readers). Included below in output_css--will be
## ignored if not in output_css.
background_color: ffffff
## Allow customization of CSS. Make sure to keep at least one space
## at the start of each line and to escape % to %%. Also need
## background_color to be in the same section, if included in CSS.
## 'adobe-text-layout: optimizeSpeed;' prevents hyphenation on newer Nooks
output_css:
body { background-color: #%(background_color)s;
text-align: justify;
margin: 1%%; }
p {margin-top: 0pt; margin-bottom: 0pt; padding: 0pt; text-indent: 15pt; font-size: 1.29167em; text-align: justify;}
h1, h2, h3, h4, h5, h6 { text-align: center; padding-bottom: 10pt;}

.CI {
text-align:center;
margin-top:0px;
margin-bottom:0px;
padding:0px;
}
.center {text-align: center;}
.cover {text-align: center;}
.full {width: 100%%; }
.quarter {width: 25%%; }
.smcap {font-variant: small-caps;}
.u {text-decoration: underline;}
.bold {font-weight: bold;} .bold {font-weight: bold;}
I've attached the story in question: Here is the url: http://archiveofourown.org/works/1036957

Thank you in advance for any and all help,
Amalthia
Attached Files
File Type: epub Astolat - Entanglements.epub (44.9 KB, 19 views)
Amalthia is offline   Reply With Quote
Old 11-10-2013, 12:05 AM   #2087
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.
 
Posts: 1,547
Karma: 411867
Join Date: Dec 2011
Location: Midwest USA
Device: Nook STR w/Glowlight, Kindle 3g, Droid
Quote:
Originally Posted by Amalthia View Post
Here is my personal.ini info:
Well, the simple fix is turn replace_br_with_p off. That story doesn't need it.

However, I do see that replace_br_with_p is doing some slightly odd things. I'll let Asbjorn know about it and see if he can do anything about it.

Keep in mind that replace_br_with_p is a heuristic process. It follows rules of thumb and assumptions and is never going to be 100% perfect in all cases.
JimmXinu is offline   Reply With Quote
Old 11-10-2013, 02:55 AM   #2088
Amalthia
Guru
Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.
 
Amalthia's Avatar
 
Posts: 937
Karma: 1960
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650
Quote:
Originally Posted by JimmXinu View Post
Well, the simple fix is turn replace_br_with_p off. That story doesn't need it.

However, I do see that replace_br_with_p is doing some slightly odd things. I'll let Asbjorn know about it and see if he can do anything about it.

Keep in mind that replace_br_with_p is a heuristic process. It follows rules of thumb and assumptions and is never going to be 100% perfect in all cases.
I turned it off for now. I figured I'd save it for stories that really do use br tags.

I'll read the link you provided and see what it says. It could be that with this turned on I no longer need to specify the font, or it's being embedded twice which I know can increase the font size.
Amalthia is offline   Reply With Quote
Old 11-10-2013, 07:19 AM   #2089
Feynor
Enthusiast
Feynor began at the beginning.
 
Posts: 26
Karma: 10
Join Date: Sep 2013
Device: Samsung Galaxy Tab 10.1 with Moon Reader+ and Google Books.
Sometimes you get a problem, and you scoff, saying "That's easy".

Then 3 hours, and at least two pots of coffee later you have rewritten half your code, and added another 30%.

I'll be committing a new version of the replace_br_with_p code after a few more tests.
Feynor is offline   Reply With Quote
Old 11-10-2013, 09:47 AM   #2090
Feynor
Enthusiast
Feynor began at the beginning.
 
Posts: 26
Karma: 10
Join Date: Sep 2013
Device: Samsung Galaxy Tab 10.1 with Moon Reader+ and Google Books.
Quote:
Originally Posted by Amalthia View Post
I turned it off for now. I figured I'd save it for stories that really do use br tags.
The next build should fix the problem, though one of the culprits is your font-size being specified in the p element of your css.

It is still larger. Without the font-size specified, the chapter text is the same size as the one in the summary page.

The attached file is made with that new build, but I replaced its css with the one from your copy.

Edit: I've added the version of the file using my own css, just for comparison.
Code:
output_css: 
 body { background-color: #%(background_color)s;
        text-align: justify;
        margin: 1em;
        adobe-hyphenate: none; }
 p { text-indent: 1em; 
        text-align: justify;
        margin-top: 0px;
        margin-bottom: 1.5ex; }
 pre { font-size: x-small; }
 sml { font-size: small; }
 h1, h2, h3, h4, h5, h6 { text-align: center; }
 .CI {
     text-align:center;
     margin-top:0px;
     margin-bottom:0px;
     padding:0px;
     }
 .center   {text-align: center;}
 .cover    {text-align: center;}
 .full     {width: 100%%; }
 .quarter  {width: 25%%; }
 .smcap    {font-variant: small-caps;}
 .u        {text-decoration: underline;}
 .bold     {font-weight: bold;}
Attached Files
File Type: epub Entanglements - astolat.epub (43.9 KB, 14 views)
File Type: epub Entanglements - astolat - my css.epub (43.8 KB, 11 views)

Last edited by Feynor; 11-10-2013 at 12:42 PM.
Feynor is offline   Reply With Quote
Old 11-10-2013, 10:52 AM   #2091
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.
 
Posts: 1,547
Karma: 411867
Join Date: Dec 2011
Location: Midwest USA
Device: Nook STR w/Glowlight, Kindle 3g, Droid
Attached is a test version with Asbjorn / Feynor's latest changes for replace_br_with_p.

And thanks for tackling this whole feature, I really didn't want to.

UPDATE -- replaced with slightly newer version.

UPDATE Nov 16, 2013 -- Remove obsolete beta versions

Last edited by JimmXinu; 11-16-2013 at 10:44 AM. Reason: Remove obsolete beta versions
JimmXinu is offline   Reply With Quote
Old 11-10-2013, 04:01 PM   #2092
Amalthia
Guru
Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.Amalthia once ate a cherry pie in a record 7 seconds.
 
Amalthia's Avatar
 
Posts: 937
Karma: 1960
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650
Quote:
Originally Posted by Feynor View Post
The next build should fix the problem, though one of the culprits is your font-size being specified in the p element of your css.

It is still larger. Without the font-size specified, the chapter text is the same size as the one in the summary page.

The attached file is made with that new build, but I replaced its css with the one from your copy.

Edit: I've added the version of the file using my own css, just for comparison.
Thank you for investigating this in more detail for me. I'm going to try out the newer version and tweak my settings. It appears that I may no longer need to specify the font size.
Amalthia is offline   Reply With Quote
Old 11-10-2013, 04:50 PM   #2093
Judith7274
Junior Member
Judith7274 began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Nov 2013
Device: Kindle
I'm almost afraid to post my question because the posts in the thread are beyond my understanding. Anyway

I have calibre. I installed fanfiction downloader as a plug in. How do I get the story into calibre and onto my kindle. I don't see what to click in Calibre to get the story. It's from fanfiction.net.

Thanks.

Thanks
Judith7274 is offline   Reply With Quote
Old 11-10-2013, 05:01 PM   #2094
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.
 
Posts: 1,547
Karma: 411867
Join Date: Dec 2011
Location: Midwest USA
Device: Nook STR w/Glowlight, Kindle 3g, Droid
Quote:
Originally Posted by Judith7274 View Post
I have calibre. I installed fanfiction downloader as a plug in. How do I get the story into calibre and onto my kindle. I don't see what to click in Calibre to get the story. It's from fanfiction.net.
As per the Introduction to plugins post, make sure that you restarted calibre after installing the plugin, and that you've added it to a menu, toolbar using Preferences->Toolbar. If you don't know what the different toolbar options are, add FanFictionDownLoader to 'the main toolbar'.

Once it's on your toolbar, click it to add a story by URL. For Kindle you can either create mobi files directly from FFDL or download to epub and then convert to mobi or azw3 files for Kindle (the preferred method).
JimmXinu is offline   Reply With Quote
Old 11-10-2013, 05:11 PM   #2095
Judith7274
Junior Member
Judith7274 began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Nov 2013
Device: Kindle
Thanks for the quick reply. I did restart Calibre, but did it again after restarting my whole computer and the plug-in is on the toolbar now. Thanks again.
Judith7274 is offline   Reply With Quote
Old 11-10-2013, 11:36 PM   #2096
Jester11
Junior Member
Jester11 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jul 2013
Device: none
I know that this is not something on your end but just a head's up that stories on Fanfiction.net that I attempt to download come back with this error:

'NoneType' object has no attribute 'find'

Just thought you would like to know.
Jester11 is offline   Reply With Quote
Old 11-11-2013, 12:28 AM   #2097
Ellachanted
Enthusiast
Ellachanted began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Oct 2013
Device: Kindle touch
Error message at FFnet

Hi!
I got the same error message tonight. I got it earlier today, but the latest update took care of it. Then tonight it is back.

Don't ya love FFnet?
Ellachanted is offline   Reply With Quote
Old 11-11-2013, 04:04 AM   #2098
Feynor
Enthusiast
Feynor began at the beginning.
 
Posts: 26
Karma: 10
Join Date: Sep 2013
Device: Samsung Galaxy Tab 10.1 with Moon Reader+ and Google Books.
If I'm right, fixing ff.net will take a little while this time.

At a glance it looks like FF.net changed their entire summary header.

I tried debug on one of the many ff.net stories I've used to test the new heuristics.

Code:
FFDL:DEBUG:calibre_plugins.fanfictiondownloader_plugin.ffdl_plugin(702):FanFictionDownLoader v1.7.52
FFDL:DEBUG:calibre_plugins.fanfictiondownloader_plugin.ffdl_plugin(737):url:http://www.fanfiction.net/s/293768/1/
FFDL:DEBUG:calibre_plugins.fanfictiondownloader_plugin.fanficdownloader.adapters.adapter_fanfictionnet(80):URL: http://www.fanfiction.net/s/293768/1/
FFDL:DEBUG:calibre_plugins.fanfictiondownloader_plugin.fanficdownloader.adapters.adapter_fanfictionnet(113):=Trying newer chapter: http://www.fanfiction.net/s/293768/13/
FFDL:INFO:calibre_plugins.fanfictiondownloader_plugin.fanficdownloader.adapters.adapter_fanfictionnet(153):Fall back category collection
FFDL:ERROR:calibre_plugins.fanfictiondownloader_plugin.dialogs(567):Exception: {u'comment': u"'NoneType' object has no attribute 'find'", u'publisher': u'www.fanfiction.net', u'begin': None, u'good': False, u'end': None, u'author': [u'Jeffrey Vasquez'], u'url': u'http://www.fanfiction.net/s/293768/1/', u'listorder': 0, u'author_sort': u'Vasquez, Jeffrey', u'comments': u'', u'calibre_id': 3715, u'added': False, u'title': u'Progeny'}:'NoneType' object has no attribute 'find'
Traceback (most recent call last):
  File "calibre_plugins.fanfictiondownloader_plugin.dialogs", line 557, in do_loop
  File "calibre_plugins.fanfictiondownloader_plugin.ffdl_plugin", line 791, in prep_download_loop
  File "calibre_plugins.fanfictiondownloader_plugin.fanficdownloader.adapters.base_adapter", line 243, in getStoryMetadataOnly
  File "calibre_plugins.fanfictiondownloader_plugin.fanficdownloader.adapters.adapter_fanfictionnet", line 170, in extractChapterUrlsAndMetadata
AttributeError: 'NoneType' object has no attribute 'find'
Fir Jim, here's the header code fort that one.
Code:
<hr>
<button class='btn pull-right' type=button onClick='$("#follow_area").modal();'>Follow/Favorite</button><b class='xcontrast_txt'>Progeny</b>
<span class='xcontrast_txt'><div style='height:5px'></div>By:</span> <a class='xcontrast_txt' href='/u/72474/Jeffrey-Vasquez'>Jeffrey Vasquez</a> <img align=absmiddle src='http://fast.fictionpressllc.netdna-cdn.com/static/ficons/email.png' width=16 height=16 border=0> <a class='xcontrast_txt' title="Send Private Message" href='https://www.fanfiction.net/pm2/post.php?uid=72474'>PM</a>
<div style='margin-top:2px' class='xcontrast_txt'>Memory lost. Memory Forgotten. Shadows dance under the light of the moon. Ranma Saotome thought that he was invincible. Nothing in the world could best him until someone close to his heart was taken from him.</div>
<span class='xgray xcontrast_txt'>Rated: <a class='xcontrast_txt' href='http://www.fictionratings.com/' target='rating'>Fiction T</a> - English - Drama/Romance - Ami M./Amy/Sailor Mercury, Ranma - Chapters: 12 - Words: 209,576 - Reviews: <a href='/r/293768/'>243</a> - Favs: 353 - Follows: 313 - Updated: 03-24-10 - Published: 05-24-01 - id: 293768 </span>
<div class='lc-wrapper' style='margin-top:10px'><div class='lc'>
<span class='xcontrast_txt' style='font-size:15px;cursor:pointer;' title="Increase Font Size" onClick="_fontastic_change_size('u');" >A+</span>  <span class='xcontrast_txt' style='font-size:13px;cursor:pointer;' title="Decrease Font Size" onClick="_fontastic_change_size('d');" >A-</span>  <img onclick="_fontastic_init('reading');$('#_fontastic_reading').modal('show');" style='margin-left:2px;margin-right:2px;' align=absmiddle src='http://fast.fictionpressllc.netdna-cdn.com/static/fcons/edit-style.png' width=16 height=16 border=0 title="Fonts">
<img onclick="$('#f_width').slideToggle();" style='margin-left:2px;margin-right:2px;' align=absmiddle src='http://fast.fictionpressllc.netdna-cdn.com/static/fcons/edit-alignment-justify.png' width=16 height=16 border=0 title="Story Width"> <span id=f_width class=zhide> <a href='#' onclick='_fontastic_change_width(100);'>Full</a> <a href='#' onclick='_fontastic_change_width(75);'>3/4</a> <a href='#' onclick='_fontastic_change_width(50);'>1/2</a></span> <img onclick="$('#f_size').slideToggle();" style='margin-left:2px;margin-right:2px;' align=absmiddle src='http://fast.fictionpressllc.netdna-cdn.com/static/fcons/edit-line-spacing.png' width=16 height=16 border=0 title="Story Spacing"> <span id=f_size class=zhide> <a href='#' onclick='_fontastic_change_line_height("u");'>Expand</a> <a href='#' onclick='_fontastic_change_line_height("d");'>Tighten</a></span> <img onclick="toggleTheme();" style='margin-left:2px;margin-right:2px;' align=absmiddle src='http://fast.fictionpressllc.netdna-cdn.com/static/fcons/contrast.png' width=16 height=16 border=0 title="Story Contrast"></div></div>
<span style='float:right; ' > <SELECT id=chap_select title="Chapter Navigation" Name=chapter onChange="self.location = '/s/293768/'+ this.options[this.selectedIndex].value + '/Progeny';"><option value=1 selected>1. Progeny Chapter 1<option value=2 >2. Progeny Chapter 2<option value=3 >3. Progeny Chapter 3<option value=4 >4. Progeny Chapter 3: Part II<option value=5 >5. Progeny Chapter 4<option value=6 >6. Progeny Chapter 5<option value=7 >7. Chapter 6<option value=8 >8. Chapter 7<option value=9 >9. Chapter 8<option value=10 >10. Chapter 9<option value=11 >11. Chapter 10<option value=12 >12. Chapter 11</select> <button class=btn TYPE=BUTTON onClick="self.location='/s/293768/2/Progeny'">Next &gt;</button></span><div style='height:5px'></div><script>
Feynor is offline   Reply With Quote
Old 11-11-2013, 04:23 AM   #2099
Feynor
Enthusiast
Feynor began at the beginning.
 
Posts: 26
Karma: 10
Join Date: Sep 2013
Device: Samsung Galaxy Tab 10.1 with Moon Reader+ and Google Books.
Quote:
Originally Posted by Ellachanted View Post
Hi!
I got the same error message tonight. I got it earlier today, but the latest update took care of it. Then tonight it is back.

Don't ya love FFnet?
Actually, if you used "replace_br_with_p" that was my error earlier.
Feynor is offline   Reply With Quote
Old 11-11-2013, 06:26 AM   #2100
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.
 
Posts: 1,547
Karma: 411867
Join Date: Dec 2011
Location: Midwest USA
Device: Nook STR w/Glowlight, Kindle 3g, Droid
New test version with fix for latest ff.net change.

I haven't tested comprehensively, but it appears to work. I have to go now, but let me know if any of the metadata isn't coming through correctly.

UPDATE Nov 16, 2013 -- Remove obsolete beta versions

Last edited by JimmXinu; 11-16-2013 at 10:44 AM. Reason: Remove obsolete beta versions
JimmXinu is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Find Duplicates kiwidude Plugins 470 Today 05:43 AM
[GUI Plugin] Open With kiwidude Plugins 223 07-09-2014 02:42 AM
[GUI Plugin] Count Pages kiwidude Plugins 635 07-08-2014 11:40 PM
[GUI Plugin] Resize Cover kiwidude Plugins 32 01-23-2014 02:45 PM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM


All times are GMT -4. The time now is 06:19 AM.


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