Fix for gravitytales.com story (#219)

https://www.mobileread.com/forums/showpost.php?p=3568239&postcount=2395
This commit is contained in:
Chris Braun 2017-08-15 22:10:31 +02:00 committed by Jim Miller
parent 22005b454e
commit a5ec069da4

View file

@ -176,11 +176,12 @@ class GravityTalesComSiteAdapter(BaseSiteAdapter):
if feedparser:
# Parse published and updated date from latest RSS feed entry. The RSS feed urls seems to appear due to
# some JavaScript on the page, so get the URL by mangling the URL (this is not very robust, but probably good
# enough)
# some JavaScript on the page, so get the URL by mangling the URL (this is not very robust, but probably
# good enough)
rss_feed_url = url.replace('/novel/', '/feed/')
feed = feedparser.parse(rss_feed_url)
date_updated = datetime.fromtimestamp(time.mktime(feed.entries[0].published_parsed))
date_updated = datetime.fromtimestamp(
time.mktime(feed.entries[0].published_parsed)) if feed.entries else datetime.now()
else:
# Fall back to the previous method of generating the published and update date...
date_updated = datetime.now()