about summary refs log tree commit diff stats
path: root/crates
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-03-21 19:41:54 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-03-21 19:41:54 +0100
commit5b5caee512dd82bc5106e69259ba916cd143deda (patch)
tree9f6924a8c1d1057cddfbccb2cafd2e34553ac840 /crates
parentchore(treewide): Migrate to rust edition 2024 (diff)
downloadyt-5b5caee512dd82bc5106e69259ba916cd143deda.zip
refactor(yt_dlp): Remove the unneeded `async` from the public functions
Diffstat (limited to 'crates')
-rw-r--r--crates/yt_dlp/src/lib.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/crates/yt_dlp/src/lib.rs b/crates/yt_dlp/src/lib.rs
index 40610c2..c6d9290 100644
--- a/crates/yt_dlp/src/lib.rs
+++ b/crates/yt_dlp/src/lib.rs
@@ -332,9 +332,8 @@ pub fn add_hooks<'a>(opts: Bound<'a, PyDict>, py: Python<'_>) -> PyResult<Bound<
 ///
 /// It will also download the videos if 'download'.
 /// Returns the resolved `ie_result`.
-#[allow(clippy::unused_async)]
 #[allow(clippy::missing_panics_doc)]
-pub async fn process_ie_result(
+pub fn process_ie_result(
     yt_dlp_opts: &Map<String, Value>,
     ie_result: InfoJson,
     download: bool,
@@ -378,9 +377,8 @@ pub async fn process_ie_result(
 ///
 /// @param `extra_info`   Dictionary containing the extra values to add to the info (For internal use only)
 /// @`force_generic_extractor`  Force using the generic extractor (Deprecated; use `ie_key`='Generic')
-#[allow(clippy::unused_async)]
 #[allow(clippy::missing_panics_doc)]
-pub async fn extract_info(
+pub fn extract_info(
     yt_dlp_opts: &Map<String, Value>,
     url: &Url,
     download: bool,
@@ -460,7 +458,7 @@ pub fn unsmuggle_url(smug_url: &Url) -> PyResult<Url> {
 ///
 /// # Panics
 /// Only if `yt_dlp` changes their `info_json` schema.
-pub async fn download(
+pub fn download(
     urls: &[Url],
     download_options: &Map<String, Value>,
 ) -> Result<Vec<PathBuf>, YtDlpError> {
@@ -468,7 +466,7 @@ pub async fn download(
 
     for url in urls {
         info!("Started downloading url: '{}'", url);
-        let info_json = extract_info(download_options, url, true, true).await?;
+        let info_json = extract_info(download_options, url, true, true)?;
 
         // Try to work around yt-dlp type weirdness
         let result_string = if let Some(filename) = info_json.filename {