Skip to content

Commit

Permalink
[ao3] match URLs with 'com' and 'net' TLDs and 'ao3.org' (#6013)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Sep 17, 2024
1 parent 73f833d commit 8f77766
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gallery_dl/extractor/ao3.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
from .common import Extractor, Message
from .. import text, util

BASE_PATTERN = r"(?:https?://)?(?:www\.)?archiveofourown.org"
BASE_PATTERN = (r"(?:https?://)?(?:www\.)?"
r"a(?:rchiveofourown|o3)\.(?:org|com|net)")


class Ao3Extractor(Extractor):
Expand Down Expand Up @@ -188,7 +189,6 @@ def items(self):
yield Message.Queue, base + series_id, data

def series(self):
path, user, pseud, query = self.groups
return self._pagination(self.groups[0], '<li id="series_')


Expand Down
15 changes: 15 additions & 0 deletions test/results/ao3.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,21 @@
"https://archiveofourown.org/users/Fyrelass/series",
),
},
{
"#url" : "https://archiveofourown.com/users/Fyrelass",
"#category": ("", "ao3", "user"),
"#class" : ao3.Ao3UserExtractor,
},
{
"#url" : "https://archiveofourown.net/users/Fyrelass",
"#category": ("", "ao3", "user"),
"#class" : ao3.Ao3UserExtractor,
},
{
"#url" : "https://ao3.org/users/Fyrelass",
"#category": ("", "ao3", "user"),
"#class" : ao3.Ao3UserExtractor,
},

{
"#url" : "https://archiveofourown.org/users/Fyrelass/profile",
Expand Down

0 comments on commit 8f77766

Please sign in to comment.