From e935caefdc7bb60c08b91c17f014e216ee3b4061 Mon Sep 17 00:00:00 2001 From: mykola2312 <49044616+mykola2312@users.noreply.github.com> Date: Mon, 19 Feb 2024 11:44:55 +0200 Subject: [PATCH] add yt-dlp json struct deserializers --- src/dl/yt_dlp.rs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/dl/yt_dlp.rs b/src/dl/yt_dlp.rs index 8b13789..2e2e399 100644 --- a/src/dl/yt_dlp.rs +++ b/src/dl/yt_dlp.rs @@ -1 +1,32 @@ +use serde::Deserialize; +use serde_json; +use std::process::Command; +#[derive(Deserialize, Debug)] +pub struct YtDlpFormat { + pub format_id: String, + pub format_note: Option, + pub audio_channels: Option, + pub width: Option, + pub height: Option, + pub ext: String, + pub vcodec: Option, + pub acodec: Option, + pub abr: Option, + pub vbr: Option +} + +#[derive(Deserialize, Debug)] +pub struct YtDlpInfo { + pub id: String, + pub title: String, + pub formats: Vec +} + +pub struct YtDlp {} + +impl YtDlp { + pub fn load_info(url: &str) { + + } +} \ No newline at end of file