Skip to main content
Glama
types.ts1.57 kB
export interface VideoMetadata { title: string; author: string; lengthSeconds: number; viewCount: number; description: string; } export interface TranscriptSegment { start: number; text: string; } export interface Transcript { text: string; segments: TranscriptSegment[]; } export interface VideoInfoResponse { metadata: VideoMetadata; transcript: Transcript | null; error?: string; } export interface CaptionTrack { baseUrl: string; name?: { simpleText?: string }; languageCode?: string; kind?: string; isTranslatable?: boolean; } export interface YouTubePlayerResponse { videoDetails?: { videoId?: string; title?: string; lengthSeconds?: string; keywords?: string[]; channelId?: string; shortDescription?: string; viewCount?: string; author?: string; }; captions?: { playerCaptionsTracklistRenderer?: { captionTracks?: CaptionTrack[]; }; }; playabilityStatus?: { status?: string; reason?: string; }; } export type YouTubeErrorCode = | 'INVALID_ID' | 'NOT_FOUND' | 'PRIVATE' | 'AGE_RESTRICTED' | 'REGION_BLOCKED' | 'NO_TRANSCRIPT' | 'PARSE_ERROR' | 'NETWORK_ERROR' | 'RATE_LIMITED' | 'TIMEOUT'; export class YouTubeError extends Error { constructor( message: string, public code: YouTubeErrorCode, public details?: any ) { super(message); this.name = 'YouTubeError'; } static isRetryable(error: YouTubeError): boolean { return ['NETWORK_ERROR', 'RATE_LIMITED', 'TIMEOUT'].includes(error.code); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Limecooler/yt-video-info'

If you have feedback or need assistance with the MCP directory API, please join our Discord server