about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-06-24 14:50:07 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-06-24 14:50:07 +0200
commit9b4f09cf736e68bdbd246dca17d7a3c6b8eba3ea (patch)
tree5973ad7a132e56023c69e7faabc99d1daa2817fe
parentfeat(yt/version): Add the (rust)python version again (diff)
downloadyt-9b4f09cf736e68bdbd246dca17d7a3c6b8eba3ea.zip
fix(yt_dlp/post_processors/dearrow): Don't try to access the drained vec
If all titles were declared “bad” the pp previously tried to access the
first title in the array, which was already drained. We now simply clone
the array to facilitate this usage.
Diffstat (limited to '')
-rw-r--r--crates/yt_dlp/src/post_processors/dearrow.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/yt_dlp/src/post_processors/dearrow.rs b/crates/yt_dlp/src/post_processors/dearrow.rs
index ab5478b..3cac745 100644
--- a/crates/yt_dlp/src/post_processors/dearrow.rs
+++ b/crates/yt_dlp/src/post_processors/dearrow.rs
@@ -59,8 +59,9 @@ pub fn unwrapped_process(info: PyRef<PyDict>, vm: &VirtualMachine) -> Result<PyR
     output.titles.reverse();
 
     let title_len = output.titles.len();
+    let mut iterator = output.titles.clone();
     let selected = loop {
-        let Some(title) = output.titles.pop() else {
+        let Some(title) = iterator.pop() else {
             break false;
         };
 
@@ -145,7 +146,7 @@ struct CasualVote {
     title: String,
 }
 
-#[derive(Serialize, Deserialize)]
+#[derive(Serialize, Deserialize, Clone)]
 struct Title {
     /// Note: Titles will sometimes contain > before a word.
     /// This tells the auto-formatter to not format a word.