1
0
Fork 0
mirror of https://github.com/kemayo/leech synced 2025-12-06 08:22:56 +01:00

AO3: work if www is present in the URL

This commit is contained in:
David Lynch 2021-08-10 17:15:18 -05:00
parent 25312736d4
commit f05bfb51ef

View file

@ -16,7 +16,7 @@ class ArchiveOfOurOwn(Site):
@staticmethod
def matches(url):
# e.g. http://archiveofourown.org/works/5683105/chapters/13092007
match = re.match(r'^(https?://archiveofourown\.org/works/\d+)/?.*', url)
match = re.match(r'^(https?://(?:www\.)?archiveofourown\.org/works/\d+)/?.*', url)
if match:
return match.group(1) + '/'
@ -43,7 +43,7 @@ class ArchiveOfOurOwn(Site):
logger.info("Logged in as %s", login_details[0])
def extract(self, url):
workid = re.match(r'^https?://archiveofourown\.org/works/(\d+)/?.*', url).group(1)
workid = re.match(r'^https?://(?:www\.)?archiveofourown\.org/works/(\d+)/?.*', url).group(1)
return self._extract_work(workid)
def _extract_work(self, workid):