27 lines
629 B
Python
27 lines
629 B
Python
import requests
|
|
import json
|
|
import hashlib
|
|
|
|
def serviceTag():
|
|
return 'p.defau.lt'
|
|
|
|
def upload(data):
|
|
json_data = json.dumps(data)
|
|
md5sum = hashlib.md5(json_data.encode('utf-8')).hexdigest()
|
|
|
|
url = 'https://p.defau.lt/submit.php'
|
|
response = requests.post(url, data={'code': json_data})
|
|
|
|
if response.status_code == 200:
|
|
key = response.url
|
|
name = 'defau_' + md5sum[:5]
|
|
return {'name': name, 'service': 'p.defau.lt', 'key': key, 'md5sum': md5sum}
|
|
else:
|
|
return None
|
|
|
|
def get(trace):
|
|
url = trace[key]
|
|
response = requests.request.get(url)
|
|
return response.content
|
|
|