Skip to content

Commit

Permalink
more permissive regex to handle story urls with genre in url, 20 char…
Browse files Browse the repository at this point in the history
… IDs & example urls -- fixes #541
  • Loading branch information
Hazel Shanks authored and JimmXinu committed Sep 8, 2020
1 parent 7585eaf commit d55337e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fanficfare/adapters/adapter_fictionlive.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,13 @@ def getAcceptDomains(cls):

def getSiteURLPattern(self):
# I'd like to thank regex101.com for helping me screw this up less
return r"https?://fiction\.live/(stories|anonkun)/[^/]*/([a-zA-Z0-9]{17}|[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})/?(home)?"
return r"https?://fiction\.live/[^/]*/[^/]*/([a-zA-Z0-9\-]+)(/(home)?)?$"

@classmethod
def getSiteExampleURLs(cls):
return ["https://fiction.live/stories/Example-Story-Title/17CharacterIDhere/home",
"https://fiction.live/stories/Example-Story-With-Long-ID/-20CharacterIDisHere",
"https://fiction.live/Sci-fi/Example-Story-With-URL-Genre/17CharacterIDhere/",
"https://fiction.live/stories/Example-Story-With-UUID/00000000-0000-4000-0000-000000000000/"]

def parse_timestamp(self, timestamp):
Expand Down

0 comments on commit d55337e

Please sign in to comment.