mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-13 22:42:29 +03:00
Merge branch 'master' into 'master'
deploy: show HTTP errors when virustotal error fails. See merge request fdroid/fdroidserver!635
This commit is contained in:
commit
edfd3cf530
1 changed files with 6 additions and 3 deletions
|
@ -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'])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue