Skip to main content
Glama
qbittorrent.cpython-311.pyc9.02 kB
� I@(h=� ��ddlZddlmZddlZddlZddlZddlZddlmZm Z m Z m Z m Z m Z mZmZmZmZmZmZmZmZed��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)dkre�*d� ��dSdS)"�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��0K�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)rs �D/workspace/PC-Canary/apps/qBittorrent/qbittorrent_mcp/qbittorrent.py� add_torrentrs(����!��'�'� '� '� '� '� '� '�'�F�hashes� delete_filesc��2K�t||���d{V��S)u  删除qBittorrent中的种子 Args: hashes: 要删除的种子哈希值,多个哈希值用|分隔,或者使用'all'删除所有种子 delete_files: 如果为True,同时删除下载的文件 Returns: 删除操作的结果消息 N)r)rrs r�delete_torrentr+s*����$�F�L�9�9� 9� 9� 9� 9� 9� 9�9rc��0K�t|���d{V��S)u� 暂停种子 Args: hashes: 要暂停的种子哈希值,多个哈希值用|分隔,或者使用'all'暂停所有种子 Returns: 暂停操作的结果消息 N)r�rs r� pause_torrentr;s(����#�6�*�*� *� *� *� *� *� *�*rc��0K�t|���d{V��S)u� 恢复种子 Args: hashes: 要恢复的种子哈希值,多个哈希值用|分隔,或者使用'all'恢复所有种子 Returns: 恢复操作的结果消息 N)rrs r�resume_torrentr!Hs(����$�F�+�+� +� +� +� +� +� +�+r�hashc��0K�t|���d{V��S)u� 获取种子跟踪器 Args: hash: 种子哈希值 Returns: 包含跟踪器信息的字符串 N)r)r"s r�get_torrent_trackersr$Us(����+�4�0�0� 0� 0� 0� 0� 0� 0�0r�limitc��0K�t|���d{V��S)u� 设置全局下载限速 Args: limit: 限速值,单位为字节/秒 Returns: 设置限速的结果消息 N)r �r%s r�set_global_download_limitr(bs(����/�u�5�5� 5� 5� 5� 5� 5� 5�5rc��0K�t|���d{V��S)u� 设置全局上传限速 Args: limit: 限速值,单位为字节/秒 Returns: 设置限速的结果消息 N)r r's r�set_global_upload_limitr*os(����-�U�3�3� 3� 3� 3� 3� 3� 3�3rc��.K�t���d{V��S)uM 获取qBittorrent版本 Returns: qBittorrent版本 N)r �rr�get_application_versionr-|s&����-�.�.� .� .� .� .� .� .�.r�id�priorityc��4K�t|||���d{V��S)u� 设置文件优先级 Args: hash: 种子哈希值 id: correspond to file position inside the array returned by torrent contents API, e.g. id=0 for first file, id=1 for second file, etc. priority: Value Description 0 Do not download 1 Normal priority 6 High priority 7 Maximal priority Returns: 设置文件优先级的结果消息 HTTP Status Code Scenario 400 Priority is invalid 400 At least one file id is not a valid integer 404 Torrent hash was not found 409 Torrent metadata hasn't downloaded yet 409 At least one file id was not found 200 All other scenarios N)r )r"r.r/s r�set_file_priorityr1�s,����2'�t�R��:�:� :� :� :� :� :� :�:rc��2K�t||���d{V��S)u� 设置种子下载限速 Args: hash: 种子哈希值 limit: 限速值,单位为字节/秒 Returns: 设置种子下载限速的结果消息 N)r �r"r%s r�set_torrent_download_limitr4�s*����0��e�<�<� <� <� <� <� <� <�<rc��2K�t||���d{V��S)u� 设置种子上传限速 Args: hash: 种子哈希值 limit: 限速值,单位为字节/秒 Returns: 设置种子上传限速的结果消息 N)rr3s r�set_torrent_upload_limitr6�s*����.�d�E�:�:� :� :� :� :� :� :�:r�trackersc��2K�t||���d{V��S)u� 添加跟踪器到种子 Args: hash: 种子哈希值 trackers: 跟踪器URL,多个URL用%0A分隔 Returns: 添加跟踪器的结果消息 N)r)r"r7s r�add_trackers_to_torrentr9�s*����-�T�8�<�<� <� <� <� <� <� <�<r�tagsc��2K�t||���d{V��S)u� 添加种子标签 Args: hash: 种子哈希值 tags: 标签列表,多个标签用逗号分隔 Returns: 添加种子标签的结果消息 N)r)r"r:s r�add_torrent_tagsr<�s*����&�d�D�1�1� 1� 1� 1� 1� 1� 1�1rc��.K�t���d{V��S)u 获取种子列表 N)rr,rr�get_torrent_listr>�s&���� &�'�'� '� '� '� '� '� '�'r�__main__�stdio)� transport)F)+�httpx� mcp.serverr�base64�os�json�uuid�apirrrrrr r r r r rrrr�app�tool�strr�boolrrr!r$�intr(r*r-r1r4r6r9r<r>�__name__�runr,rr�<module>rPs>�� � � � ������� � � � � � � � � � � � � � � � ���������������������������������$�g�m��������� (�S� (�S� (� (� (� �� (������ :� :�� :�D� :�S� :� :� :� �� :������ +�� +�� +� +� +� �� +������ ,�� ,�� ,� ,� ,� �� ,������ 1�S� 1�S� 1� 1� 1� �� 1������ 6�3� 6�3� 6� 6� 6� �� 6������ 4�� 4�� 4� 4� 4� �� 4������/�s�/�/�/� ��/������;�#�;�3�;�#�;�#�;�;�;� ��;�4����� =�3� =�s� =�s� =� =� =� �� =������ ;�� ;�S� ;�S� ;� ;� ;� �� ;������ =�� =�s� =�s� =� =� =� �� =������ 2�� 2�C� 2�C� 2� 2� 2� �� 2������(��(�(�(� ��(�  �z����G�G�g�G�������r

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pickpppcc/qbittorrent-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server