Skip to content
Open
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
69e5683
Create blacklistipchecker.py
dimonalik Oct 2, 2023
c66872c
updating DIRECTORY.md
Oct 2, 2023
7cf1665
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 2, 2023
fbf9f42
Update blacklistipchecker.py
dimonalik Oct 2, 2023
83e7036
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 2, 2023
283e633
Update blacklistipchecker.py
dimonalik Oct 2, 2023
616c1db
Update blacklistipchecker.py
dimonalik Oct 2, 2023
d10e271
Update blacklistipchecker.py
dimonalik Oct 2, 2023
d692b71
Update blacklistipchecker.py
dimonalik Oct 2, 2023
e83990e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 2, 2023
1406c1c
Update blacklistipchecker.py
dimonalik Oct 2, 2023
07ab68b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 2, 2023
5eda7e8
Update blacklistipchecker.py
dimonalik Oct 2, 2023
a07d304
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 2, 2023
903f757
Update blacklistipchecker.py
dimonalik Oct 2, 2023
9d41b22
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 2, 2023
4ca234d
Update blacklistipchecker.py
dimonalik Oct 2, 2023
cc00ba4
Update other/blacklistipchecker.py
dimonalik Oct 2, 2023
6f02577
Update other/blacklistipchecker.py
dimonalik Oct 2, 2023
8786aa3
Update blacklistipchecker.py
dimonalik Oct 2, 2023
5e773a6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 2, 2023
e8ebe66
Update blacklistipchecker.py
dimonalik Oct 2, 2023
5adc0d6
Update blacklistipchecker.py
dimonalik Oct 2, 2023
7994564
Update blacklistipchecker.py
dimonalik Oct 2, 2023
78ba035
Update other/blacklistipchecker.py
dimonalik Oct 2, 2023
7dcbb6f
Update blacklistipchecker.py
dimonalik Oct 2, 2023
37f6527
Update blacklistipchecker.py
dimonalik Oct 2, 2023
ae8c084
Update blacklistipchecker.py
dimonalik Oct 2, 2023
b62f221
Update blacklistipchecker.py
dimonalik Oct 2, 2023
746993d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 2, 2023
194332c
Update blacklistipchecker.py
dimonalik Oct 2, 2023
d806503
Update blacklistipchecker.py
dimonalik Oct 3, 2023
fa75434
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 3, 2023
27825a6
Update blacklistipchecker.py
dimonalik Oct 3, 2023
5a0080e
Update blacklistipchecker.py
dimonalik Oct 3, 2023
5031cac
Update blacklistipchecker.py
dimonalik Oct 3, 2023
8bbc553
Update blacklistipchecker.py
dimonalik Oct 3, 2023
ed94849
Update blacklistipchecker.py
dimonalik Oct 4, 2023
829a3b1
Update blacklistipchecker.py
dimonalik Oct 4, 2023
3160cea
Update blacklistipchecker.py
dimonalik Oct 4, 2023
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update blacklistipchecker.py
added logging for exceptions, fixed invalid var name,
  • Loading branch information
dimonalik authored Oct 2, 2023
commit fbf9f42fdbb098b39f1860f3a2bebbd34ab99b5f
15 changes: 9 additions & 6 deletions other/blacklistipchecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
import smtplib
from email.message import EmailMessage
import json
import logging

API_key = ''
subject = ''
from = ''
to = ''
mail_from = ''
mail_to = ''
smtp_user = ''
smtp_passw = ''
smtp_serv = ''
Expand Down Expand Up @@ -49,8 +50,9 @@ def test_ip(ip):
else:
try:
IP(x)
except:
except Exception as ex:
print('Argument isn`t a valid ip('+x+")\n Skipping argument")
logging.exception('Caught an error')
else:
if test_ip(x):
res, detec = test_ip(x)
Expand All @@ -64,8 +66,9 @@ def test_ip(ip):
x = input()
try:
IP(x)
except:
except Exception as ex:
print('Argument isn`t a valid ip('+x+")")
logging.exception('Caught an error')
sys.exit()
else:
if test_ip(x):
Expand All @@ -87,8 +90,8 @@ def test_ip(ip):
msg = EmailMessage()
msg.set_content(res_txt)
msg['Subject'] = subject
msg['From'] = from
msg['To'] = to
msg['From'] = mail_from
msg['To'] = mail_to
try:
smtp_server = smtplib.SMTP(smtp_server, smtp_port)
smtp_server.ehlo()
Expand Down