Skip to main content

Repository template for Python projects

Project description

HCFDownloader (戶晨風下載器)

PyPI version python uv Ruff Pydantic v2 tests code-quality license PRs contributors

🎥 A specialized YouTube channel downloader for archiving 戶晨風 (HCF) streams and videos. Download entire channels or individual videos with ease.

Other Languages: English | 繁體中文 | 简体中文

✨ Features

  • 🎬 YouTube Channel Downloader: Download all videos from 戶晨風's YouTube channel
  • 🔄 High Quality Downloads: Support for multiple quality options (best, high, medium, low)
  • 📦 Modern Python Stack: Built with Pydantic, yt-dlp, and Rich for robust functionality
  • 🎯 Simple CLI: Easy-to-use command-line interface powered by Python Fire
  • 🔁 Retry Mechanism: Automatic retries for failed downloads
  • 📁 Organized Output: Videos saved to customizable download folders
  • 🎨 Rich Progress Display: Beautiful terminal output with Rich library
  • 🌐 Multi-site Support: Works with YouTube, Bilibili, and other video platforms

🚀 Quick Start

Prerequisites

  • Python 3.11–3.14
  • uv (install with make uv-install)

Installation

# Install uv (if not already installed)
make uv-install

# Install dependencies
uv sync

Basic Usage

Download a single video:

# Download with default settings (best quality)
uv run hcf_downloader --url="https://www.youtube.com/watch?v=VIDEO_ID"

# Specify quality
uv run hcf_downloader --url="https://www.youtube.com/watch?v=VIDEO_ID" --quality="high"

Or use the CLI entry point:

# After installation
hcf_downloader --url="https://www.youtube.com/watch?v=VIDEO_ID"

Advanced Usage

from hcf_downloader.cli import VideoDownloader

# Initialize downloader
downloader = VideoDownloader(output_folder="./my_downloads", max_retries=5)

# Download a video
title, filepath = downloader.download(
    url="https://www.youtube.com/watch?v=VIDEO_ID",
    quality="best",  # Options: best, high, medium, low
)

print(f"Downloaded: {title} to {filepath}")

🧰 Commands Reference

# Development
make help               # List available make targets
make clean              # Clean caches and artifacts
make format             # Run all pre-commit hooks
make test               # Run pytest

# Dependencies (via uv)
make uv-install         # Install uv on your system
uv add <pkg>            # Add production dependency
uv sync                 # Install all dependencies

📝 Quality Settings

HCFDownloader supports multiple quality presets:

  • best: Best available video and audio quality (default)
  • high: Up to 1080p at 60fps
  • medium: Up to 720p at 60fps
  • low: Up to 480p

🛠️ Development

Setting up development environment

# Install development dependencies
uv sync --group dev

# Install pre-commit hooks
uv tool install pre-commit
make format

# Run tests
make test

📦 Project Structure

hcf_downloader/
├── src/
│   └── hcf_downloader/
│       ├── __init__.py
│       └── cli.py          # Main CLI and downloader logic
├── tests/
│   └── test_hello.py
├── pyproject.toml          # Project configuration
└── README.md

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments


Made with ❤️ for archiving 戶晨風's content
uv add --dev # Add development dependency ```

🎯 About HCF (戶晨風)

This tool is specifically designed to archive content from 戶晨風's YouTube channel. It supports downloading:

  • Live streams
  • Regular videos
  • Entire channel archives

⚙️ Configuration

You can customize the downloader behavior:

from hcf_downloader.cli import VideoDownloader

downloader = VideoDownloader(
    output_folder="./my_custom_folder",  # Custom download location
    max_retries=10,  # Increase retry attempts
)

� Technical Details

Built with modern Python best practices:

  • Type-hinted code with Pydantic models
  • Robust error handling and retry mechanisms
  • Beautiful terminal output with Rich
  • Configurable quality settings
  • Support for multiple video platforms
    • Builds multi-platform executables (via PyInstaller):
      • macOS (ARM64, x64)
      • Linux (x64 GNU, ARM64 GNU)
      • Windows (x64, ARM64)
    • Builds Python package (wheel & sdist)
    • Automatically publishes to PyPI (requires UV_PUBLISH_TOKEN secret)
    • Uploads all artifacts to GitHub Release

📚 Documentation

For more detailed information:

❓ FAQ

Q: Can I download playlists? A: Currently, the tool is set to download individual videos. Playlist support may be added in future versions.

Q: What video formats are supported? A: The tool outputs MP4 files by default, which are compatible with most media players.

Q: How do I stop a download? A: Press Ctrl+C to cancel the current download.

Q: Can I use this for other YouTube channels? A: Yes! While designed for 戶晨風's channel, this tool works with any YouTube video or channel.

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

hcf_downloader-0.0.1.tar.gz (117.0 kB view details)

Uploaded Source

Built Distribution

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

hcf_downloader-0.0.1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file hcf_downloader-0.0.1.tar.gz.

File metadata

  • Download URL: hcf_downloader-0.0.1.tar.gz
  • Upload date:
  • Size: 117.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.5

File hashes

Hashes for hcf_downloader-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f0be52d74d52a73ca8454fee4fd99c76457186ea9ede4296828505cdc0ee8b43
MD5 5d7fad33326f260dfc339aa7b10e55ca
BLAKE2b-256 98bcb772dc90e54d691b74601c5f5d24a7b01684a433386619885aa1adf84180

See more details on using hashes here.

File details

Details for the file hcf_downloader-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for hcf_downloader-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3cd6b6180ec9c1c1258bf1065f1d94659ded8da42fbbdf3dea80099703119bbc
MD5 7e4ca7952cc682f8ae732cfa223ee946
BLAKE2b-256 5c0ab6d037bbed240b1bcc3ae4f564e4ba7fdd0dd986694f349b5dc02fe5b342

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