mirror of
https://github.com/kemayo/leech
synced 2025-12-06 08:22:56 +01:00
Fiction.live: niche URLs
* occasional stories with "Sci-fi" in the URL instead of "stories" * rare cases of `-` in the work id Fixes #31
This commit is contained in:
parent
a856f9d0f8
commit
6631095726
1 changed files with 2 additions and 2 deletions
|
|
@ -15,12 +15,12 @@ class FictionLive(Site):
|
|||
@staticmethod
|
||||
def matches(url):
|
||||
# e.g. https://fiction.live/stories/Descendant-of-a-Demon-Lord/SBBA49fQavNQMWxFT
|
||||
match = re.match(r'^(https?://fiction\.live/stories/[^\/]+/[0-9a-zA-Z]+)/?.*', url)
|
||||
match = re.match(r'^(https?://fiction\.live/(?:stories|Sci-fi)/[^\/]+/[0-9a-zA-Z\-]+)/?.*', url)
|
||||
if match:
|
||||
return match.group(1)
|
||||
|
||||
def extract(self, url):
|
||||
workid = re.match(r'^https?://fiction\.live/stories/[^\/]+/([0-9a-zA-Z]+)/?.*', url).group(1)
|
||||
workid = re.match(r'^https?://fiction\.live/(?:stories|Sci-fi)/[^\/]+/([0-9a-zA-Z\-]+)/?.*', url).group(1)
|
||||
|
||||
response = self.session.get(f'https://fiction.live/api/node/{workid}').json()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue