about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-12-14 12:25:43 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-12-14 12:25:43 +0100
commitfcb297027bfb5f1bb97094b23b18522c761106f4 (patch)
tree89e5a5a892986bd102624b899582d2f7e745e891
parentchore(version): v1.3.3 (diff)
downloadyt-fcb297027bfb5f1bb97094b23b18522c761106f4.tar.gz
yt-fcb297027bfb5f1bb97094b23b18522c761106f4.zip
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.
-rw-r--r--crates/yt_dlp/src/wrapper/info_json.rs36
1 files 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)
@@ -335,40 +337,6 @@ pub struct HeatMapEntry {
 
 #[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 {
     #[serde(alias = "playlist")]
     Playlist,