-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants.py
34 lines (30 loc) · 1.33 KB
/
constants.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from enum import Enum
class Site(Enum):
ArchiveOfOurOwn = "ArchiveOfOurOwn"
FanFictionDotNet = "FanFictionDotNet"
SpaceBattles = "SpaceBattles"
FictionLive = "FictionLive"
ScribbleHub = "ScribbleHub"
WebNovel = "WebNovel"
# QuestionableQuesting = "QuestionableQuesting"
# SufficientVelocity = "SufficientVelocity"
url_regex = (
r"""
\b((?:https?://)?(?:(?:www\.)?(?:[\da-z\.-]+)\.(?:[a-z]{2,6})
|(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]
|2[0-4][0-9]|[01]?[0-9][0-9]?)|(?:(?:[0-9a-fA-F]{1,4}:){7}
[0-9a-fA-F]{1,4}|(?:[0-9a-fA-F]{1,4}:){1,7}:|(?:[0-9a-fA-F]
{1,4}:){1,6}:[0-9a-fA-F]{1,4}|(?:[0-9a-fA-F]{1,4}:){1,5}(?::
[0-9a-fA-F]{1,4}){1,2}|(?:[0-9a-fA-F]{1,4}:){1,4}(?::[0-9a-fA-F]
{1,4}){1,3}|(?:[0-9a-fA-F]{1,4}:){1,3}(?::[0-9a-fA-F]{1,4}){1,4}
|(?:[0-9a-fA-F]{1,4}:){1,2}(?::[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]
{1,4}:(?:(?::[0-9a-fA-F]{1,4}){1,6})|:(?:(?::[0-9a-fA-F]{1,4}){1,7}|:)
|fe80:(?::[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]+|::(?:ffff(?::0{1,4})
?:)?(?:(?:25[0-5]|(?:2[0-4]|1?[0-9])?[0-9])\.){3}
(?:25[0-5]|(?:2[0-4]|1?}[0-9])?[0-9])|(?:[0-9a-fA-F]{1,4}:)
{1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?[0-9])?[0-9])\.){3}(?:25
[0-5]|(?:2[0-4]|1?[0-9])?[0-9])))(?::[0-9]{1,4}|[1-5][0-9]
{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])?
(?:/[\w\.-]*)*/?)\b
""",
)