Metadata-Version: 2.4
Name: aio-downloader-cli
Version: 0.1.0
Summary: Downloader wrapper
Author: haonguyenbugs
License: MIT License
        
        Copyright (c) 2026 YourName
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/you/aio-downloader
Project-URL: Repository, https://github.com/you/aio-downloader
Keywords: downloader,tiktok,threads,facebook
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.31.0
Requires-Dist: playwright>=1.40.0
Dynamic: license-file

# aio-downloader

[![PyPI](https://img.shields.io/pypi/v/aio-downloader.svg)](https://pypi.org/project/aio-downloader/)
[![Python](https://img.shields.io/pypi/pyversions/aio-downloader.svg)](https://pypi.org/project/aio-downloader/)
[![License](https://img.shields.io/pypi/l/aio-downloader.svg)](https://pypi.org/project/aio-downloader/)

`aio-downloader` là thư viện Python để parse URL và tải media trực tiếp từ nhiều nền tảng
## Install

```bash
pip install aio-downloader
playwright install chromium
```

## CLI

```bash
aio-down "URL" -P downloads --all -o "%(title)s_%(idx)s.%(ext)s"
```

### Options (tóm tắt)

- `-P, --paths`: thư mục lưu
- `-o, --outtmpl`: output template
- `--all`: tải tất cả media
- `--headful`: mở browser UI
- `--no-unlock`: tắt unlock
- `--timeout`: timeout giây
- `--write-json`: ghi JSON cạnh file
- `--quiet`: tắt progress

## Library

```py
from aio_downloader import DownloadWorker

w = DownloadWorker(allMedias=True, outtmpl="%(title)s_%(idx)s.%(ext)s")
res = w.DownloadSync("URL", "downloads")
print(res.paths)
```

## Progress Hooks

Hook nhận dict trạng thái.

```py
from aio_downloader import DownloadWorker

def Hook(d):
    if d["status"] == "downloading":
        print(d["filename"], d.get("downloaded_bytes"), d.get("total_bytes"))
    elif d["status"] == "finished":
        print("done", d["filename"])

w = DownloadWorker(progressHooks=[Hook])
w.DownloadSync("URL", "downloads")
```

## Docs

- [CLI](docs/cli.md)
- [Output Template](docs/template.md)
- [JSON Response](docs/response.md)
- [Library API](docs/library.md)
- [Publish](docs/publish.md)

## License

MIT
