Skip to main content

data_for_seo/entity/serp/youtube/
video_subtitles.rs

1use serde::{Deserialize, Serialize};
2
3/// YouTube video-subtitles advanced result object.
4/// See <https://docs.dataforseo.com/v3/serp/youtube/video_subtitles/task_get/advanced/>.
5#[derive(Debug, Default, Serialize, Deserialize, Clone)]
6pub struct SerpApiYoutubeVideoSubtitlesTaskAdvanced {
7    /// YouTube video identifier.
8    pub video_id: Option<String>,
9    /// Title of the result.
10    pub title: Option<String>,
11    /// Language code of the original subtitles.
12    pub origin_language: Option<String>,
13    /// Language code the subtitles were translated to.
14    pub translate_language: Option<String>,
15    /// `true` if the requested subtitle language is unsupported.
16    pub unsupported_language: Option<bool>,
17    /// Number of subtitle lines returned.
18    pub subtitles_count: Option<i64>,
19    /// Number of items returned in this result.
20    pub items_count: Option<i64>,
21    /// Parsed elements of the result.
22    pub items: Option<Vec<SerpApiElementYoutubeSubtitles>>,
23}
24
25/// `youtube_subtitles` item: one caption line with its timing.
26#[derive(Debug, Default, Serialize, Deserialize, Clone)]
27pub struct SerpApiElementYoutubeSubtitles {
28    /// Element type as reported by the DataForSEO API.
29    #[serde(rename = "type")]
30    pub type_of_element: Option<String>,
31    /// Rank of the element among elements of the same type.
32    pub rank_group: Option<i64>,
33    /// Absolute rank of the element across the whole SERP.
34    pub rank_absolute: Option<i64>,
35    /// Text content.
36    pub text: Option<String>,
37    /// Start time in seconds.
38    pub start_time: Option<f64>,
39    /// End time in seconds.
40    pub end_time: Option<f64>,
41    /// Duration as a formatted string.
42    pub duration_time: Option<f64>,
43}