diff options
Diffstat (limited to 'mgs.py')
-rw-r--r-- | mgs.py | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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))) |