From 912eebddee03fa3c13366b5ae74a4108e31734f3 Mon Sep 17 00:00:00 2001 From: zhengshunjin <2667579369@qq.com> Date: Wed, 10 Jun 2026 18:57:07 +0800 Subject: [PATCH] =?UTF-8?q?remove(magnet):=20=E5=88=A0=E9=99=A4=E7=A3=81?= =?UTF-8?q?=E5=8A=9B=E9=93=BE=E6=8E=A5=E7=9B=B8=E5=85=B3=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除 magnet_bp 蓝图及其路由配置 - 删除 app/__init__.py 中的 magnet_bp 导入和注册 - 移除 app/services/magnet_service.py 服务文件 - 从 requirements.txt 中删除 libtorrent 依赖 - 保留 Flask-CORS 但移除其他无关依赖项位置调整 --- app/__init__.py | 3 +-- app/blueprints/magnet_bp.py | 11 ----------- app/services/magnet_service.py | 9 --------- requirements.txt | 3 +-- 4 files changed, 2 insertions(+), 24 deletions(-) delete mode 100644 app/blueprints/magnet_bp.py delete mode 100644 app/services/magnet_service.py diff --git a/app/__init__.py b/app/__init__.py index 68daedb..6272c9b 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -2,7 +2,7 @@ from flask import Flask from flask_cors import CORS from .extensions import db, migrate from .config import DevelopmentConfig, ProductionConfig, TestingConfig -from .blueprints import torrent_bp, book_bp, music_bp, file_bp, video_bp, image_bp, asmr_bp, magnet_bp +from .blueprints import torrent_bp, book_bp, music_bp, file_bp, video_bp, image_bp, asmr_bp def create_app(config_name="development"): @@ -28,6 +28,5 @@ def create_app(config_name="development"): app.register_blueprint(video_bp.bp, url_prefix='/api/video') app.register_blueprint(image_bp.bp, url_prefix='/api/image') app.register_blueprint(asmr_bp.bp, url_prefix='/api/asmr') - app.register_blueprint(magnet_bp.bp, url_prefix='/api/magnet') return app diff --git a/app/blueprints/magnet_bp.py b/app/blueprints/magnet_bp.py deleted file mode 100644 index 2c16fda..0000000 --- a/app/blueprints/magnet_bp.py +++ /dev/null @@ -1,11 +0,0 @@ -from flask import Blueprint, Response, jsonify - -from app.services.magnet_service import MagnetService - -bp = Blueprint("magnet", __name__) - - -@bp.route("/") -def index(): - magnet_object = MagnetService() - return jsonify({"code": 200, "message": magnet_object.to_torrent()}) \ No newline at end of file diff --git a/app/services/magnet_service.py b/app/services/magnet_service.py deleted file mode 100644 index 6d45343..0000000 --- a/app/services/magnet_service.py +++ /dev/null @@ -1,9 +0,0 @@ -import requests - - -class MagnetService: - def __init__(self): - pass - - def to_torrent(self): - pass \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 64b6cbf..5e8ea7f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,5 +6,4 @@ Flask Flask-Migrate Flask-SocketIO Flask-SQLAlchemy -Flask-CORS -libtorrent \ No newline at end of file +Flask-CORS \ No newline at end of file