24 lines
818 B
Python
24 lines
818 B
Python
import requests
|
|
import json
|
|
|
|
from . import API_URL
|
|
from .auth import AuthAPI
|
|
|
|
class MetaAPI():
|
|
def getByUUID(uuid):
|
|
try:
|
|
ret = requests.get(API_URL + 'api/file/meta/get_by_uuid/' + uuid, headers= AuthAPI.get_key())
|
|
if ret.status_code == 200:
|
|
return ret.json()
|
|
except (requests.exceptions.ConnectionError, json.decoder.JSONDecodeError) as e:
|
|
print('get meta by uuid fail', e)
|
|
return False
|
|
|
|
def getAll():
|
|
try:
|
|
ret = requests.get(API_URL + 'api/file/meta/get/all', headers= AuthAPI.get_key())
|
|
if ret.status_code == 200:
|
|
return ret.json()
|
|
except (requests.exceptions.ConnectionError, json.decoder.JSONDecodeError) as e:
|
|
print('get meta all fail', e)
|
|
return False |