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:
parent
25312736d4
commit
f05bfb51ef
1 changed files with 2 additions and 2 deletions
|
|
@ -16,7 +16,7 @@ class ArchiveOfOurOwn(Site):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def matches(url):
|
def matches(url):
|
||||||
# e.g. http://archiveofourown.org/works/5683105/chapters/13092007
|
# 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:
|
if match:
|
||||||
return match.group(1) + '/'
|
return match.group(1) + '/'
|
||||||
|
|
||||||
|
|
@ -43,7 +43,7 @@ class ArchiveOfOurOwn(Site):
|
||||||
logger.info("Logged in as %s", login_details[0])
|
logger.info("Logged in as %s", login_details[0])
|
||||||
|
|
||||||
def extract(self, url):
|
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)
|
return self._extract_work(workid)
|
||||||
|
|
||||||
def _extract_work(self, workid):
|
def _extract_work(self, workid):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue