08-20-2013, 07:01 PM | #1621 |
Junior Member
Posts: 9
Karma: 26
Join Date: Nov 2011
Device: Handspring Visor, Android phones, Nook Color, Calibre
|
@FaceDeer, would you mind sharing the regexes needed to do this correcting of the author_sort? I'm trying to learn python, and have done some other programming, but regexes are something that have always given me problems.
|
08-21-2013, 12:00 AM | #1622 | |
Connoisseur
Posts: 89
Karma: 706
Join Date: Nov 2012
Device: Kobo Touch
|
Quote:
The goal of this regex is to match the entire string that's in the "author" field and output it unmodified into the "author_sort" field. The regex to match the source "author" field is: (.*) The dot means "match any character (that's not a line-end)" and the asterix after it modifies it to mean "match any number of this character". So it'll match a string of any length consisting of any characters. The brackets around them tell the regex engine that this group of matched characters is going to be referred to later, so it should keep track of it. The regex to put in the destination "author_sort" field is: \1 The backslash-one tells the regex engine "insert the group of characters that you matched with the first bracketed section of the source regex". Fancier regexes could have multiple bracketed sections, for example if you wanted to reverse the order of two chunks of something you could have bracketed sections match the first chunk and the second chunk and then output to a "\2 \1" regex. I suppose in theory one could come up with a fancy regex to parse the author_sort and reverse-engineer it back into its original form, but since we *have* its original form already sitting in the author column that's not necessary. I'm still in the process of making a backup of my main fanfic archive so I haven't run this "for real" yet, but I did some test runs on a small test archive so I'm 99% sure this is correct. Nevertheless, make a backup of your own before you run this. Always a good idea when dealing with regexes, even ones this simple. They can be arcane. |
|
Advert | |
|
08-21-2013, 12:24 AM | #1623 |
Junior Member
Posts: 9
Karma: 26
Join Date: Nov 2011
Device: Handspring Visor, Android phones, Nook Color, Calibre
|
Thanks very much! I think I understand what this is doing, and you're right, since we've got the source data, no need to try and reverse-engineer the author_sort back.
Arcane is definitely the word for it! |
08-21-2013, 07:31 AM | #1624 |
Member
Posts: 23
Karma: 10
Join Date: Apr 2013
Device: None
|
I am having a problem with downloading some stories with Calibre/FanFictionDownloader from PhoenixSong.Net. I am getting the following error:
calibre, version 0.9.44 ERROR: Unhandled exception: <b>AttributeError</b>:'NoneType' object has no attribute 'replace' calibre 0.9.44 isfrozen: True is64bit: False Windows-7-6.1.7601-SP1 Windows ('32bit', 'WindowsPE') ('Windows', '7', '6.1.7601') Python 2.7.4 Windows: ('7', '6.1.7601', 'SP1', 'Multiprocessor Free') Traceback (most recent call last): File "calibre_plugins.fanfictiondownloader_plugin.dialo gs", line 568, in do_loop File "calibre_plugins.fanfictiondownloader_plugin.dialo gs", line 575, in do_when_finished File "calibre_plugins.fanfictiondownloader_plugin.ffdl_ plugin", line 1063, in start_download_job File "calibre_plugins.fanfictiondownloader_plugin.ffdl_ plugin", line 1900, in escapehtml AttributeError: 'NoneType' object has no attribute 'replace' See below for the storeis giving the problem - http://www.phoenixsong.net/fanfiction/story/5951/ http://www.phoenixsong.net/fanfiction/story/5980/ http://www.phoenixsong.net/fanfiction/story/5979/ http://www.phoenixsong.net/fanfiction/story/5981/ |
08-21-2013, 10:19 AM | #1625 | |
Plugin Developer
Posts: 6,313
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
Quote:
Up until now, I've be changing it for one site as a time as it becomes a problem. This time I've gone through and fixed it for all sites. But that ends up touching the adapters for 75 different sites. So here's a test version for people to use for a bit to make sure I didn't break anything in the process. :-) Last edited by JimmXinu; 08-27-2013 at 10:48 AM. Reason: Remove obsolete beta versions |
|
Advert | |
|
08-23-2013, 10:40 AM | #1626 |
Groupie
Posts: 169
Karma: 8098
Join Date: Jun 2012
Location: Germany
Device: Kindle Voyage, Kindle Oasis
|
I updated to calibre 1.0 and now if I add new stories my custom columns are no longer filled.
I checked again and in my settings in FFDL in custom columns I have definded a few of my columns to set automatically - but that doesn´t happen anymore. Do I need to adjust something? Last edited by ILB; 08-23-2013 at 10:49 AM. |
08-23-2013, 12:11 PM | #1627 |
Plugin Developer
Posts: 6,313
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
@ILB - I'm not seeing this problem.
What kind of column is it that isn't working? Int, float, text? What is the metadata that you're trying to fill it with? |
08-23-2013, 01:16 PM | #1628 |
FanFic Hunter
Posts: 18
Karma: 10
Join Date: Aug 2013
Location: Newport News, VA
Device: Samsung Galaxy Tab S6
|
why is adultfanfiction.net not on your list of sites? Is it because of the electronic signature?
|
08-23-2013, 01:43 PM | #1629 |
Plugin Developer
Posts: 6,313
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
|
08-23-2013, 05:39 PM | #1630 | |
Zealot
Posts: 106
Karma: 3566
Join Date: Aug 2008
Location: London UK
Device: iPhone 5, Kindle K3, Kindle Voyage
|
Quote:
The CP plugin itself works fine, and I can manually force a recount. van |
|
08-23-2013, 06:01 PM | #1631 | |
Plugin Developer
Posts: 6,313
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
Quote:
However, I don't see that problem, either. I configure CP for the column and check 'Page Count' on the Count Pages tab in FFDL config and it works. What OS are people seeing problems with? |
|
08-23-2013, 06:17 PM | #1632 | |
Zealot
Posts: 106
Karma: 3566
Join Date: Aug 2008
Location: London UK
Device: iPhone 5, Kindle K3, Kindle Voyage
|
Quote:
The column set up (from metadata_db_prefs_backup.json) is Spoiler:
|
|
08-23-2013, 07:45 PM | #1633 | ||
Groupie
Posts: 169
Karma: 8098
Join Date: Jun 2012
Location: Germany
Device: Kindle Voyage, Kindle Oasis
|
Quote:
updated (typ: date) word count (numbers) status (text) relationship (text) category (text) Quote:
I agree with snowman, a manually running of count pages works and fills the column word count. Last edited by ILB; 08-23-2013 at 07:51 PM. |
||
08-23-2013, 08:52 PM | #1634 |
Enthusiast
Posts: 35
Karma: 10000
Join Date: Jan 2012
Device: Sony Reader/Kobo Aura One
|
For a few stories I'm attempting to download, I get the error "'NoneType' object has no attribute 'nextSibling'." Other stories are downloading fine. Is that something wrong with the story that is uploaded on the site?
|
08-23-2013, 09:40 PM | #1635 |
Plugin Developer
Posts: 6,313
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
Please post story URLs exhibiting the problem.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[GUI Plugin] Count Pages | kiwidude | Plugins | 1750 | 04-07-2024 01:20 AM |
[GUI Plugin] Open With | kiwidude | Plugins | 403 | 04-01-2024 08:39 AM |
[GUI Plugin] Resize Cover | kiwidude | Plugins | 95 | 03-16-2024 11:55 PM |
[GUI Plugin] Find Duplicates | kiwidude | Plugins | 1096 | 03-16-2024 11:28 PM |
[GUI Plugin] Plugin Updater **Deprecated** | kiwidude | Plugins | 159 | 06-19-2011 12:27 PM |