mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2026-01-06 08:05:28 +01:00
Allow old goto/post chapter URLs in base_xenforoforum.
This commit is contained in:
parent
2d83fa8f5d
commit
5fdcbab46a
1 changed files with 4 additions and 1 deletions
|
|
@ -229,7 +229,7 @@ class BaseXenForoForumAdapter(BaseSiteAdapter):
|
|||
if ( url.startswith(self.getURLPrefix()) or
|
||||
url.startswith('http://'+self.getSiteDomain()) or
|
||||
url.startswith('https://'+self.getSiteDomain()) ) and \
|
||||
( '/posts/' in url or '/threads/' in url or 'showpost.php' in url):
|
||||
( '/posts/' in url or '/threads/' in url or 'showpost.php' in url or 'goto/post' in url):
|
||||
|
||||
# brute force way to deal with SB's http->https change when hardcoded http urls.
|
||||
url = url.replace('http://'+self.getSiteDomain(),self.getURLPrefix())
|
||||
|
|
@ -237,6 +237,9 @@ class BaseXenForoForumAdapter(BaseSiteAdapter):
|
|||
# http://forums.spacebattles.com/showpost.php?p=4755532&postcount=9
|
||||
url = re.sub(r'showpost\.php\?p=([0-9]+)(&postcount=[0-9]+)?',r'/posts/\1/',url)
|
||||
|
||||
# http://forums.spacebattles.com/goto/post?id=15222406#post-15222406
|
||||
url = re.sub(r'/goto/post\?id=([0-9]+)(#post-[0-9]+)?',r'/posts/\1/',url)
|
||||
|
||||
url = re.sub(r'(^[\'"]+|[\'"]+$)','',url) # strip leading or trailing '" from incorrect quoting.
|
||||
url = re.sub(r'like$','',url) # strip 'like' if incorrect 'like' link instead of proper post URL.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue