from flask import Blueprint, jsonify from app.services 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("/s/") def torrent_by_name(name): torrent_object = TorrentService(["C:\\Users\\Localhost\\Desktop\\BT"]) return jsonify({"code": 200, "message": torrent_object.get_by_name(name)})