Change forums.spacebattles.com to https.

This commit is contained in:
Jim Miller
2015-06-01 09:31:00 -05:00
parent 9b8599ffff
commit fcc5c1424d
@@ -53,7 +53,7 @@ class ForumsSpacebattlesComAdapter(BaseSiteAdapter):
self.story.setMetadata('storyId',m.group('id'))
# normalized story URL.
self._setURL('http://' + self.getSiteDomain() + '/threads/'+self.story.getMetadata('storyId')+'/')
self._setURL('https://' + self.getSiteDomain() + '/threads/'+self.story.getMetadata('storyId')+'/')
else:
raise exceptions.InvalidStoryURL(url,
self.getSiteDomain(),
@@ -73,12 +73,12 @@ class ForumsSpacebattlesComAdapter(BaseSiteAdapter):
@classmethod
def getSiteExampleURLs(cls):
return "http://"+cls.getSiteDomain()+"/threads/some-story-name.123456/"
return "https://"+cls.getSiteDomain()+"/threads/some-story-name.123456/"
def getSiteURLPattern(self):
# http://archiveofourown.org/collections/Smallville_Slash_Archive/works/159770
# Discard leading zeros from story ID numbers--AO3 doesn't use them in it's own chapter URLs.
return r"http://"+re.escape(self.getSiteDomain())+r"/threads/(.+\.)?(?P<id>\d+)/"
return r"https?://"+re.escape(self.getSiteDomain())+r"/threads/(.+\.)?(?P<id>\d+)/"
def use_pagecache(self):
'''
@@ -106,7 +106,7 @@ class ForumsSpacebattlesComAdapter(BaseSiteAdapter):
a = soup.find('h3',{'class':'userText'}).find('a')
self.story.addToList('authorId',a['href'].split('/')[1])
self.story.addToList('authorUrl','http://'+self.getSiteDomain()+'/'+a['href'])
self.story.addToList('authorUrl','https://'+self.getSiteDomain()+'/'+a['href'])
self.story.addToList('author',a.text)
self.story.addToList('genre','ForumFic')
@@ -120,21 +120,21 @@ class ForumsSpacebattlesComAdapter(BaseSiteAdapter):
# try threadmarks first, require at least 2.
threadmarksa = soup.find('a',{'class':'threadmarksTrigger'})
if threadmarksa:
soupmarks = self.make_soup(self._fetchUrl('http://'+self.getSiteDomain()+'/'+threadmarksa['href']))
soupmarks = self.make_soup(self._fetchUrl('https://'+self.getSiteDomain()+'/'+threadmarksa['href']))
markas = soupmarks.find('ol',{'class':'overlayScroll'}).find_all('a')
if len(markas) > 1:
for (url,name) in [ (x['href'],stripHTML(x)) for x in markas ]:
self.chapterUrls.append((name,'http://'+self.getSiteDomain()+'/'+url))
self.chapterUrls.append((name,'https://'+self.getSiteDomain()+'/'+url))
# otherwise, use first post links--include first post since that's
if not self.chapterUrls:
logger.debug("len(firstpost):%s"%len(unicode(firstpost)))
#logger.debug("len(firstpost):%s"%len(unicode(firstpost)))
self.chapterUrls.append(("First Post",self.url))
for (url,name) in [ (x['href'],stripHTML(x)) for x in firstpost.find_all('a') ]:
if not url.startswith('http'):
url = 'http://'+self.getSiteDomain()+'/'+url
url = 'https://'+self.getSiteDomain()+'/'+url
if url.startswith('http://'+self.getSiteDomain()) and ('/posts/' in url or '/threads/' in url):
if (url.startswith('https://'+self.getSiteDomain()) or url.startswith('http://'+self.getSiteDomain())) and ('/posts/' in url or '/threads/' in url):
self.chapterUrls.append((name,url))
self.story.setMetadata('numChapters',len(self.chapterUrls))