littledl 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- littledl-0.1.0/.github/ISSUE_TEMPLATE/bug_report.md +56 -0
- littledl-0.1.0/.github/ISSUE_TEMPLATE/feature_request.md +46 -0
- littledl-0.1.0/.github/dependabot.yml +30 -0
- littledl-0.1.0/.github/pull_request_template.md +45 -0
- littledl-0.1.0/.github/workflows/ci.yml +106 -0
- littledl-0.1.0/.github/workflows/docs.yml +35 -0
- littledl-0.1.0/.github/workflows/pypi.yml +55 -0
- littledl-0.1.0/CHANGELOG.md +42 -0
- littledl-0.1.0/CHANGELOG.zh.md +42 -0
- littledl-0.1.0/CONTRIBUTING.md +189 -0
- littledl-0.1.0/CONTRIBUTING.zh.md +189 -0
- littledl-0.1.0/LICENSE +190 -0
- littledl-0.1.0/PKG-INFO +260 -0
- littledl-0.1.0/README.md +225 -0
- littledl-0.1.0/README.zh.md +225 -0
- littledl-0.1.0/SECURITY.md +140 -0
- littledl-0.1.0/SECURITY.zh.md +140 -0
- littledl-0.1.0/docs/en/advanced/index.md +173 -0
- littledl-0.1.0/docs/en/api-reference/index.md +200 -0
- littledl-0.1.0/docs/en/authentication/index.md +75 -0
- littledl-0.1.0/docs/en/configuration/index.md +110 -0
- littledl-0.1.0/docs/en/error-handling/index.md +104 -0
- littledl-0.1.0/docs/en/getting-started/index.md +56 -0
- littledl-0.1.0/docs/en/index.md +26 -0
- littledl-0.1.0/docs/en/proxy/index.md +71 -0
- littledl-0.1.0/docs/zh/advanced/index.md +173 -0
- littledl-0.1.0/docs/zh/api-reference/index.md +200 -0
- littledl-0.1.0/docs/zh/authentication/index.md +75 -0
- littledl-0.1.0/docs/zh/configuration/index.md +110 -0
- littledl-0.1.0/docs/zh/error-handling/index.md +104 -0
- littledl-0.1.0/docs/zh/getting-started/index.md +56 -0
- littledl-0.1.0/docs/zh/index.md +26 -0
- littledl-0.1.0/docs/zh/proxy/index.md +71 -0
- littledl-0.1.0/llms.txt +351 -0
- littledl-0.1.0/mkdocs.yml +87 -0
- littledl-0.1.0/pyproject.toml +74 -0
- littledl-0.1.0/src/littledl/__init__.py +124 -0
- littledl-0.1.0/src/littledl/__main__.py +237 -0
- littledl-0.1.0/src/littledl/auth.py +234 -0
- littledl-0.1.0/src/littledl/chunk.py +321 -0
- littledl-0.1.0/src/littledl/compat.py +242 -0
- littledl-0.1.0/src/littledl/config.py +362 -0
- littledl-0.1.0/src/littledl/connection.py +243 -0
- littledl-0.1.0/src/littledl/detector.py +317 -0
- littledl-0.1.0/src/littledl/downloader.py +891 -0
- littledl-0.1.0/src/littledl/exceptions.py +89 -0
- littledl-0.1.0/src/littledl/i18n/__init__.py +122 -0
- littledl-0.1.0/src/littledl/i18n/en.py +123 -0
- littledl-0.1.0/src/littledl/i18n/zh.py +123 -0
- littledl-0.1.0/src/littledl/limiter.py +317 -0
- littledl-0.1.0/src/littledl/monitor.py +267 -0
- littledl-0.1.0/src/littledl/proxy.py +340 -0
- littledl-0.1.0/src/littledl/resume.py +252 -0
- littledl-0.1.0/src/littledl/scheduler.py +258 -0
- littledl-0.1.0/src/littledl/utils.py +321 -0
- littledl-0.1.0/src/littledl/worker.py +351 -0
- littledl-0.1.0/src/littledl/writer.py +257 -0
- littledl-0.1.0/tests/test_littledl.py +481 -0
- littledl-0.1.0/uv.lock +640 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug Report
|
|
3
|
+
about: Report a bug to help us improve
|
|
4
|
+
title: '[BUG] '
|
|
5
|
+
labels: bug, needs-triage
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Describe the Bug
|
|
10
|
+
|
|
11
|
+
A clear and concise description of what the bug is.
|
|
12
|
+
|
|
13
|
+
## To Reproduce
|
|
14
|
+
|
|
15
|
+
Steps to reproduce the behavior:
|
|
16
|
+
|
|
17
|
+
1. Install version '...'
|
|
18
|
+
2. Run code '...'
|
|
19
|
+
3. See error
|
|
20
|
+
|
|
21
|
+
### Minimal Reproducible Code
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
from little_tree_downloader import download_file
|
|
25
|
+
|
|
26
|
+
# Your code here
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Expected Behavior
|
|
30
|
+
|
|
31
|
+
A clear and concise description of what you expected to happen.
|
|
32
|
+
|
|
33
|
+
## Actual Behavior
|
|
34
|
+
|
|
35
|
+
What actually happened.
|
|
36
|
+
|
|
37
|
+
## Error Output
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
Paste the full error traceback here
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Environment
|
|
44
|
+
|
|
45
|
+
- OS: [e.g., Windows 11, Ubuntu 22.04, macOS 14]
|
|
46
|
+
- Python version: [e.g., 3.11.5]
|
|
47
|
+
- Package version: [e.g., 0.1.0]
|
|
48
|
+
- Installation method: [e.g., pip, uv]
|
|
49
|
+
|
|
50
|
+
## Additional Context
|
|
51
|
+
|
|
52
|
+
Add any other context about the problem here.
|
|
53
|
+
|
|
54
|
+
- Does this happen consistently or intermittently?
|
|
55
|
+
- Any workarounds you've found?
|
|
56
|
+
- Any recent changes to your environment?
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature Request
|
|
3
|
+
about: Suggest an idea for this project
|
|
4
|
+
title: '[FEATURE] '
|
|
5
|
+
labels: enhancement, needs-triage
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Is your feature request related to a problem?
|
|
10
|
+
|
|
11
|
+
A clear and concise description of what the problem is.
|
|
12
|
+
|
|
13
|
+
Example: I'm always frustrated when [...]
|
|
14
|
+
|
|
15
|
+
## Describe the Solution You'd Like
|
|
16
|
+
|
|
17
|
+
A clear and concise description of what you want to happen.
|
|
18
|
+
|
|
19
|
+
## Describe Alternatives You've Considered
|
|
20
|
+
|
|
21
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
|
22
|
+
|
|
23
|
+
## Proposed API (if applicable)
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
from little_tree_downloader import DownloadConfig
|
|
27
|
+
|
|
28
|
+
config = DownloadConfig(
|
|
29
|
+
# Your proposed configuration
|
|
30
|
+
new_feature=True,
|
|
31
|
+
)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Use Case
|
|
35
|
+
|
|
36
|
+
Describe how this feature would be useful.
|
|
37
|
+
|
|
38
|
+
Example: This would help me to...
|
|
39
|
+
|
|
40
|
+
## Additional Context
|
|
41
|
+
|
|
42
|
+
Add any other context, code examples, or references to similar features in other projects.
|
|
43
|
+
|
|
44
|
+
- Would this be a breaking change?
|
|
45
|
+
- Are there any security implications?
|
|
46
|
+
- Does this require new dependencies?
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: "pip"
|
|
4
|
+
directory: "/"
|
|
5
|
+
schedule:
|
|
6
|
+
interval: "weekly"
|
|
7
|
+
open-pull-requests-limit: 10
|
|
8
|
+
reviewers:
|
|
9
|
+
- "shu-shu-1"
|
|
10
|
+
labels:
|
|
11
|
+
- "dependencies"
|
|
12
|
+
commit-message:
|
|
13
|
+
prefix: "chore"
|
|
14
|
+
include: "scope"
|
|
15
|
+
groups:
|
|
16
|
+
production-dependencies:
|
|
17
|
+
dependency-type: "production"
|
|
18
|
+
dev-dependencies:
|
|
19
|
+
dependency-type: "development"
|
|
20
|
+
|
|
21
|
+
- package-ecosystem: "github-actions"
|
|
22
|
+
directory: "/"
|
|
23
|
+
schedule:
|
|
24
|
+
interval: "weekly"
|
|
25
|
+
open-pull-requests-limit: 5
|
|
26
|
+
reviewers:
|
|
27
|
+
- "shu-shu-1"
|
|
28
|
+
labels:
|
|
29
|
+
- "github-actions"
|
|
30
|
+
- "dependencies"
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
## Description
|
|
2
|
+
|
|
3
|
+
Please include a summary of the changes and the related issue.
|
|
4
|
+
|
|
5
|
+
Fixes # (issue)
|
|
6
|
+
|
|
7
|
+
## Type of Change
|
|
8
|
+
|
|
9
|
+
- [ ] Bug fix (non-breaking change which fixes an issue)
|
|
10
|
+
- [ ] New feature (non-breaking change which adds functionality)
|
|
11
|
+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
|
12
|
+
- [ ] Documentation update
|
|
13
|
+
- [ ] Performance improvement
|
|
14
|
+
- [ ] Code refactoring
|
|
15
|
+
|
|
16
|
+
## How Has This Been Tested?
|
|
17
|
+
|
|
18
|
+
Please describe the tests that you ran to verify your changes.
|
|
19
|
+
|
|
20
|
+
- [ ] Unit tests pass locally
|
|
21
|
+
- [ ] Integration tests pass locally
|
|
22
|
+
- [ ] Manual testing performed
|
|
23
|
+
|
|
24
|
+
### Test Configuration
|
|
25
|
+
|
|
26
|
+
- OS:
|
|
27
|
+
- Python version:
|
|
28
|
+
- Package version:
|
|
29
|
+
|
|
30
|
+
## Checklist
|
|
31
|
+
|
|
32
|
+
- [ ] My code follows the style guidelines of this project
|
|
33
|
+
- [ ] I have performed a self-review of my code
|
|
34
|
+
- [ ] I have commented my code, particularly in hard-to-understand areas
|
|
35
|
+
- [ ] I have made corresponding changes to the documentation
|
|
36
|
+
- [ ] My changes generate no new warnings
|
|
37
|
+
- [ ] I have added tests that prove my fix is effective or that my feature works
|
|
38
|
+
- [ ] New and existing unit tests pass locally with my changes
|
|
39
|
+
- [ ] Any dependent changes have been merged and published
|
|
40
|
+
|
|
41
|
+
## Screenshots (if appropriate)
|
|
42
|
+
|
|
43
|
+
## Additional Context
|
|
44
|
+
|
|
45
|
+
Add any other context about the pull request here.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, develop]
|
|
6
|
+
paths-ignore:
|
|
7
|
+
- '**.md'
|
|
8
|
+
- 'LICENSE'
|
|
9
|
+
pull_request:
|
|
10
|
+
branches: [main, develop]
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
lint:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- name: Install uv
|
|
19
|
+
uses: astral-sh/setup-uv@v4
|
|
20
|
+
with:
|
|
21
|
+
version: "latest"
|
|
22
|
+
|
|
23
|
+
- name: Set up Python
|
|
24
|
+
run: uv python install 3.12
|
|
25
|
+
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
run: uv sync --all-extras
|
|
28
|
+
|
|
29
|
+
- name: Run Ruff
|
|
30
|
+
run: uv run ruff check src/
|
|
31
|
+
|
|
32
|
+
- name: Run Ruff format check
|
|
33
|
+
run: uv run ruff format --check src/
|
|
34
|
+
|
|
35
|
+
typecheck:
|
|
36
|
+
runs-on: ubuntu-latest
|
|
37
|
+
steps:
|
|
38
|
+
- uses: actions/checkout@v4
|
|
39
|
+
|
|
40
|
+
- name: Install uv
|
|
41
|
+
uses: astral-sh/setup-uv@v4
|
|
42
|
+
with:
|
|
43
|
+
version: "latest"
|
|
44
|
+
|
|
45
|
+
- name: Set up Python
|
|
46
|
+
run: uv python install 3.12
|
|
47
|
+
|
|
48
|
+
- name: Install dependencies
|
|
49
|
+
run: uv sync --all-extras
|
|
50
|
+
|
|
51
|
+
- name: Run MyPy
|
|
52
|
+
run: uv run mypy src/
|
|
53
|
+
|
|
54
|
+
test:
|
|
55
|
+
runs-on: ${{ matrix.os }}
|
|
56
|
+
strategy:
|
|
57
|
+
matrix:
|
|
58
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
59
|
+
python-version: ['3.10', '3.11', '3.12']
|
|
60
|
+
|
|
61
|
+
steps:
|
|
62
|
+
- uses: actions/checkout@v4
|
|
63
|
+
|
|
64
|
+
- name: Install uv
|
|
65
|
+
uses: astral-sh/setup-uv@v4
|
|
66
|
+
with:
|
|
67
|
+
version: "latest"
|
|
68
|
+
|
|
69
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
70
|
+
run: uv python install ${{ matrix.python-version }}
|
|
71
|
+
|
|
72
|
+
- name: Install dependencies
|
|
73
|
+
run: uv sync --all-extras
|
|
74
|
+
|
|
75
|
+
- name: Run tests
|
|
76
|
+
run: uv run pytest tests/ -v --cov --cov-report=xml
|
|
77
|
+
|
|
78
|
+
- name: Upload coverage
|
|
79
|
+
uses: codecov/codecov-action@v4
|
|
80
|
+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
|
|
81
|
+
with:
|
|
82
|
+
file: ./coverage.xml
|
|
83
|
+
fail_ci_if_error: false
|
|
84
|
+
|
|
85
|
+
build:
|
|
86
|
+
runs-on: ubuntu-latest
|
|
87
|
+
needs: [lint, typecheck, test]
|
|
88
|
+
steps:
|
|
89
|
+
- uses: actions/checkout@v4
|
|
90
|
+
|
|
91
|
+
- name: Install uv
|
|
92
|
+
uses: astral-sh/setup-uv@v4
|
|
93
|
+
with:
|
|
94
|
+
version: "latest"
|
|
95
|
+
|
|
96
|
+
- name: Set up Python
|
|
97
|
+
run: uv python install 3.12
|
|
98
|
+
|
|
99
|
+
- name: Build package
|
|
100
|
+
run: uv build
|
|
101
|
+
|
|
102
|
+
- name: Upload artifacts
|
|
103
|
+
uses: actions/upload-artifact@v4
|
|
104
|
+
with:
|
|
105
|
+
name: dist
|
|
106
|
+
path: dist/
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: Build Documentation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
paths:
|
|
8
|
+
- 'docs/**'
|
|
9
|
+
- 'mkdocs.yml'
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout repository
|
|
17
|
+
uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Setup Python
|
|
20
|
+
uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: '3.12'
|
|
23
|
+
|
|
24
|
+
- name: Install MkDocs and plugins
|
|
25
|
+
run: pip install mkdocs-material mkdocs-static-i18n mkdocs-llmstxt
|
|
26
|
+
|
|
27
|
+
- name: Build documentation
|
|
28
|
+
run: mkdocs build --strict --site-dir site
|
|
29
|
+
|
|
30
|
+
- name: Deploy to gh-pages branch
|
|
31
|
+
uses: peaceiris/actions-gh-pages@v3
|
|
32
|
+
with:
|
|
33
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
34
|
+
publish_dir: ./site
|
|
35
|
+
publish_branch: gh-pages
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
|
|
15
|
+
- name: Clean previous builds
|
|
16
|
+
run: |
|
|
17
|
+
rm -rf dist/ build/ *.egg-info/
|
|
18
|
+
|
|
19
|
+
- name: Install uv
|
|
20
|
+
uses: astral-sh/setup-uv@v4
|
|
21
|
+
with:
|
|
22
|
+
version: "latest"
|
|
23
|
+
|
|
24
|
+
- name: Set up Python
|
|
25
|
+
run: uv python install 3.12
|
|
26
|
+
|
|
27
|
+
- name: Install dependencies
|
|
28
|
+
run: uv sync
|
|
29
|
+
|
|
30
|
+
- name: Build package
|
|
31
|
+
run: uv build
|
|
32
|
+
|
|
33
|
+
- name: Upload artifacts
|
|
34
|
+
uses: actions/upload-artifact@v4
|
|
35
|
+
with:
|
|
36
|
+
name: dist
|
|
37
|
+
path: dist/
|
|
38
|
+
|
|
39
|
+
publish:
|
|
40
|
+
runs-on: ubuntu-latest
|
|
41
|
+
needs: [build]
|
|
42
|
+
environment:
|
|
43
|
+
name: production
|
|
44
|
+
url: https://pypi.org/project/littledl/
|
|
45
|
+
permissions:
|
|
46
|
+
id-token: write
|
|
47
|
+
steps:
|
|
48
|
+
- name: Download artifacts
|
|
49
|
+
uses: actions/download-artifact@v4
|
|
50
|
+
with:
|
|
51
|
+
name: dist
|
|
52
|
+
path: dist/
|
|
53
|
+
|
|
54
|
+
- name: Publish to PyPI
|
|
55
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
English | [简体中文](CHANGELOG.zh.md)
|
|
2
|
+
|
|
3
|
+
# Changelog
|
|
4
|
+
|
|
5
|
+
All notable changes to littledl will be documented in this file.
|
|
6
|
+
|
|
7
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
8
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
9
|
+
|
|
10
|
+
## [0.1.0][0.1.0] - 2026-03-28
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- IDM-style multi-threaded chunked downloading
|
|
15
|
+
- Smart scheduling with slow chunk detection and resplitting
|
|
16
|
+
- Resume support with chunk-level progress tracking
|
|
17
|
+
- Speed monitoring with real-time calculation
|
|
18
|
+
- Adaptive concurrency adjustment
|
|
19
|
+
- Connection pooling with HTTP/2 support
|
|
20
|
+
- Progress callback support
|
|
21
|
+
- Rich configuration options
|
|
22
|
+
- Comprehensive error handling
|
|
23
|
+
- File integrity verification (SHA256, MD5)
|
|
24
|
+
- Automatic filename detection from various sources
|
|
25
|
+
|
|
26
|
+
### Features
|
|
27
|
+
|
|
28
|
+
- **Multi-threaded Downloads**: Split files into chunks and download in parallel
|
|
29
|
+
- **Smart Scheduling**: Intelligent chunk resplitting for optimal speed
|
|
30
|
+
- **Resume Support**: Continue interrupted downloads seamlessly
|
|
31
|
+
- **Speed Monitoring**: Real-time speed calculation and ETA estimation
|
|
32
|
+
- **Adaptive Scheduling**: Dynamic adjustment based on network conditions
|
|
33
|
+
- **Connection Management**: Efficient HTTP connection reuse
|
|
34
|
+
|
|
35
|
+
### Supported Platforms
|
|
36
|
+
|
|
37
|
+
- Windows 10/11
|
|
38
|
+
- macOS 10.15+
|
|
39
|
+
- Linux (Ubuntu 20.04+, Debian 11+, Fedora 35+)
|
|
40
|
+
- FreeBSD 13+
|
|
41
|
+
|
|
42
|
+
[0.1.0]: https://github.com/little-tree/little-tree-downloader/releases/tag/v0.1.0
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
English | 简体中文
|
|
2
|
+
|
|
3
|
+
# 变更日志
|
|
4
|
+
|
|
5
|
+
本文档记录 littledl 的所有重要变更。
|
|
6
|
+
|
|
7
|
+
格式基于 [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
8
|
+
本项目遵循 [语义化版本](https://semver.org/spec/v2.0.0.html)。
|
|
9
|
+
|
|
10
|
+
## [0.1.0][0.1.0] - 2026-03-28
|
|
11
|
+
|
|
12
|
+
### 新增
|
|
13
|
+
|
|
14
|
+
- IDM 风格的多线程分块下载
|
|
15
|
+
- 智能调度(慢分块检测和重分配)
|
|
16
|
+
- 断点续传(分块级别进度跟踪)
|
|
17
|
+
- 实时速度监控
|
|
18
|
+
- 自适应并发调整
|
|
19
|
+
- HTTP/2 连接池
|
|
20
|
+
- 进度回调支持
|
|
21
|
+
- 丰富的配置选项
|
|
22
|
+
- 全面的错误处理
|
|
23
|
+
- 文件完整性验证(SHA256、MD5)
|
|
24
|
+
- 自动文件名检测
|
|
25
|
+
|
|
26
|
+
### 功能
|
|
27
|
+
|
|
28
|
+
- **多线程下载**:分块并行下载
|
|
29
|
+
- **智能调度**:智能分块重分配优化速度
|
|
30
|
+
- **断点续传**:无缝继续中断的下载
|
|
31
|
+
- **速度监控**:实时速度计算和预计剩余时间
|
|
32
|
+
- **自适应调度**:根据网络状况动态调整
|
|
33
|
+
- **连接管理**:高效的 HTTP 连接复用
|
|
34
|
+
|
|
35
|
+
### 支持的平台
|
|
36
|
+
|
|
37
|
+
- Windows 10/11
|
|
38
|
+
- macOS 10.15+
|
|
39
|
+
- Linux (Ubuntu 20.04+, Debian 11+, Fedora 35+)
|
|
40
|
+
- FreeBSD 13+
|
|
41
|
+
|
|
42
|
+
[0.1.0]: https://github.com/little-tree/little-tree-downloader/releases/tag/v0.1.0
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
English | [简体中文](CONTRIBUTING.zh.md)
|
|
2
|
+
|
|
3
|
+
# Contributing to littledl
|
|
4
|
+
|
|
5
|
+
First off, thank you for considering contributing to littledl! It's people like you that make this project great.
|
|
6
|
+
|
|
7
|
+
## Table of Contents
|
|
8
|
+
|
|
9
|
+
- [Code of Conduct](#code-of-conduct)
|
|
10
|
+
- [Getting Started](#getting-started)
|
|
11
|
+
- [Development Setup](#development-setup)
|
|
12
|
+
- [How to Contribute](#how-to-contribute)
|
|
13
|
+
- [Coding Standards](#coding-standards)
|
|
14
|
+
- [Commit Guidelines](#commit-guidelines)
|
|
15
|
+
- [Pull Request Process](#pull-request-process)
|
|
16
|
+
- [Reporting Bugs](#reporting-bugs)
|
|
17
|
+
- [Feature Requests](#feature-requests)
|
|
18
|
+
|
|
19
|
+
## Code of Conduct
|
|
20
|
+
|
|
21
|
+
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainers.
|
|
22
|
+
|
|
23
|
+
## Getting Started
|
|
24
|
+
|
|
25
|
+
### Prerequisites
|
|
26
|
+
|
|
27
|
+
- Python 3.10 or higher
|
|
28
|
+
- [uv](https://github.com/astral-sh/uv) package manager
|
|
29
|
+
- Git
|
|
30
|
+
|
|
31
|
+
### Development Setup
|
|
32
|
+
|
|
33
|
+
1. **Fork and clone the repository**
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
git clone https://github.com/YOUR_USERNAME/little-tree-downloader.git
|
|
37
|
+
cd little-tree-downloader
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
2. **Install dependencies**
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
uv sync --all-extras
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
3. **Run tests to verify setup**
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
uv run pytest tests/ -v
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
4. **Run linting**
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
uv run ruff check src/
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## How to Contribute
|
|
59
|
+
|
|
60
|
+
### Reporting Bugs
|
|
61
|
+
|
|
62
|
+
Before creating bug reports, please check the existing issues. When you are creating a bug report, please include as many details as possible:
|
|
63
|
+
|
|
64
|
+
- **Use a clear and descriptive title**
|
|
65
|
+
- **Describe the exact steps to reproduce the problem**
|
|
66
|
+
- **Provide specific examples with code snippets**
|
|
67
|
+
- **Describe the behavior you observed and expected**
|
|
68
|
+
- **Include your environment details** (OS, Python version, package version)
|
|
69
|
+
|
|
70
|
+
### Suggesting Enhancements
|
|
71
|
+
|
|
72
|
+
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion:
|
|
73
|
+
|
|
74
|
+
- **Use a clear and descriptive title**
|
|
75
|
+
- **Provide a step-by-step description of the suggested enhancement**
|
|
76
|
+
- **Provide specific examples to demonstrate the use case**
|
|
77
|
+
- **Describe the current behavior and explain the expected behavior**
|
|
78
|
+
- **Explain why this enhancement would be useful**
|
|
79
|
+
|
|
80
|
+
### Pull Requests
|
|
81
|
+
|
|
82
|
+
1. **Create a branch**
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
git checkout -b feature/your-feature-name
|
|
86
|
+
# or
|
|
87
|
+
git checkout -b fix/your-bug-fix
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
2. **Make your changes**
|
|
91
|
+
|
|
92
|
+
- Follow the [coding standards](#coding-standards)
|
|
93
|
+
- Add tests for new functionality
|
|
94
|
+
- Update documentation as needed
|
|
95
|
+
|
|
96
|
+
3. **Run tests and linting**
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
uv run pytest tests/ -v --cov
|
|
100
|
+
uv run ruff check src/
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
4. **Commit your changes**
|
|
104
|
+
|
|
105
|
+
Follow the [commit guidelines](#commit-guidelines).
|
|
106
|
+
|
|
107
|
+
5. **Push and create a pull request**
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
git push origin your-branch-name
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Coding Standards
|
|
114
|
+
|
|
115
|
+
### Python Style
|
|
116
|
+
|
|
117
|
+
- Follow [PEP 8](https://pep8.org/) style guide
|
|
118
|
+
- Use type hints for all function signatures
|
|
119
|
+
- Write docstrings for public modules, functions, classes, and methods
|
|
120
|
+
- Maximum line length is 120 characters
|
|
121
|
+
|
|
122
|
+
### Code Organization
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
src/littledl/
|
|
126
|
+
├── __init__.py # Public API exports
|
|
127
|
+
├── config.py # Configuration classes
|
|
128
|
+
├── downloader.py # Main downloader implementation
|
|
129
|
+
├── chunk.py # Chunk management
|
|
130
|
+
├── worker.py # Download workers
|
|
131
|
+
├── scheduler.py # Smart scheduling
|
|
132
|
+
├── monitor.py # Speed monitoring
|
|
133
|
+
├── resume.py # Resume support
|
|
134
|
+
├── connection.py # Connection management
|
|
135
|
+
├── auth.py # Authentication
|
|
136
|
+
├── proxy.py # Proxy support
|
|
137
|
+
├── limiter.py # Speed limiting
|
|
138
|
+
├── detector.py # Server detection
|
|
139
|
+
├── compat.py # Cross-platform compatibility
|
|
140
|
+
├── exceptions.py # Custom exceptions
|
|
141
|
+
├── utils.py # Utility functions
|
|
142
|
+
└── i18n/ # Internationalization
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Commit Guidelines
|
|
146
|
+
|
|
147
|
+
We follow [Conventional Commits](https://www.conventionalcommits.org/):
|
|
148
|
+
|
|
149
|
+
### Format
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
<type>(<scope>): <description>
|
|
153
|
+
|
|
154
|
+
[optional body]
|
|
155
|
+
|
|
156
|
+
[optional footer(s)]
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Types
|
|
160
|
+
|
|
161
|
+
- `feat`: A new feature
|
|
162
|
+
- `fix`: A bug fix
|
|
163
|
+
- `docs`: Documentation only changes
|
|
164
|
+
- `style`: Changes that do not affect the meaning of the code
|
|
165
|
+
- `refactor`: A code change that neither fixes a bug nor adds a feature
|
|
166
|
+
- `perf`: A code change that improves performance
|
|
167
|
+
- `test`: Adding missing tests or correcting existing tests
|
|
168
|
+
- `chore`: Changes to the build process or auxiliary tools
|
|
169
|
+
|
|
170
|
+
## Pull Request Process
|
|
171
|
+
|
|
172
|
+
1. **Ensure all tests pass** before submitting
|
|
173
|
+
2. **Update documentation** for any new features
|
|
174
|
+
3. **Add tests** for any new functionality
|
|
175
|
+
4. **Follow the PR template** when creating your PR
|
|
176
|
+
5. **Request review** from maintainers
|
|
177
|
+
6. **Address review feedback** promptly
|
|
178
|
+
|
|
179
|
+
## Additional Resources
|
|
180
|
+
|
|
181
|
+
- [Python Type Hints](https://docs.python.org/3/library/typing.html)
|
|
182
|
+
- [pytest Documentation](https://docs.pytest.org/)
|
|
183
|
+
- [httpx Documentation](https://www.python-httpx.org/)
|
|
184
|
+
|
|
185
|
+
## Questions?
|
|
186
|
+
|
|
187
|
+
Feel free to open an issue for questions or reach out to the maintainers.
|
|
188
|
+
|
|
189
|
+
Thank you for contributing!
|