diff --git a/calibre-plugin/__init__.py b/calibre-plugin/__init__.py
index bdc4f3b..bf63bba 100644
--- a/calibre-plugin/__init__.py
+++ b/calibre-plugin/__init__.py
@@ -27,7 +27,7 @@ class FanFictionDownLoaderBase(InterfaceActionBase):
description = 'UI plugin to download FanFiction stories from various sites.'
supported_platforms = ['windows', 'osx', 'linux']
author = 'Jim Miller'
- version = (1, 5, 24)
+ version = (1, 5, 25)
minimum_calibre_version = (0, 8, 30)
#: This field defines the GUI plugin class that contains all the code
diff --git a/fanficdownloader/adapters/adapter_fanfictionnet.py b/fanficdownloader/adapters/adapter_fanfictionnet.py
index ee0d59c..80126d7 100644
--- a/fanficdownloader/adapters/adapter_fanfictionnet.py
+++ b/fanficdownloader/adapters/adapter_fanfictionnet.py
@@ -205,21 +205,29 @@ class FanFictionNetSiteAdapter(BaseSiteAdapter):
if metatext == None: # indicates there's no Reviews, look for id: instead.
metatext = a.findNext(text=re.compile(r' - id:'))
+ m = re.match(r" - (?P[^ ]+)",metatext)
+ if m.group('lang') != None:
+ self.story.setMetadata('language',m.group('lang'))
+
# after Rating, the same bit of text containing id:123456 contains
# Complete--if completed.
- if 'Complete' in a.findNext(text=re.compile(r'id:'+self.story.getMetadata('storyId'))):
+ if 'Complete' in soup.find(text=re.compile(r'id:'+self.story.getMetadata('storyId'))):
self.story.setMetadata('status', 'Completed')
else:
self.story.setMetadata('status', 'In-Progress')
+
# Parse genre(s) from
#
# (fp)
#
#
- m = re.match(r"^(?:Chapter \d+ of a|A) (?:.*?) (?:- (?P.*?) )?(?:crossover )?(?:fan)?fiction(?P[ ]+with characters)?",
+ #
+ # Chapter 1 of a SpongeBob SquarePants - Romance/Humor fanfiction with characters SpongeBob. Bob Esponja tiene un admirador secreto ¿quien será?. update existing id:1684
+ m = re.match(r"^(?:Chapter \d+ of a|A) (?:.*?) ?(?:- (?P.*?) )?(?:crossover )?(?:fan)?fiction(?P[ ]+with characters)?",
soup.find('meta',{'name':'description'})['content'])
+ #print("meta desc:%s"%soup.find('meta',{'name':'description'})['content'])
if m != None:
genres=m.group('genres')
if genres != None:
@@ -238,15 +246,13 @@ class FanFictionNetSiteAdapter(BaseSiteAdapter):
# - English - Shinji H. - Updated: 01-13-12 - Published: 12-20-11 - id:7654123
# - English - Adventure/Angst - Ichigo K. & Neliel T. O./Nel - Reviews:
# - English - Humor/Adventure - Harry P. & Ironhide - Reviews:
- mc = re.match(r" - (?P[^ ]+ - )(?P[^ ]+ - )? (?P.+?) - (Reviews|Updated|Published)",
+ # - Spanish - Romance/Humor - SpongeBob - Reviews:
+ #print("metatext:%s"%metatext)
+ mc = re.match(r" - (?P[^ ]+ - )(?P[^ ]+ - )? ?(?P.+?) - (Reviews|Updated|Published)",
metatext)
chars = mc.group("chars")
- for c in chars.split(' & '):
- self.story.addToList('characters',c)
- m = re.match(r" - (?P[^ ]+)",metatext)
- if m.group('lang') != None:
- self.story.setMetadata('language',m.group('lang'))
-
+ for c in chars.split('&'):
+ self.story.addToList('characters',c.strip())
return
def getChapterText(self, url):
diff --git a/index.html b/index.html
index 41e9a9e..46b2fac 100644
--- a/index.html
+++ b/index.html
@@ -54,9 +54,9 @@
much easier.
- New Site
+ Fix for fanfiction.net Genre, Characters and Status
- Now supporting thehexfiles.net, that brings us up to an even 40 supported sites. Thanks again, Ida.
+ fanfiction.net changed their format yesterday or today(May 26/27) enough to break capture of Genre, Characters and Status. This version fixes it.
Questions? Check out our