Обновить API wiki на русский

2026-05-27 14:55:52 +00:00
parent 9719c5e4cb
commit ff04cf8ac3
+23 -23
@@ -1,8 +1,8 @@
# API
## Exported objects
## Экспортируемые объекты
The package exports:
Пакет экспортирует:
- `download`
- `download_short`
@@ -24,15 +24,15 @@ from yt_shorts_downloader import download
video = download(url, session_path)
```
Behavior:
Поведение:
- validates the YouTube URL
- validates the cookie file
- downloads into a temporary directory
- ensures the final file is MP4
- returns a `DownloadedVideo`
- валидирует YouTube URL
- валидирует cookie-файл
- скачивает видео во временную директорию
- убеждается, что итоговый файл является MP4
- возвращает `DownloadedVideo`
`DownloadedVideo` fields:
Поля `DownloadedVideo`:
- `filename`
- `content`
@@ -40,7 +40,7 @@ Behavior:
## download_short
Alias for `download`.
Алиас для `download`.
## download_to_path
@@ -50,11 +50,11 @@ from yt_shorts_downloader import download_to_path
path = download_to_path(url, session_path, output_dir='downloads')
```
Behavior:
Поведение:
- validates the URL and session file
- downloads directly into the target output directory
- returns the saved file path
- валидирует URL и session file
- скачивает MP4 прямо в целевую директорию
- возвращает итоговый путь к файлу
## validate_session_file
@@ -65,7 +65,7 @@ from yt_shorts_downloader import validate_session_file
result = validate_session_file(Path('cookies.txt'))
```
`SessionValidation` fields:
Поля `SessionValidation`:
- `exists`
- `structurally_valid`
@@ -73,14 +73,14 @@ result = validate_session_file(Path('cookies.txt'))
- `is_usable`
- `message`
## Exceptions
## Исключения
- `InvalidUrlError`: unsupported or malformed URL
- `InvalidSessionError`: invalid or stale cookie file
- `JsRuntimeUnavailableError`: Deno or Node.js 22+ not found
- `VideoDownloadError`: yt-dlp failed or did not produce MP4
- `YtShortsDownloaderError`: base package exception
- `InvalidUrlError`: неподдерживаемая или некорректная ссылка
- `InvalidSessionError`: невалидный или устаревший cookie-файл
- `JsRuntimeUnavailableError`: не найден Deno или Node.js 22+
- `VideoDownloadError`: yt-dlp не смог получить MP4
- `YtShortsDownloaderError`: базовое исключение библиотеки
## Notes
## Замечание
The public API is designed so that server-side integrations can immediately return MP4 bytes without managing temporary files themselves.
Публичный API специально устроен так, чтобы серверная интеграция могла сразу вернуть MP4-байты клиенту без управления временными файлами на своей стороне.