1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
//! # yt-transcript-rs
//!
//! A Rust library for fetching YouTube video transcripts and metadata.
//!
//! This library provides a robust, feature-rich interface for retrieving transcripts
//! from YouTube videos. It can fetch transcripts in various languages, auto-generated
//! captions, and detailed video metadata, all without using YouTube's official API
//! (which doesn't provide transcript access).
//!
//! ## Key Features
//!
//! - **Transcript Retrieval**: Fetch transcripts in any available language
//! - **Multi-language Support**: Request transcripts in order of language preference
//! - **Transcript Translation**: Translate transcripts to different languages
//! - **Formatting Preservation**: Option to keep HTML formatting in transcripts
//! - **Video Metadata**: Retrieve detailed information about videos (title, author, etc.)
//! - **Advanced Authentication**: Support for cookies to access restricted content
//! - **Proxy Support**: Route requests through proxies to bypass geo-restrictions
//!
//! ## Simple Usage Example
//!
//! ```rust,no_run
//! use yt_transcript_rs::YouTubeTranscriptApi;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Create a new API instance
//! let api = YouTubeTranscriptApi::new(None, None, None)?;
//!
//! // Fetch an English transcript
//! let transcript = api.fetch_transcript(
//! "dQw4w9WgXcQ", // Video ID
//! &["en"], // Preferred languages
//! false // Don't preserve formatting
//! ).await?;
//!
//! // Print the full transcript text
//! println!("Transcript: {}", transcript.text());
//!
//! // Or work with individual snippets
//! for snippet in transcript.parts() {
//! println!("[{:.1}s]: {}", snippet.start, snippet.text);
//! }
//!
//! Ok(())
//! }
//! ```
//!
//! ## Advanced Use Cases
//!
//! ### Language Preferences
//!
//! ```rust,no_run
//! # use yt_transcript_rs::YouTubeTranscriptApi;
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! let api = YouTubeTranscriptApi::new(None, None, None)?;
//!
//! // Try English first, then Spanish, then auto-generated
//! let transcript = api.fetch_transcript(
//! "dQw4w9WgXcQ",
//! &["en", "es", "en-US"],
//! false
//! ).await?;
//! # Ok(())
//! # }
//! ```
//!
//! ### List Available Transcripts
//!
//! ```rust,no_run
//! # use yt_transcript_rs::YouTubeTranscriptApi;
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! let api = YouTubeTranscriptApi::new(None, None, None)?;
//!
//! let transcript_list = api.list_transcripts("dQw4w9WgXcQ").await?;
//!
//! for transcript in transcript_list.transcripts() {
//! println!("Language: {} ({}) - {} generated",
//! transcript.language(),
//! transcript.language_code(),
//! if transcript.is_generated() { "Auto" } else { "Manually" });
//! }
//! # Ok(())
//! # }
//! ```
//!
//! ### Fetch Video Details
//!
//! ```rust,no_run
//! # use yt_transcript_rs::YouTubeTranscriptApi;
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! let api = YouTubeTranscriptApi::new(None, None, None)?;
//!
//! let details = api.fetch_video_details("dQw4w9WgXcQ").await?;
//!
//! println!("Title: {}", details.title);
//! println!("Author: {}", details.author);
//! println!("Views: {}", details.view_count);
//! # Ok(())
//! # }
//! ```
pub use YouTubeTranscriptApi;
pub use CookieJarLoader;
pub use ;
pub use CaptionsExtractor;
pub use FetchedTranscript;
pub use FetchedTranscriptSnippet;
pub use VideoDetails;
pub use VideoInfos;
pub use VideoThumbnail;
pub use ;
pub use ;
pub use PlayabilityAsserter;
pub use StreamingDataExtractor;
pub use Transcript;
pub use TranscriptList;
pub use VideoDetailsExtractor;
pub use YoutubePageFetcher;