1 unstable release
Uses new Rust 2024
| 0.12.0 | Jun 12, 2025 |
|---|
#364 in Video
Used in ytdlr
170KB
4K
SLoC
libYTDLR
A library to interact with youtube-dl / yt-dlp from rust, with custom archive support.
This library is mainly made for ytdlr binary, but can also be consumed standalone.
For build / run requirements please see the project README.
Functions provided
download
The main functionality: interacting with yt-dlp; downloading actual media.
Small example:
libytdlr::main::download::download_single(connection, &options, progress_callback, &mut result_vec)?;
For a full example see examples/simple.
rethumbnail
Extra functionality to re-apply a thumbnail to a video or audio container:
Small example:
libytdlr::main::rethumbnail::re_thumbnail_with_tmp(&media_path, &image_path, &output_path)?;
For a full example see `examples/rehtumbnail.
archive interaction
The custom archive libytdlr uses is based on SQLite and provides full read & write ability.
It is recommended to only do reads from outside functions.
The main function that will be necessary to be called to make use of the archive is:
libytdlr::main::sql_utils::migrate_and_connect(&database_path, progress_callback)?;
// or without any format migration:
libytdlr::main::sql_utils::sqlite_connect(&database_path)?;
Dependencies
~30–48MB
~758K SLoC