Skip to main content

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()

# 执行完后,迅雷将自动打开并弹出生成的批量任务,点击下载即可。

Metadata

Release files for thunders 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for thunders 0.1.6
File Size Uploaded
thunders-0.1.6.tar.gz 5.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for thunders 0.1.6
File Interpreter ABI Platform
thunders-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 10.7 kB

Release files / thunders-0.1.6.tar.gz

Download URL thunders-0.1.6.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e2313ee128ecf8a8b0274ed0368a33a1b097ce592286d368020491449cf9b49d
BLAKE2b-256 checksum
How to use checksums
18c6dac15b42baed6a0dc8f4495cc590412b79bf5fd93bb4133f292ea12e17a2
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / thunders-0.1.6-py3-none-any.whl

Download URL thunders-0.1.6-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d9597ee77393e1afa2987d6de290a652961c8c12c57fd99cb424f832ea4f719e
BLAKE2b-256 checksum
How to use checksums
69c1adc6cf2830f110238439e74512f0e0bf4fb54f9a71ad69722b7070927fe2
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page