|
|
@@ -12,8 +12,8 @@ from requests.models import Response |
|
|
|
def find_links_in_text(text: str) -> List[str]: |
|
|
|
"""Find links in a text and return a list of URLs.""" |
|
|
|
|
|
|
|
link_pattern = re.compile(r'((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'\".,<>?«»“”‘’]))') |
|
|
|
|
|
|
|
link_pattern = re.compile(r'((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([' |
|
|
|
r'^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'\".,<>?«»“”‘’]))') |
|
|
|
raw_links = re.findall(link_pattern, text) |
|
|
|
|
|
|
|
links = [ |
|
|
|