Skip to content

Commit

Permalink
fixed issue3
Browse files Browse the repository at this point in the history
  • Loading branch information
gokulapap committed Feb 23, 2022
1 parent 60a4477 commit 32c38c5
Showing 1 changed file with 35 additions and 21 deletions.
56 changes: 35 additions & 21 deletions insert.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,41 @@
doms.append(i[0])

if url in doms:
f = open('results/{}-output.txt'.format(url), 'r')
res1 = f.read()
f.close()

f = open('results/{}-gau.txt'.format(url), 'r')
res2 = f.read()
f.close()

res1 = bytes(res1, 'utf-8')
final1 = base64.standard_b64encode(res1)
final1 = final1.decode('utf-8')

res2 = bytes(res2, 'utf-8')
final2 = base64.standard_b64encode(res2)
final2 = final2.decode('utf-8')


cur.execute(f"update output set result = '{final1}' where domain = '{url}';")
conn.commit()
cur.execute(f"update output set gau = '{final2}' where domain = '{url}';")
conn.commit()
try:
f = open('results/{}-output.txt'.format(url), 'r')
res1 = f.read()
f.close()

f = open('results/{}-gau.txt'.format(url), 'r')
res2 = f.read()
f.close()

res1 = bytes(res1, 'utf-8')
final1 = base64.standard_b64encode(res1)
final1 = final1.decode('utf-8')

res2 = bytes(res2, 'utf-8')
final2 = base64.standard_b64encode(res2)
final2 = final2.decode('utf-8')


cur.execute(f"update output set result = '{final1}' where domain = '{url}';")
conn.commit()
cur.execute(f"update output set gau = '{final2}' where domain = '{url}';")
conn.commit()
except:
f = open('results/{}-output.txt'.format(url), 'r')
res1 = f.read()
f.close()

res1 = bytes(res1, 'utf-8')
final1 = base64.standard_b64encode(res1)
final1 = final1.decode('utf-8')

cur.execute(f"update output set result = '{final1}' where domain = '{url}';")
conn.commit()
cur.execute(f"update output set gau = 'The Gathered URLs not run yet !' where domain = '{url}';")
conn.commit()

else:
try:
Expand Down

0 comments on commit 32c38c5

Please sign in to comment.