qbittorrent.cpython-311.pyc•9.02 kB
�
I@(h= � � � d dl Z d dlmZ d dlZd dlZd dlZd dlZd dlmZm Z m
Z
mZmZm
Z
mZmZmZmZmZmZmZmZ ed� � Ze� � � dedefd�� � Ze� � � d!d ed
edefd�� � Ze� � � d edefd�� � Ze� � � d edefd
�� � Ze� � � dedefd�� � Ze� � � dedefd�� � Z e� � � dedefd�� � Z!e� � � defd�� � Z"e� � � dedededefd�� � Z#e� � � dededefd�� � Z$e� � � dededefd�� � Z%e� � � dededefd�� � Z&e� � � dededefd�� � Z'e� � � defd�� � Z(e)dk re�* d� � � dS dS )"� N)�FastMCP)�add_torrent_api�delete_torrent_api�pause_torrent_api�resume_torrent_api�get_torrent_trackers_urls�set_global_download_limit_api�set_global_upload_limit_api�get_application_version_api�set_file_priority_api�set_torrent_download_limit_api�set_torrent_upload_limit_api�add_trackers_to_torrent_api�add_torrent_tags_api�get_torrent_list_api�qbittorrent�query�returnc � �0 K � t | � � � d{V ��S )u�
添加种子文件到qBittorrent
Args:
query: 包含种子文件路径的查询字符串,支持以下格式:
1. JSON字符串: "{"file_paths": ["path/to/file1.torrent", "path/to/file2.torrent"]}"
2. JSON字符串: "["path/to/file1.torrent", "path/to/file2.torrent"]"
3. 单一文件路径: "path/to/file.torrent"
Returns:
添加结果的状态和消息
N)r )r s �D/workspace/PC-Canary/apps/qBittorrent/qbittorrent_mcp/qbittorrent.py�add_torrentr s( � � � � !��'�'�'�'�'�'�'�'�'� F�hashes�delete_filesc � �2 K � t | |� � � d{V ��S )u
删除qBittorrent中的种子
Args:
hashes: 要删除的种子哈希值,多个哈希值用|分隔,或者使用'all'删除所有种子
delete_files: 如果为True,同时删除下载的文件
Returns:
删除操作的结果消息
N)r )r r s r �delete_torrentr + s* � � � � $�F�L�9�9�9�9�9�9�9�9�9r c � �0 K � t | � � � d{V ��S )u�
暂停种子
Args:
hashes: 要暂停的种子哈希值,多个哈希值用|分隔,或者使用'all'暂停所有种子
Returns:
暂停操作的结果消息
N)r �r s r �
pause_torrentr ; s( � � � � #�6�*�*�*�*�*�*�*�*�*r c � �0 K � t | � � � d{V ��S )u�
恢复种子
Args:
hashes: 要恢复的种子哈希值,多个哈希值用|分隔,或者使用'all'恢复所有种子
Returns:
恢复操作的结果消息
N)r r s r �resume_torrentr! H s( � � � � $�F�+�+�+�+�+�+�+�+�+r �hashc � �0 K � t | � � � d{V ��S )u�
获取种子跟踪器
Args:
hash: 种子哈希值
Returns:
包含跟踪器信息的字符串
N)r )r"