From b78f3c0c777594fe8f37fb906b830aae1e0543d2 Mon Sep 17 00:00:00 2001 From: Will Oursler Date: Fri, 6 Oct 2017 12:28:31 -0400 Subject: [PATCH] Fix up the FictionPress site handler. Updates the comment to a valid fictionpress story. Changes the matches method so it works like the one for FFN. As it is now, it didn't work for me. After this, works on the provided URL and several variants. --- sites/fanfictionnet.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sites/fanfictionnet.py b/sites/fanfictionnet.py index 0718d04..505d4be 100644 --- a/sites/fanfictionnet.py +++ b/sites/fanfictionnet.py @@ -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) + '/'