from flask import Blueprint, jsonify from app.services.torrent_service import TorrentService bp = Blueprint("torrent", __name__) @bp.route('/deduplication') def torrent_deduplication(): torrent_object = TorrentService(["C:\\Users\\Localhost\\Desktop\\BT"]) return jsonify({"code": 200, "message": torrent_object.deduplication()}) @bp.route("/statistics") def torrent_statistics(): torrent_object = TorrentService(["C:\\Users\\Localhost\\Desktop\\BT"]) return jsonify({"code": 200, "message": torrent_object.statistics()}) @bp.route("/") def torrent_by_name(name): torrent_object = TorrentService(["C:\\Users\\Localhost\\Desktop\\BT"]) return jsonify({"code": 200, "message": torrent_object.get_by_name(name)}) # @bp.route("/extract/name") # def torrent_extract_name(): # torrent_object = TorrentService([]) # return jsonify({"code": 200, "message": torrent_object.extract_name("AVSA-429.torrent")})