UNPKG

@phunky/scrape-channel-listings

Version:

A TypeScript library for scraping TV channel listings from various providers

45 lines (44 loc) 1.48 kB
#!/usr/bin/env node /** * Main entry point for the channel listing scraper. * This file exposes both the library API and CLI functionality. */ import { type Channel } from './utils/scraper'; export type { Channel }; export interface ScrapingOptions { writeFiles?: boolean; maxConcurrent?: number; } export interface ScraperResult { name: string; success: boolean; duration: number; channelCount?: number; error?: Error; channels?: Channel[]; } export interface ScrapingSummary { results: ScraperResult[]; totalDuration: number; successRate: string; totalChannels: number; failedScrapers: ScraperResult[]; } export interface ProviderChannels { provider: string; channels: Channel[]; } /** * Scrapes channel listings from all configured providers. * @param options Optional configuration for the scraping process * @returns Promise resolving to either an array of provider channels or a summary object */ export declare function scrapeAllProviders(options?: ScrapingOptions): Promise<ProviderChannels[] | ScrapingSummary>; /** * Scrapes channel listings from a specific provider. * @param providerName Name of the provider to scrape * @param options Optional configuration for the scraping process * @returns Promise resolving to a ScraperResult object * @throws Error if provider is not found */ export declare function scrapeProvider(providerName: string, options?: ScrapingOptions): Promise<ScraperResult>;