Commit edfd3cf5 authored by Hans-Christoph Steiner's avatar Hans-Christoph Steiner

Merge branch 'master' into 'master'

deploy: show HTTP errors when virustotal error fails.

See merge request !635
parents 81f1bcf7 06ef99be
Pipeline #53114261 (#887) passed with stage
in 25 minutes and 7 seconds
......@@ -501,14 +501,14 @@ def upload_to_virustotal(repo_section, vt_apikey):
headers = {
"User-Agent": "F-Droid"
}
params = {
data = {
'apikey': vt_apikey,
'resource': package['hash'],
}
needs_file_upload = False
while True:
r = requests.post('https://www.virustotal.com/vtapi/v2/file/report',
params=params, headers=headers)
data=data, headers=headers)
if r.status_code == 200:
response = r.json()
if response['response_code'] == 0:
......@@ -535,7 +535,10 @@ def upload_to_virustotal(repo_section, vt_apikey):
'file': (filename, open(repofilename, 'rb'))
}
r = requests.post('https://www.virustotal.com/vtapi/v2/file/scan',
params=params, headers=headers, files=files)
data=data, headers=headers, files=files)
logging.debug('If this upload fails, try manually uploading here:\n'
+ 'https://www.virustotal.com/')
r.raise_for_status()
response = r.json()
logging.info(response['verbose_msg'] + " " + response['permalink'])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment