aboutsummaryrefslogtreecommitdiff
path: root/mgs.py
diff options
context:
space:
mode:
Diffstat (limited to 'mgs.py')
-rw-r--r--mgs.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/mgs.py b/mgs.py
index b750473..96e22a9 100644
--- a/mgs.py
+++ b/mgs.py
@@ -1,4 +1,10 @@
-import requests, textract, re, os, tempfile, random, string
+import requests
+import textract
+import re
+import os
+import tempfile
+import random
+import string
from bs4 import BeautifulSoup
from typing import List, Dict
@@ -13,6 +19,7 @@ regex = r"""(?i)\b((?:https?:(?:/{1,3}|[a-z0-9%])|[a-z0-9.\-]+[.](?:com|net|org|
def strgen(n: int) -> str:
return ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(n)).lower()
+
def get_links(s: str) -> List[str]:
return list(set(re.findall(regex, s)))