Skip to content

Commit

Permalink
Update PDFcheck.py
Browse files Browse the repository at this point in the history
  • Loading branch information
alpkeskin authored Jul 4, 2021
1 parent 4d0afea commit fb98eb8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modules/PDFcheck.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from googlesearch import search
from datetime import datetime
import requests,re,PyPDF2,tabula,os

def PDFcheck(mail,_verbose=None):
domain = mail.split("@")[1]
term = "site:"+domain+" filetype:PDF intext:"+'"'+"email"+'"'
emails = ""
try:
data = search(term, num_results=5)
for i in data:
Expand All @@ -20,6 +22,10 @@ def PDFcheck(mail,_verbose=None):
if(findPDFs[0] is not None):
for pdfs in findPDFs:
print(pdfs)
emails = emails + "\n" + pdfs
with open((datetime.today().strftime('%Y-%m-%d-'+domain)+".txt"), "w") as f:
f.write(emails)
f.close()
except:
pass
pdfFileObj.close()
Expand All @@ -29,4 +35,4 @@ def PDFcheck(mail,_verbose=None):
if os.path.exists("out.txt"):
os.remove("out.txt")
except:
print("PDF Search error!")
print("PDF Search error!")

0 comments on commit fb98eb8

Please sign in to comment.