Mise à jour de 'src/endpoints/mazash.py'
change import and use ipfshttpclient
This commit is contained in:
parent
5eb04f6c97
commit
bf174e7b3b
|
@ -2,7 +2,7 @@ from flask import Blueprint, jsonify, request
|
||||||
from dejavu import Dejavu
|
from dejavu import Dejavu
|
||||||
from dejavu.logic.recognizer.file_recognizer import FileRecognizer
|
from dejavu.logic.recognizer.file_recognizer import FileRecognizer
|
||||||
import os
|
import os
|
||||||
import ipfsapi
|
import ipfshttpclient
|
||||||
import tempfile
|
import tempfile
|
||||||
mazash = Blueprint(name="mazash", import_name=__name__)
|
mazash = Blueprint(name="mazash", import_name=__name__)
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ def fingerprint():
|
||||||
tags:
|
tags:
|
||||||
- mazash
|
- mazash
|
||||||
"""
|
"""
|
||||||
ipfs_api = ipfsapi.connect(os.getenv("IPFS_HOST"), int(os.getenv("IPFS_PORT")))
|
ipfs_api = ipfshttpclient.connect(os.getenv("IPFS_HOST"), int(os.getenv("IPFS_PORT")))
|
||||||
djv = Dejavu(config)
|
djv = Dejavu(config)
|
||||||
if request.is_json :
|
if request.is_json :
|
||||||
ipfs_hash = request.json.get("cid")
|
ipfs_hash = request.json.get("cid")
|
||||||
|
@ -91,7 +91,7 @@ def recognize():
|
||||||
tags:
|
tags:
|
||||||
- mazash
|
- mazash
|
||||||
"""
|
"""
|
||||||
ipfs_api = ipfsapi.connect(os.getenv("IPFS_HOST"), int(os.getenv("IPFS_PORT")))
|
ipfs_api = ipfshttpclient.connect(os.getenv("IPFS_HOST"), int(os.getenv("IPFS_PORT")))
|
||||||
djv = Dejavu(config)
|
djv = Dejavu(config)
|
||||||
if request.is_json :
|
if request.is_json :
|
||||||
ipfs_hash = request.json.get("cid")
|
ipfs_hash = request.json.get("cid")
|
||||||
|
|
Loading…
Reference in New Issue