-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
23 lines (20 loc) · 745 Bytes
/
main.py
File metadata and controls
23 lines (20 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from scanner.pdf_scanner import scan_pdf
from scanner.docx_scanner import scan_docx
from scanner.link_analyzer import check_url_malicious
def scan_file(file_path):
links = []
if file_path.endswith(".pdf"):
links = scan_pdf(file_path)
elif file_path.endswith(".docx"):
links = scan_docx(file_path)
else:
print("Unsupported file type.")
if links:
print("\nLink Analysis Report:")
for link in links:
result = check_url_malicious(link)
print(f"- {link}: {result}")
if __name__ == "__main__":
# Example file path; replace this with the path to your document
file_path = "sample.pdf" # Or "sample.docx"
scan_file(file_path)