mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2026-04-25 00:11:21 +02:00
Additional URL normalization in base_xenforoforum_adapter.
This commit is contained in:
parent
dc7c0c96dd
commit
4d52dc20b0
1 changed files with 4 additions and 1 deletions
|
|
@ -125,7 +125,6 @@ class BaseXenForoForumAdapter(BaseSiteAdapter):
|
|||
## page. This changes page#post URLs to perma-link URLs.
|
||||
## Which will be redirected back to page#posts, but the
|
||||
## *correct* ones.
|
||||
# http://forums.sufficientvelocity.com/threads/harry-potter-and-the-not-fatal-at-all-cultural-exchange-program.330/page-4#post-39915
|
||||
# https://forums.sufficientvelocity.com/posts/39915/
|
||||
if '#post-' in url:
|
||||
url = self.getURLPrefix()+'/posts/'+url.split('#post-')[1]+'/'
|
||||
|
|
@ -137,6 +136,10 @@ class BaseXenForoForumAdapter(BaseSiteAdapter):
|
|||
if 'reply?quote=' in url:
|
||||
url = self.getURLPrefix()+'/posts/'+url.split('reply?quote=')[1]+'/'
|
||||
|
||||
## normalize named thread urls, too.
|
||||
# http://forums.sufficientvelocity.com/threads/harry-potter-and-the-not-fatal-at-all-cultural-exchange-program.330/
|
||||
url = re.sub(r'/threads/.*\.([0-9]+)/',r'/threads/\1/',url)
|
||||
|
||||
is_chapter_url = True
|
||||
return (is_chapter_url,url)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue