![]() |
#2311 | ||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
Quote:
|
||
![]() |
![]() |
#2312 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 408
Karma: 1050547
Join Date: Mar 2011
Device: Kindle Oasis 2
|
This might also be interesting for corner-cases: In case the decoding fails, one could fallback to the chardet module, and try to detect the real encoding. And even if then there are still errors or the encoding couldn't be detected properly, just do a .decode(..., 'ignore'/'replace') possibly instead of crashing? I'm not sure what the module currently does.
Last edited by cryzed; 12-30-2013 at 12:47 AM. |
![]() |
Advert | |
|
![]() |
#2313 | |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Dec 2013
Device: Sony PRS T-1
|
Quote:
I assumed something like that already - was surprised though, because it functioned quite a while for me -, so I'll simply change my personal updating system. Thank you again! |
|
![]() |
![]() |
#2314 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Updated storiesonline.net adapter
I have fixed the problems noted in the last few days plus a couple of other things. These are:
- Site uses UTF-8. As the base adapter uses this first, I have removed the setting from this adapter. - If the story was in a series or universe, the summary was just that text and didn't include the story description. - While looking at the above, I realised that when a story was in a universe, that was being lost. So, when there is a universe, the series is set to the universe. One problem with this is that with a universe, there isn't an order, so the series index is set to zero. The other thing I mentioned the other day was the notice on some story index pages. This can be a disclaimer or some sort or some setup for the story. http://storiesonline.net/s/51245 is the story that started this round of changes, and it has a notice. Extracting the notice was easy. But, then I couldn't quickly work out how to display it in the story. It probably should be added after the story details, but, I don't immediately see how to do that. I have put the extract code in. If someone can tell me where to look, I can add it to the actual story. Also, the finestories.com should have the change for the character set. I had a look at a few pages and they are being generated as UTF-8. I think it should have the universe/series change as well, but I didn't have a close look at that. |
![]() |
![]() |
#2315 | ||||
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,028
Karma: 4604637
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
|
Quote:
Quote:
Quote:
Quote:
Attached is a test version with the changes discussed. UPDATE Jan 4, 2013 - Remove obsolete beta versions Last edited by JimmXinu; 01-04-2014 at 02:58 PM. Reason: Remove obsolete beta versions |
||||
![]() |
Advert | |
|
![]() |
#2316 | |
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,028
Karma: 4604637
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
|
Quote:
Code:
website_encodings: auto, utf8, Windows-1252 I should either update it so it works better or remove it outright, I suppose. |
|
![]() |
![]() |
#2317 | |||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
I can see why, but, I'm not sure I agree. The site has both universes and series (and series can be ordered or be unordered). Universes can hold individual stories or series. But, there is no way to tell from a story in a series that the series is part of a universe. That means a story will only have one. For me, I suppose I want to get whichever the story has into the series column. Can I do this through the preferences or personal.ini? For curiosity, I had a look at what is in one of the site generated epubs. For the BOFH story, http://storiesonline.net/s/64407, the OPF has: Code:
<meta name="calibre:series" content="BOFH"/> Quote:
Code:
Traceback (most recent call last): File "calibre_plugins.fanfictiondownloader_plugin.dialogs", line 590, in do_loop File "calibre_plugins.fanfictiondownloader_plugin.ffdl_plugin", line 1068, in prep_download_loop File "calibre_plugins.fanfictiondownloader_plugin.fanficdownloader.story", line 542, in formatFileName File "calibre_plugins.fanfictiondownloader_plugin.fanficdownloader.story", line 419, in getAllMetadata File "calibre_plugins.fanfictiondownloader_plugin.fanficdownloader.story", line 330, in getMetadata TypeError: sequence item 0: expected string or Unicode, Tag found Quote:
|
|||
![]() |
![]() |
#2318 |
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,028
Karma: 4604637
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
|
storiesonline.net continued
davidfor,
So in summary, a storiesonline.net story can be a member of:
And you'd like 'universe' to be populated into the standard 'series' metadatum when a story is a direct member of a universe, since it can't be a member of a series then. I suppose that's not unreasonable, but I'd also like to be able to populate 'universe' for stories that are members of series that are in turn members of a universe. Have you found example stories of each of these cases? I haven't found any unordered series or series that are a member of a universe. I suspect the existing code will break on an unordered series. Fixed for next version. |
![]() |
![]() |
#2319 | |
Member
![]() Posts: 22
Karma: 10
Join Date: May 2012
Device: Sony PRS-T1
|
Quote:
http://storiesonline.net/library/universe.php?id=4 http://storiesonline.net/library/universe.php?id=659 Here are unordered series (presumably called collections): http://storiesonline.net/library/show_series.php?id=177 http://storiesonline.net/library/show_series.php?id=604 Incidentally, it's possible that authors make a mistake in numbering a series. This series has three books all marked #1 and one book marked #2 in the series: http://storiesonline.net/library/show_series.php?id=113 |
|
![]() |
![]() |
#2320 | |||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
Quote:
Actually that might not be that bad. The authors universe page has "&type=uni" added to the authors URL. Then it is simply a matter of finding an a tag that refers to the story page. I'll have a play later. Quote:
The unordered series is broken. I just tested to from stories from the above. The series name and link is put into the description and the description is lost. I'll have a play with that as well. |
|||
![]() |
![]() |
#2321 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
Code:
try: a = lc4.find('a', href=re.compile(r"/library/show_series.php\?id=\d+")) if a: series_contents = a.parent.contents i = 0 if len(series_contents) == 1 else series_contents[1].strip(' ()') self.setSeries(stripHTML(a), i) self.story.setMetadata('seriesUrl','http://'+self.host+a['href']) desc = lc4.contents[2] except: pass |
|
![]() |
![]() |
#2322 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 250
Karma: 20386
Join Date: Sep 2010
Location: France
Device: Bookeen Diva, Kobo Clara BW
|
Maybe taking advantage of hierarchical series?
series = Series Name [0] (no universe, unordered series) series = Series Name [n] (no universe, ordered series) series = Universe [0] (universe, no series) series = Universe.Series Name [0] (universe, unordered series) series = Universe.Series Name [n] (universe, ordered series) |
![]() |
![]() |
#2323 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
That does make sense. I'm not sure if I am a fan of the "Universe.Series", but I can see that some people would like it. Maybe an option in the personal.ini?
|
![]() |
![]() |
#2324 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 250
Karma: 20386
Join Date: Sep 2010
Location: France
Device: Bookeen Diva, Kobo Clara BW
|
Well, it's the separator character for hierarchical items in the tag browser; I don't believe it's configurable. Obviously if the tag browser is not a consideration (along with all the search- and filter-related features), any string would do.
|
![]() |
![]() |
#2325 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
No, I meant configure what gets put into the series field if the book is in series that is in a universe. I think I would be happy with just the series, but I can understand of someone wanted both.
|
![]() |
![]() |
|
![]() |
||||
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 |