UNPKG

@kevinwatt/yt-dlp-mcp

Version:

An MCP server implementation that integrates with yt-dlp, providing video and audio content download capabilities (e.g. YouTube, Facebook, Tiktok, etc.) for LLMs.

75 lines (74 loc) 2.41 kB
export interface Comment { id?: string; text?: string; author?: string; author_id?: string; author_url?: string; author_is_uploader?: boolean; author_is_verified?: boolean; like_count?: number; is_pinned?: boolean; is_favorited?: boolean; parent?: string; timestamp?: number; time_text?: string | null; [key: string]: unknown; } export interface NormalizedComment extends Comment { id: string; parent: string; time_text: string | null; depth: number; reply_count: number; } export interface ThreadedComment extends NormalizedComment { replies: ThreadedComment[]; } export interface CommentsResponseBase<TComment> { count: number; has_more: boolean; root_threads: number; reply_comments: number; orphan_comments: number; comments: TComment[]; _truncated?: boolean; _message?: string; } export type FlatCommentsResponse = CommentsResponseBase<NormalizedComment>; export type ThreadedCommentsResponse = CommentsResponseBase<ThreadedComment>; export type CommentsResponse = FlatCommentsResponse | ThreadedCommentsResponse; export type CommentSortOrder = "top" | "new"; export type CommentView = "flat" | "threaded"; export type CommentResponseFormat = "json" | "markdown_tree"; export interface CommentRequestOptions { maxComments: number; sortOrder: CommentSortOrder; view: CommentView; responseFormat: CommentResponseFormat; maxParents: number; maxReplies: number; maxRepliesPerThread: number; maxDepth: number; } export interface CommentSummaryOptions { maxComments: number; view: CommentView; } export interface CommentSourceInfo { sourceId?: string | null; title?: string | null; sourceUrl?: string | null; extractor?: string | null; rawInfoJsonPath?: string | null; generatedAtUtc?: string; } export interface PreparedComments { detectedCount: number; hasThreading: boolean; flatComments: NormalizedComment[]; threadedComments: ThreadedComment[]; orphanCommentIds: string[]; } export declare function resolveCommentRequestOptions(input: Partial<CommentRequestOptions> & Pick<CommentRequestOptions, "maxComments">): CommentRequestOptions; export declare function buildCommentExtractorArgs(options: CommentRequestOptions): string; export declare function countThreadComments(comment: ThreadedComment): number;