1
0
Fork 0
mirror of https://github.com/kemayo/leech synced 2025-12-06 08:22:56 +01:00

Xenforo: canonicalize post URLs from threadmarks

This commit is contained in:
David Lynch 2015-12-09 01:57:55 -06:00
parent aa4ba528b7
commit a5fb14d61a

View file

@ -102,6 +102,10 @@ class XenForo(Site):
match = re.match(r'.+#post-(\d+)$', url)
# could still be nothing here
postid = match and match.group(1)
if postid:
# create a proper post-url, because threadmarks can sometimes
# mess up page-wise with anchors
url = 'https://%s/posts/%s/' % (self.domain, postid)
soup = self._soup(url, 'html5lib')
if postid: