Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

xunleipy: XunLei SDK for Python

Project Description
xunleipy
========
[![Build Status](https://travis-ci.org/lazygunner/xunleipy.svg?branch=master)](https://travis-ci.org/lazygunner/xunleipy)

### XunLei SDK
1. 模拟登录迅雷
2. 查看远程下载项目
3. 添加远程下载项目

### 远程下载使用方法
0. 安装&引用 xunleipy
```
pip install xunleipy
```
```
from xunleipy.remote import XunLeiRemote
```
1. 初始化迅雷远程对象
```
remote_client = XunLeiRemote(username, password, rk_username, rk_password, proxy=proxy)
```
* username - 迅雷账号
* password - 迅雷密码
* rk_username - 若快账号(用来自动识别验证码)
* rk_password - 若快密码(用来自动识别验证码)
* proxy - 代理地址,如果异地登录最好使用常用地区IP做代理(eg. http://192.168.1.1:8888)

2. 迅雷登录
```
remote_client.login() // 登录成功返回 True
```


3. 获取远程终端列表
```
peer_list = remote_client.get_remote_peer_list()
```
```
 返回数据
{
"rtn": 0,
"peerList": [
{
"category": "",
"status": 0,
"name": "GUNNER_NAS",
"vodPort": 8002,
"company": "XUNLEI_ARM_LE_ARMV5TE",
"pid": "F322***************",
"lastLoginTime": 1491282477,
"accesscode": "",
"localIP": "192.168.2.153",
"location": "",
"online": 1,
"path_list": "C:/",
"type": 30,
"deviceVersion": 22153310
},
{
"category": "",
"status": 0,
"name": "gunner-pc",
"vodPort": 0,
"company": "",
"pid": "0026***************",
"lastLoginTime": 1491121317,
"accesscode": "",
"localIP": "192.168.2.42",
"location": "",
"online": 0,
"path_list": "C:/迅雷下载/",
"type": 2,
"deviceVersion": 0
}
]
}
```

4. 添加下载链接
```
remote_data = {
'url': 'ed2k://|file|%E4%BA%BF%E4%B8%87.Billions.S02E01.%E4%B8%AD%E8%8B%B1%E5%AD%97%E5%B9%95.HDTVrip.720p.x264.mp4|633029318|3c85f90ef272d6581475c5c53c0be6f8|h=rilqokejso4mxrz3l2njyu6ee6u76bl3|/',
'name': 亿万.Billions.S02E01.中英字幕.HDTVrip.720p.x264.mp4,
'gcid': '',
'cid': '',
'file_size': 633029318
}
rtn = remote_client.add_tasks_to_remote(
peer_list[0]['pid'],   //要保证peer在线, 即peer['online'] == 1
'C:/TV/亿万 Billions/2/亿万.Billions.S02E01.中英字幕.HDTVrip.720p.x264.mp4', //路径可以自定义,但要确保存在
[remote_data]
)

if rtn['rtn'] != 0:
print '添加下载成功'
```

### 写在后面
这个项目断断续续写了有几年了,最主要的还是供自己的NAS自动下载更新的美剧,代码很多地方写的很丑,后续会逐渐优化
Release History

Release History

This version
History Node

0.3.3

History Node

0.3.2

History Node

0.3.1

History Node

0.3.0

History Node

0.2.19

History Node

0.2.18

History Node

0.2.17

History Node

0.2.16

History Node

0.2.15

History Node

0.2.14

History Node

0.2.13

History Node

0.2.12

History Node

0.2.11

History Node

0.2.10

History Node

0.2.9

History Node

0.2.8

History Node

0.2.7

History Node

0.2.6

History Node

0.2.5

History Node

0.2.4

History Node

0.2.3

History Node

0.2.2

History Node

0.2.1

History Node

0.2.0

History Node

0.1.13

History Node

0.1.12

History Node

0.1.11

History Node

0.1.10

History Node

0.1.9

History Node

0.1.8

History Node

0.1.7

History Node

0.1.6

History Node

0.1.5

History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1.0

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
xunleipy-0.3.3.tar.gz (23.1 kB) Copy SHA256 Checksum SHA256 Source Apr 16, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting