Metadata-Version: 2.4
Name: tiktok-autoreup-core
Version: 0.1.4
Summary: Core auto-reup logic for TikTok bots (DB + fetch + auto monitor + auto reup)
Author: ngdnguyen
License: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: yt-dlp>=2024.01.01
Requires-Dist: selenium>=4.0.0

# tiktok-autoreup-core

Core auto-reup logic for TikTok bots:
- SQLite DB for tracked videos/channels
- Fetch latest videos via `yt-dlp`
- Auto-monitor loop
- Auto reup pipeline (download -> render -> upload)

This package is designed to be embedded into a Telegram bot. It expects the host app to provide dependency callbacks (download/render/upload/caption).
Wheels produced by the build scripts are compiled-only and strip all `.py` files, so import from the submodule (see below).

## Basic Usage

```python
from tiktok_autoreup_core.core import AutoReupConfig, AutoReupDeps, AutoReupService

cfg = AutoReupConfig(
    db_path="auto_reup.db",
    output_dir=".",
    owner_id=123456789,
    default_hashtag="#example",
    render_res="1080x1920",
    render_fps=60,
)

deps = AutoReupDeps(
    load_user_data=load_user_data,
    account_cookie_path=account_cookie_path,
    download_video=download_video_ytdlp_subprocess,
    render_video=render_video_ffmpeg,
    upload_video=upload_video_to_tiktok,
    generate_caption=generate_caption,
    animated_progress=animated_progress,
)

svc = AutoReupService(cfg, deps)
svc.init_db()
```

## Build Nuitka (Windows)

```powershell
scripts\\build_nuitka.ps1
```

## Build Nuitka (Linux)

```bash
scripts/build_nuitka.sh
```

## Publish to PyPI

```bash
python -m pip install -U twine
python -m twine upload dist/*
```
