1
0
Fork 0
mirror of https://github.com/kemayo/leech synced 2026-02-27 17:11:17 +01:00

Merge pull request #7 from Zomega/patch-1

Fix up the FictionPress site handler.
This commit is contained in:
David Lynch 2017-10-06 11:33:19 -05:00 committed by GitHub
commit 971398701f

View file

@ -82,5 +82,7 @@ class FanFictionNet(Site):
class FictionPress(FanFictionNet):
@staticmethod
def matches(url):
# e.g. https://www.fanfiction.net/s/4109686/3/Taking-Sights
return re.match(r'^https?://www\.fictionpress\.com/s/\d+/?.*', url)
# e.g. https://www.fictionpress.com/s/2961893/1/Mother-of-Learning
match = re.match(r'^(https?://www\.fictionpress\.com/s/\d+)/?.*', url)
if match:
return match.group(1) + '/'