From 936002297daabce66ff48a2dd4dcf673191e5694 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sat, 7 Nov 2026 18:25:55 +0100 Subject: fix({yt/yt_dlp/match_filters,yt_dlp/options}): Make match_filters actually work --- crates/yt_dlp/src/options.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/yt_dlp/src/options.rs') diff --git a/crates/yt_dlp/src/options.rs b/crates/yt_dlp/src/options.rs index cdbdb45..5fdcb18 100644 --- a/crates/yt_dlp/src/options.rs +++ b/crates/yt_dlp/src/options.rs @@ -12,7 +12,7 @@ use std::sync; use pyo3::{ Bound, IntoPyObjectExt, PyAny, PyResult, Python, intern, - types::{PyAnyMethods, PyCFunction, PyDict, PyList, PyTuple}, + types::{PyAnyMethods, PyCFunction, PyDict, PyTuple}, }; use pyo3_pylogger::setup_logging; @@ -159,13 +159,13 @@ signal.signal(signal.SIGINT, signal.SIG_DFL) }); } - { + if !options.match_filters.is_empty() { // TODO: Make this work with more than one match filter. <2026-11-07> assert_eq!(options.match_filters.len(), 1); opts.set_item( intern!(py, "match_filter"), - pp(py) + options.match_filters[0](py) .wrap_exc(py, "convertion match filter function to python")? .into_bound_py_any(py) .wrap_exc(py, "converting match filter function to any type")?, -- cgit v1.3.1