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

Note to self about royalroad chapter URLs

This commit is contained in:
David Lynch 2025-08-01 19:42:31 -05:00
parent 7a155a7b98
commit 5f72f23e72

View file

@ -34,6 +34,9 @@ class RoyalRoad(Site):
@classmethod @classmethod
def matches(cls, url): def matches(cls, url):
# e.g. https://royalroad.com/fiction/6752/lament-of-the-fallen # e.g. https://royalroad.com/fiction/6752/lament-of-the-fallen
# Note: urls like https://www.royalroad.com/fiction/chapter/2330878 also exist, which it
# might be nice to support, but I need to look into an API call to get the work ID from
# a chapter ID.
match = re.match(r'^(https?://(?:www\.)?%s\.com/fiction/\d+)/?.*' % cls.domain, url) match = re.match(r'^(https?://(?:www\.)?%s\.com/fiction/\d+)/?.*' % cls.domain, url)
if match: if match:
return match.group(1) + '/' return match.group(1) + '/'