1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-14 19:10:11 +01:00

deploy: fix virustotal report fetching, use GET and query string

This commit is contained in:
Hans-Christoph Steiner 2019-12-19 10:34:48 +01:00
parent f2b48575e6
commit 058b47e484
No known key found for this signature in database
GPG Key ID: 3E177817BA1B9BFA

View File

@ -476,7 +476,7 @@ def upload_to_android_observatory(repo_section):
logging.info(message) logging.info(message)
def upload_to_virustotal(repo_section, vt_apikey): def upload_to_virustotal(repo_section, virustotal_apikey):
import json import json
import requests import requests
@ -509,13 +509,13 @@ def upload_to_virustotal(repo_section, vt_apikey):
"User-Agent": "F-Droid" "User-Agent": "F-Droid"
} }
data = { data = {
'apikey': vt_apikey, 'apikey': virustotal_apikey,
'resource': package['hash'], 'resource': package['hash'],
} }
needs_file_upload = False needs_file_upload = False
while True: while True:
r = requests.post('https://www.virustotal.com/vtapi/v2/file/report', r = requests.get('https://www.virustotal.com/vtapi/v2/file/report?'
data=data, headers=headers) + urllib.parse.urlencode(data), headers=headers)
if r.status_code == 200: if r.status_code == 200:
response = r.json() response = r.json()
if response['response_code'] == 0: if response['response_code'] == 0: