From f4a3b6e18d0fa0954c208e7f3fc59e926dd1e8df Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Mon, 20 Jul 2020 11:35:58 -0500 Subject: [PATCH] Normalize literotica.com URLs to www.literotica.com --- fanficfare/adapters/adapter_literotica.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fanficfare/adapters/adapter_literotica.py b/fanficfare/adapters/adapter_literotica.py index e0ea5e3a..ce43ebc8 100644 --- a/fanficfare/adapters/adapter_literotica.py +++ b/fanficfare/adapters/adapter_literotica.py @@ -47,10 +47,10 @@ class LiteroticaSiteAdapter(BaseSiteAdapter): storyId = re.sub("-ch-?\d\d", "", storyId) self.story.setMetadata('storyId', storyId) - ## accept m(mobile)url, but use www. - url = re.sub("^(www|german|spanish|french|dutch|italian|romanian|portuguese|other)\.i", - "\1", - url) + ## normalize to www.literotica.com. + url = re.sub(r"^(https?://)(www|german|spanish|french|dutch|italian|romanian|portuguese|other)(\.i)?", + r"\1www", + url) ## strip ?page=... url = re.sub("\?page=.*$", "", url)