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:
parent
7a155a7b98
commit
5f72f23e72
1 changed files with 3 additions and 0 deletions
|
|
@ -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) + '/'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue