Metadata-Version: 2.4
Name: zytools-fs
Version: 0.0.3
Summary: Personal Python utilities for FTP and video downloads
Author: zytools
License-Expression: MIT
Keywords: zytools,ftp,video,download
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: loguru
Requires-Dist: requests
Dynamic: license-file

# zytools-fs

Personal Python utilities for FTP and video downloads.

## Install

```bash
pip install zytools-fs
```

## FTP download

```python
from zytools.utils.ftp import FTPDownloader

with FTPDownloader(host="127.0.0.1", user="user", password="password") as ftp:
    ftp.download("/remote/path", "./downloads")
```

## Bilibili video download

```python
from zytools.video import download_bili_video

download_bili_video(
    "https://www.bilibili.com/video/BVxxxx",
    output_dir="./downloads",
    filename="Bilibili_{BV}_{Date}_{Part}_{Duration}",
)
```

Filename template fields:

- `{Title}`: video title
- `{BV}`: BV id
- `{Date}`: publish date, `YYYYMMDD`
- `{Page}`: page number
- `{Part}`: page number
- `{Duration}`: duration in seconds
- `{PartTitle}`: page title

## Task update

```python
from zytools.utils import TaskUpdater, update_task

update_task(
    name="daily job",
    machine_id="machine-1",
    script_path="/path/to/script.py",
    server="http://127.0.0.1:8000",
)

task = TaskUpdater(
    name="daily job",
    machine_id="machine-1",
    script_path="/path/to/script.py",
)
task.update()
```
