Activate gayauthors.org, support ga authors with space, bump plugin version.

This commit is contained in:
Jim Miller 2012-02-24 16:39:37 -06:00
parent 1274f37668
commit 3f9abb8c07
5 changed files with 19 additions and 10 deletions

View file

@ -1,5 +1,5 @@
# ffd-retief-hrd fanfictiondownloader
application: fanfictiondownloader
application: ffd-retief-hrd
version: 4-3-2
runtime: python27
api_version: 1

View file

@ -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, 4, 5)
version = (1, 4, 6)
minimum_calibre_version = (0, 8, 30)
#: This field defines the GUI plugin class that contains all the code

View file

@ -45,6 +45,7 @@ import adapter_whoficcom
import adapter_siyecouk
import adapter_archiveofourownorg
import adapter_ficbooknet
import adapter_gayauthorsorg
## This bit of complexity allows adapters to be added by just adding
## importing. It eliminates the long if/else clauses we used to need

View file

@ -19,6 +19,7 @@ import datetime
import logging
import re
import urllib2
from urllib import unquote
from .. import BeautifulSoup as bs
from ..htmlcleanup import stripHTML
@ -49,7 +50,13 @@ class GayAuthorsAdapter(BaseSiteAdapter):
# get storyId from url--url validation guarantees query is only sid=1234
self.story.setMetadata('storyId',self.parsedUrl.path.split('/',)[3])
logging.debug("storyId: (%s)"%self.story.getMetadata('storyId'))
self.story.setMetadata('authorId',self.parsedUrl.path.split('/',)[2])
# unqoute, change '_' and ' ' to '-', downcase, and remove non-[a-z0-9-]
authid = unquote(self.parsedUrl.path.split('/',)[2])
authid = authid.lower().replace('_','-').replace(' ','-')
authid = re.sub(r"[^a-z0-9-]","",authid)
self.story.setMetadata('authorId',authid)
logging.debug("authorId: (%s)"%self.story.getMetadata('authorId'))
# normalized story URL.

View file

@ -54,13 +54,9 @@
much easier. </p>
</div>
<!-- put announcements here, h3 is a good title size. -->
<h3>fanfiction.net fixed</h3>
<h3>New Site gayauthors.org</h3>
<p>
fanfiction.net changed their formatting slightly, which broken the downloader for a while. It's fixed now.
</p>
<h3>New Russian Language Site ficbook.net</h3>
<p>
Thanks to Ida Leter's hard work, we now support <a href="http://ficbook.net">ficbook.net</a>, a Russian language fanfiction site.
Thanks to Ida Leter's hard work, we now support <a href="http://www.gayauthors.org">gayauthors.org</a>, a fanfiction site specializing in gay stories.
</p>
<p>
If you have any problems with this application, please
@ -235,13 +231,18 @@
<br /><a href="http://archiveofourown.org/works/76366">http://archiveofourown.org/works/76366</a>.
<br /><a href="http://archiveofourown.org/works/76366/chapters/101584">http://archiveofourown.org/works/76366/chapters/101584</a>.
</dd>
</dl>
<dt>ficbook.net(Russian)</dt>
<dd>
Use the URL of the story, or one of it's chapters, such as
<br /><a href="http://ficbook.net/readfic/93626">http://ficbook.net/readfic/93626</a>.
<br /><a href="http://ficbook.net/readfic/93626/246417#part_content">http://ficbook.net/readfic/93626/246417#part_content</a>.
</dd>
<dt>gayauthors.org</dt>
<dd>
Use the URL of the story, or one of it's chapters, such as
<br /><a href="http://www.gayauthors.org/story/mark-arbour/stvincent">http://www.gayauthors.org/story/mark-arbour/stvincent</a>.
<br /><a href="http://www.gayauthors.org/story/Mark%20Arbour/stvincent/7">http://www.gayauthors.org/story/Mark Arbour/stvincent/7</a>.
</dd>
</dl>
<p>
A few additional things to know, which will make your life substantially easier: