Skip to main content

Docker版本迅雷 API Client

Project description

pyxunlei

基于Docker版本的Xunlei API Client

使用方法

from pyxunlei import XunleiClient
#  初始化时支持以下参数:
#  host (str): 域名或IP
#  port (int): 端口号
#  ssl (bool): 是否启动HTTPS
#  device_name (str): 设备名称,当同一个账号下绑定了多个远程迅雷,可指定设备名称,设备名称可在迅雷APP查看
#      例如:群晖-xunlei
#      device_name为空时使用第一个设备.
#  download_root_dir(str): 下载根目录的目录名称,可以在web页面上查看,如不填写则默认选择第一个(一般是迅雷下载)
xunlei_client = XunLeiClient(
        '192.168.2.137', 2345, device_name="群晖-xunlei")

# 获取已完成任务列表
completed_tasks = xunlei_client.completed_tasks()

# 获取未完成任务列表
uncompleted_tasks = xunlei_client.uncompleted_tasks()

# 提交磁力链接
magnetic_link = "磁力链接"
sub_dir = "子目录"  # 为空时则不创建子目录
preprocess_file = xunlei_client.filter_file_by_size  # 指定预处理文件函数,可使用内置的filter_file_by_size过滤掉小于500M以及大于40G的文件
xunlei_client.download_magnetic(magnetic_link, sub_dir, preprocess_file)

# 提交种子链接
torrent_file_path = "your.torrent"  # 种子文件路径
xunlei_client.download_torrent(torrent_file_path, sub_dir, preprocess_file)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyxunlei-0.1.3.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyxunlei-0.1.3-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file pyxunlei-0.1.3.tar.gz.

File metadata

  • Download URL: pyxunlei-0.1.3.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.0 CPython/3.10.6 Darwin/20.6.0

File hashes

Hashes for pyxunlei-0.1.3.tar.gz
Algorithm Hash digest
SHA256 8ba7d7698512ab7f5063e8f24113417ad52e129e649d107199e093f38409286d
MD5 8f33c2de0aebbef6a25bae895ad88055
BLAKE2b-256 6ceda17d280bc775d42039dbde125d66e6443464fb65a665bbfc7bc448713425

See more details on using hashes here.

File details

Details for the file pyxunlei-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: pyxunlei-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.0 CPython/3.10.6 Darwin/20.6.0

File hashes

Hashes for pyxunlei-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ae618f27e012b88ed85af71ad25bb64077bd45ecf92e240bcbf13121f2e9e82c
MD5 45c29cfc8a74c84741c3fbd1b0934292
BLAKE2b-256 c29ca1a2eeb0e81d21f48c700c5b31211dce8e94c4067c8fb936e2be5f2092ec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page