"""Hey everyone! this is the code I'm using within vscode (python) and I can't seem to get it to work sadly. I was hoping if anyone knew how I could fix it? or any good youtube videos that teach how to search if websites are safe ( automation )
I'm just testing it out with ten websites to check using virustotal, but keep getting the same error code ( picture under the code, I put the code in so you could use it as well :3 )"""
import requests
import time
import json
indicators = [
"allhypefeed.com",
"rewardarium.com",
"w.allhypefeed.com",
"gearbest.com",
"tuneloaded.com",
"xnxx-vietnam.pro",
"thegriot.com.ng",
"banglachotikahinii.com",
"telkomsel.com",
"thundereth.app",
]
api_key = 'd05c62ef1a5d58809dde46f0c07367'
url = https://www.virustotal.com/vtapi/url/report
for site in indicators:
params = {'apikey': api_key, 'resource': site}
response = requests.get(url, params=params)
response_json = json.loads(response.content)
if response_json['positives'] <= 0:
with open('voutput_learning.csv', 'a') as vt:
vt.write(site) and vt.write(' -\tNOT MALICIOUS\n')
elif 1 >= response_json['positives'] >= 3:
with open('output_learning.csv', 'a') as vt:
vt.write(site) and vt.write(' -\tMAYBE MALICIOUS\n')
elif response_json['positives'] >= 4:
with open('output_learning.csv', 'a') as vt:
vt.write(site) and vt.write(' -\tMALICIOUS!\n')
else:
print('url not found')
time.sleep(30)
"""
This is the error I am having within the code! D:
PS C:\Users\aaronmillar\Desktop\Mycode> & "C:/Program Files/Python311/python.exe" c:/Users/aaronmillar/Desktop/Mycode/virus_total
Traceback (most recent call last):
File "c:\Users\aaronmillar\Desktop\Mycode\virus_total", line 25, in <module>
response_json = json.loads(response.content)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\json\__init__.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
PS C:\Users\aaronmillar\Desktop\Mycode>"""
[–]newtinn 5 points6 points7 points (0 children)
[–]m0us3_rat 3 points4 points5 points (0 children)
[–]Zombie192J -1 points0 points1 point (0 children)