迅雷非官方批量下载SDK
Project description
Thunders
迅雷非官方批量下载SDK。
感谢使用。
版本记录
- 0.1.6: 新增"完整实例"
- 0.1.5: 修复Windows下批量任务启动失效的问题
- 0.1.3: 新增版本记录
- 0.1.2: 更新ReadMe
- 新增
obj.dump
,为了简洁、美观,无需再调用__repr__
- 新增"获取批量任务中的子任务"示例
- 新增"内存中获取URL Scheme"示例
- 新增
- 0.1.1: 更新ReadMe
- 新增"创建批量自定义任务"示例
快速入门
创建批量自定义任务
from thunders import Task, GroupTask
group_task = GroupTask(name="test")
group_task.append(Task("https://ahamega.com/1.mp4"))
group_task.append(Task("https://ahamega.com/2.mp4", name="自定义重命名2.mp4"))
group_task.run() # 执行完后,迅雷会打开并弹出上面创建的批量任务,点击下载即可
# 也可以这么用
group_task.extend([
Task("https://ahamega.com/1.mp4"),
Task("https://ahamega.com/2.mp4", name="自定义重命名2.mp4")
])
group_task.run() # 执行完后,迅雷会打开并弹出上面创建的批量任务,点击下载即可
获取批量任务中的子任务
for task in group_task:
print(task.name, task.origin_url, task.url, sep="\n")
# 也可以直接索引取出
task1 = group_task[0]
内存中获取URL Scheme
url_scheme = group_task.dump()
完整实例
import json
import re
from leto.core.crawler import Crawler
from thunders import Task, GroupTask
crawler = Crawler()
task = GroupTask("xxxxxx第1季")
def download(url, current_no=1):
res = crawler.crawl(url)
data = json.loads(re.search("xxxxxx", res.text).group())
crawler.log.debug(res.text)
# 添加至批量任务
task.append(Task(**{
"name": f"{task.name}-{str(current_no).zfill(2)}.mp4", # 文件(子任务)重命名
"url": data["url"],
}))
next_url = data["next"]
if not next_url:
return task
return download(next_url, current_no + 1)
download("https://xxxxxx.com/xxxxxx/xxxxxx").run()
# 执行完后,迅雷将自动打开并弹出生成的批量任务,点击下载即可。
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
thunders-0.1.6.tar.gz
(5.4 kB
view details)
Built Distribution
File details
Details for the file thunders-0.1.6.tar.gz
.
File metadata
- Download URL: thunders-0.1.6.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.0.2rc1 requests/2.24.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2313ee128ecf8a8b0274ed0368a33a1b097ce592286d368020491449cf9b49d |
|
MD5 | 91258994597611819548bd7935fe860c |
|
BLAKE2b-256 | 18c6dac15b42baed6a0dc8f4495cc590412b79bf5fd93bb4133f292ea12e17a2 |
File details
Details for the file thunders-0.1.6-py3-none-any.whl
.
File metadata
- Download URL: thunders-0.1.6-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.0.2rc1 requests/2.24.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9597ee77393e1afa2987d6de290a652961c8c12c57fd99cb424f832ea4f719e |
|
MD5 | 8d673579b9d67f7fc08235582c234359 |
|
BLAKE2b-256 | 69c1adc6cf2830f110238439e74512f0e0bf4fb54f9a71ad69722b7070927fe2 |