From fcb297027bfb5f1bb97094b23b18522c761106f4 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sat, 14 Dec 2024 12:25:43 +0100 Subject: fix(yt_dlp/wrappers/info_json): Treat `Extractor` and `ExtractorKey` as Strings There are too many possible extractors to mandate hard-coding them in a enumeration. --- crates/yt_dlp/src/wrapper/info_json.rs | 36 ++-------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/crates/yt_dlp/src/wrapper/info_json.rs b/crates/yt_dlp/src/wrapper/info_json.rs index a2a775c..f7ecc17 100644 --- a/crates/yt_dlp/src/wrapper/info_json.rs +++ b/crates/yt_dlp/src/wrapper/info_json.rs @@ -21,6 +21,8 @@ use url::Url; use crate::json_loads_str; type Todo = String; +type Extractor = String; +type ExtractorKey = String; // TODO: Change this to map `_type` to a structure of values, instead of the options <2024-05-27> // And replace all the strings with better types (enums or urls) @@ -333,40 +335,6 @@ pub struct HeatMapEntry { pub value: f64, } -#[derive(Debug, Deserialize, Serialize, PartialEq, PartialOrd, Ord, Eq, Clone, Copy)] -#[serde(deny_unknown_fields)] -pub enum Extractor { - #[serde(alias = "generic")] - Generic, - - #[serde(alias = "SVTSeries")] - SVTSeries, - #[serde(alias = "SVTPlay")] - SVTPlay, - - #[serde(alias = "youtube")] - YouTube, - #[serde(alias = "youtube:tab")] - YouTubeTab, -} - -#[derive(Debug, Deserialize, Serialize, PartialEq, PartialOrd, Ord, Eq, Clone, Copy)] -#[serde(deny_unknown_fields)] -pub enum ExtractorKey { - #[serde(alias = "Generic")] - Generic, - - #[serde(alias = "SVTSeries")] - SVTSeries, - #[serde(alias = "SVTPlay")] - SVTPlay, - - #[serde(alias = "Youtube")] - YouTube, - #[serde(alias = "YoutubeTab")] - YouTubeTab, -} - #[derive(Debug, Deserialize, Serialize, PartialEq, PartialOrd, Ord, Eq, Clone, Copy)] #[serde(deny_unknown_fields)] pub enum InfoType { -- cgit 1.4.1