1
0
Fork 0
mirror of https://github.com/kemayo/leech synced 2025-12-15 04:44:06 +01:00

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.
This commit is contained in:
Will Oursler 2017-10-06 12:28:31 -04:00 committed by GitHub
parent 2ce43c9da7
commit b78f3c0c77

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) + '/'