From 7f4749a0227dbc6df03d6005f0fd1dd2f6ef2ad6 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Mon, 10 Jun 2013 19:44:58 -0500 Subject: [PATCH] Fix for nha.magical-worlds.us: reviews link disappeared, fix finding story url for meta section, fix highbyte chars in description. --- fanficdownloader/adapters/adapter_nhamagicalworldsus.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fanficdownloader/adapters/adapter_nhamagicalworldsus.py b/fanficdownloader/adapters/adapter_nhamagicalworldsus.py index 8eea220..62d80d4 100644 --- a/fanficdownloader/adapters/adapter_nhamagicalworldsus.py +++ b/fanficdownloader/adapters/adapter_nhamagicalworldsus.py @@ -112,7 +112,8 @@ class NHAMagicalWorldsUsAdapter(BaseSiteAdapter): for info in asoup.findAll('table', {'width' : '100%', 'bordercolor' : re.compile(r'#')}): a = info.find('a') - if ('viewstory.php?sid='+self.story.getMetadata('storyId')) in a['href']: + if 'viewstory.php?sid='+self.story.getMetadata('storyId') == a['href'] or \ + ('viewstory.php?sid='+self.story.getMetadata('storyId')+'&') in a['href']: self.story.setMetadata('title',a.string) break @@ -142,14 +143,14 @@ class NHAMagicalWorldsUsAdapter(BaseSiteAdapter): for cat in cats: self.story.addToList('category',cat.string) - a = info.find('a', href=re.compile(r'reviews.php\?sid='+self.story.getMetadata('storyId'))) + a = info.find('a', href=re.compile(r'viewuser.php')) val = a.nextSibling svalue = "" while not defaultGetattr(val) == 'br': val = val.nextSibling val = val.nextSibling while not defaultGetattr(val) == 'br': - svalue += str(val) + svalue += unicode(val) val = val.nextSibling self.setDescription(url,svalue)