Added blacklist feature (untested)

This commit is contained in:
Simon
2018-06-06 10:17:30 -04:00
parent cfa6a9f02f
commit 0b1d76f478
6 changed files with 77 additions and 20 deletions

View File

@@ -61,9 +61,6 @@ def is_external_link(base_url, url: str):
def is_od(url):
if "?" in url:
print("Url has parameter in url!")
return False
if not url.endswith("/"):
print("Url does not end with trailing /")
@@ -97,3 +94,13 @@ def is_od(url):
except Exception as e:
print(e)
return False
def is_blacklisted(url):
with open("blacklist.txt", "r") as f:
for line in f.readlines():
if url.startswith(line.strip()):
return True
return False