Integrate onedirectionfanfiction.com, prisonbreakfic.net, and storiesofarda.com,

make onedirectionfanfiction.com allow www.onedirectionfanfiction.com, too.
This commit is contained in:
Jim Miller 2012-06-07 12:36:38 -05:00
parent 7589dd89de
commit 051de8efd0
7 changed files with 39 additions and 13 deletions

View file

@ -1,6 +1,6 @@
# ffd-retief-hrd fanfictiondownloader
application: fanfictiondownloader
version: 4-4-14
version: 4-4-15
runtime: python27
api_version: 1
threadsafe: true

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

View file

@ -412,6 +412,8 @@ cover_exclusion_regexp:/images/.*?ribbon.gif
#username:YourName
#password:yourpassword
[onedirectionfanfiction.com]
[thehexfiles.net]
[thequidditchpitch.org]
@ -538,6 +540,8 @@ cover_exclusion_regexp:/stories/999/images/.*?_trophy.png
[www.potionsandsnitches.net]
[www.prisonbreakfic.net]
[www.siye.co.uk]
[www.squidge.org/peja]
@ -551,6 +555,8 @@ titlepage_entries: series,category,genre,language,characters,status,datePublishe
# Remove numWords -- www.squidge.org/peja word counts are inaccurate
titlepage_entries: series,category,genre,language,status,datePublished,dateUpdated,dateCreated,rating,warnings,numChapters,site,storyUrl, authorUrl, description
[www.storiesofarda.com]
[www.thewriterscoffeeshop.com]
## Some sites require login (or login for some rated stories) The
## program can prompt you, or you can save it in config. In

View file

@ -67,6 +67,9 @@ import adapter_ashwindersycophanthexcom
import adapter_thehexfilesnet
import adapter_dokugacom
import adapter_iketernalnet
import adapter_onedirectionfanfictioncom
import adapter_prisonbreakficnet
import adapter_storiesofardacom
## 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

@ -69,11 +69,15 @@ class OneDirectionFanfictionComAdapter(BaseSiteAdapter):
# The site domain. Does have www here, if it uses it.
return 'onedirectionfanfiction.com'
@classmethod
def getAcceptDomains(cls):
return ['www.onedirectionfanfiction.com','onedirectionfanfiction.com']
def getSiteExampleURLs(self):
return "http://"+self.getSiteDomain()+"/viewstory.php?sid=1234"
def getSiteURLPattern(self):
return re.escape("http://"+self.getSiteDomain()+"/viewstory.php?sid=")+r"\d+$"
return re.escape("http://")+"(www\.)?"+re.escape(self.getSiteDomain()+"/viewstory.php?sid=")+r"\d+$"
## Getting the chapter list and the meta data, plus 'is adult' checking.
def extractChapterUrlsAndMetadata(self):

View file

@ -54,17 +54,9 @@
much easier. </p>
</div>
<!-- put announcements here, h3 is a good title size. -->
<h3>fanfiction.net fixed</h3>
<p>
I hope. I'm parsing it a different way now that I hope will work in all cases. Story text should be fine, but keep an eye on the metadata.
</p>
<h3>New Sites</h3>
<p>
New sites www.dokuga.com, www.ik-eternal.net added. Thanks, Ida.
</p>
<h3>New Option</h3>
<p>
New configuration option under [txt], wrap_width. Use to control or disable word wrap in text mode.
New sites onedirectionfanfiction.com, www.prisonbreakfic.net and www.storiesofarda.com added. Thanks, Ida.
</p>
<p>
Questions? Check out our
@ -74,7 +66,7 @@
If you have any problems with this application, please
report them in
the <a href="http://groups.google.com/group/fanfic-downloader">FanFictionDownLoader Google Group</a>. The
<a href="http://4-4-12.fanfictiondownloader.appspot.com">Previous Version</a> is also available for you to use if necessary.
<a href="http://4-4-14.fanfictiondownloader.appspot.com">Previous Version</a> is also available for you to use if necessary.
</p>
<div id='error'>
{{ error_message }}
@ -377,6 +369,21 @@
Use the URL of the story's chapter list, such as
<br /><a href="http://www.ik-eternal.net/viewstory.php?sid=1234">http://www.ik-eternal.net/viewstory.php?sid=1234</a>
</dd>
<dt>onedirectionfanfiction.com</dt>
<dd>
Use the URL of the story's first chapter, such as
<br /><a href="http://onedirectionfanfiction.com/viewstory.php?sid=1234">http://onedirectionfanfiction.com/viewstory.php?sid=1234</a>
</dd>
<dt>www.prisonbreakfic.net</dt>
<dd>
Use the URL of the story's first chapter, such as
<br /><a href="http://www.prisonbreakfic.net/viewstory.php?sid=1234">http://www.prisonbreakfic.net/viewstory.php?sid=1234</a>
</dd>
<dt>www.storiesofarda.com</dt>
<dd>
Use the URL of the story's chapter list, such as
<br /><a href="http://www.storiesofarda.com/chapterlistview.asp?SID=7000">http://www.storiesofarda.com/chapterlistview.asp?SID=7000</a>
</dd>
</dl>
<p>
A few additional things to know, which will make your life substantially easier:

View file

@ -398,6 +398,8 @@ cover_exclusion_regexp:/images/.*?ribbon.gif
#username:YourName
#password:yourpassword
[onedirectionfanfiction.com]
[thehexfiles.net]
[thequidditchpitch.org]
@ -521,6 +523,8 @@ cover_exclusion_regexp:/stories/999/images/.*?_trophy.png
[www.potionsandsnitches.net]
[www.prisonbreakfic.net]
[www.siye.co.uk]
[www.squidge.org/peja]
@ -534,6 +538,8 @@ titlepage_entries: series,category,genre,language,characters,status,datePublishe
# Remove numWords -- www.squidge.org/peja word counts are inaccurate
titlepage_entries: series,category,genre,language,status,datePublished,dateUpdated,dateCreated,rating,warnings,numChapters,site,storyUrl, authorUrl, description
[www.storiesofarda.com]
[www.thewriterscoffeeshop.com]
## Some sites require login (or login for some rated stories) The
## program can prompt you, or you can save it in config. In