Normalize literotica.com URLs to www.literotica.com

This commit is contained in:
Jim Miller 2020-07-20 11:35:58 -05:00
parent 2fe661fbb7
commit f4a3b6e18d

View file

@ -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)