Merge remote-tracking branch 'refs/remotes/JimmXinu/master'

This commit is contained in:
FaceDeer 2017-06-13 21:46:47 -06:00
commit 3acb60251f
5 changed files with 14 additions and 6 deletions

View file

@ -33,7 +33,7 @@ except NameError:
from calibre.customize import InterfaceActionBase
# pulled out from FanFicFareBase for saving in prefs.py
__version__ = (2, 12, 8)
__version__ = (2, 12, 9)
## Apparently the name for this class doesn't matter--it was still
## 'demo' for the first few versions.

View file

@ -279,7 +279,8 @@ class FimFictionNetSiteAdapter(BaseSiteAdapter):
self.story.setMetadata("short_description", stripHTML(descriptionMeta['content']))
#groups
if soup.find('button', {'id':'button-view-all-groups'}):
groupDiv = soup.find('div', {'class':'groups'})
if groupDiv != None and groupDiv.find('div').find('button'):
groupResponse = self._fetchUrl("https://www.fimfiction.net/ajax/stories/%s/groups" % (self.story.getMetadata("storyId")))
groupData = json.loads(groupResponse)
groupList = self.make_soup(groupData["content"])
@ -313,7 +314,14 @@ class FimFictionNetSiteAdapter(BaseSiteAdapter):
span = listItems[1].find('span',{'data-time':re.compile(r'^\d+$')})
## <span data-time="1435421997" title="Saturday 27th of June 2015 @4:19pm">Jun 27th, 2015</span>
## No timezone adjustment is done.
lastLogin = datetime.fromtimestamp(float(span['data-time']))
if span != None:
lastLogin = datetime.fromtimestamp(float(span['data-time']))
## Sometimes, for reasons that are unclear, data-time is not present. Parse the date out of the title instead.
else:
span = listItems[1].find('span', title=True)
loginRegex = re.search('([a-zA-Z ]+)([0-9]+)(th of|nd of|rd of)([a-zA-Z ]+[0-9]+)', span['title'])
loginString = loginRegex.group(2) + loginRegex.group(4)
lastLogin = datetime.strptime(loginString, "%d %B %Y")
self.story.setMetadata("authorLastLogin", lastLogin)
def ordinal_date_string_to_date(self, datestring):

View file

@ -26,7 +26,7 @@ import pprint
import string
import sys
version="2.12.8"
version="2.12.9"
if sys.version_info < (2, 5):
print 'This program requires Python 2.5 or newer.'

View file

@ -21,7 +21,7 @@ setup(
name="FanFicFare",
# Versions should comply with PEP440.
version="2.12.8",
version="2.12.9",
description='A tool for downloading fanfiction to eBook formats',
long_description=long_description,

View file

@ -1,6 +1,6 @@
# ffd-retief-hrd fanficfare
application: fanficfare
version: 2-12-8
version: 2-12-9
runtime: python27
api_version: 1
threadsafe: true