本文整理汇总了Python中virus_total_apis.PublicApi.scan_url方法的典型用法代码示例。如果您正苦于以下问题:Python PublicApi.scan_url方法的具体用法?Python PublicApi.scan_url怎么用?Python PublicApi.scan_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类virus_total_apis.PublicApi
的用法示例。
在下文中一共展示了PublicApi.scan_url方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_scan_url
# 需要导入模块: from virus_total_apis import PublicApi [as 别名]
# 或者: from virus_total_apis.PublicApi import scan_url [as 别名]
def test_scan_url(self):
vt = PublicApi(API_KEY)
try:
print(json.dumps(vt.scan_url('www.wired.com'), sort_keys=False, indent=4))
except Exception as e:
self.fail(e)
示例2: link_to_virustotal
# 需要导入模块: from virus_total_apis import PublicApi [as 别名]
# 或者: from virus_total_apis.PublicApi import scan_url [as 别名]
def link_to_virustotal(link, pkt):
''' IN CASE WE FOUND GET link, WE SCAN IT '''
print 'SCANNING %s'%link
virus_total_instance = PublicApi('2e1d7b6e998ed0a9830269571ecffa110e41dd8bf34b88ad41e40b4351165d18')
REQ = virus_total_instance.scan_url(link)
print 'Waiting for virustotal'
while True:
if 'Scan finished' in str(virus_total_instance.get_url_report(link)):
print 'Scan finished!'
REP = virus_total_instance.get_url_report(link)['results']['positives']
break
else:
print 'Naaa not yet'
if REP == '0' or REP == 0:
print 'SCANNED %s - VERDICT OK [REP=%s]'%(link,REP)
pkt.accept()
else:
print 'SCANNED %s - VERDICT KO [REP=%s]'%(link,REP)
pkt.drop()
'''