YTSync is a lightweight API, equipped with a Telegram Bot, to download audio/video from a URL or playlist and asynchronously transfer it to a remote server via rsync (ssh).
data_dir: Directory to store the database. Defaults to data
logs_dir: Directory to store logs. Defaults to logs
audio_dir: Directory to store audio files. Defaults to audio
video_dir: Directory to store video files. Defaults to video
Note: audio_dir and video_dir are the base directories, under which each profile gets its own subdirectory
For example, if the profile name is profile1, audio files are stored in audio/profile1 and video files are stored in video/profile1
remote_host: Hostname [OR] IP address of the remote server.
remote_user: Username to connect to the remote server.
remote_path: Directory path on the remote server, to transfer downloaded files to.
delete_after_sync: Boolean flag to delete local files after transferring to the remote server.
Note: remote_path is the base directory, under which the local structure is mirrored by profile and media type
For example, if the profile name is profile1, audio files are transferred to remote_user@remote_host:remote_path/audio/profile1 and video files are transferred to remote_user@remote_host:remote_path/video/profile1
Environment variables can be read from a .env or .json file, but docker context only supports .env files.
Profiles are created by default within the chosen audio_dir and video_dir directories.
YTSync does not support concurrent downloads, and will download sequentially to avoid being throttled/blocked by the source server.
YTSync runs on a single process with a single event loop. Blocking operations (metadata lookups, downloads, database I/O) are offloaded to a thread pool via asyncio.to_thread so the server stays responsive, but downloads themselves are still processed one at a time, in order; transfers are submitted as soon as each file finishes downloading.