add blocklist config option

This commit is contained in:
yggverse 2025-08-08 20:25:26 +03:00
parent a97afa0434
commit b0b7938471
2 changed files with 5 additions and 0 deletions

View file

@ -12,6 +12,10 @@ pub struct Config {
#[arg(long)] #[arg(long)]
pub infohash: Vec<String>, pub infohash: Vec<String>,
/// Remote address or local path
#[arg(long)]
pub blocklist: Option<Url>,
/// Define custom tracker(s) to preload the `.torrent` files info /// Define custom tracker(s) to preload the `.torrent` files info
#[arg(long)] #[arg(long)]
pub tracker: Vec<Url>, pub tracker: Vec<Url>,

View file

@ -34,6 +34,7 @@ async fn main() -> Result<()> {
preload.root().clone(), preload.root().clone(),
SessionOptions { SessionOptions {
bind_device_name: config.bind, bind_device_name: config.bind,
blocklist_url: config.blocklist.map(|b| b.into()),
listen: match config.listen { listen: match config.listen {
Some(listen_addr) => Some(ListenerOptions { Some(listen_addr) => Some(ListenerOptions {
enable_upnp_port_forwarding: config.listen_upnp, enable_upnp_port_forwarding: config.listen_upnp,