mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-13 22:42:29 +03:00
deploy: fix virustotal report fetching, use GET and query string
This commit is contained in:
parent
f2b48575e6
commit
058b47e484
1 changed files with 4 additions and 4 deletions
|
@ -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:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue