filmaffinity-api-unofficial
Version:
A TypeScript library to scrape movie information from Filmaffinity
36 lines (35 loc) • 1.29 kB
TypeScript
import { MovieInfo, TrailerInfo, MovieSearchResult, Language } from "./types";
export declare class FilmaffinityScraper {
private language;
private baseUrl;
constructor(language?: Language);
/**
* Set the language for the scraper
* @param language - The language to use ('es' for Spanish, 'en' for English)
*/
setLanguage(language: Language): void;
/**
* Get the current language setting
* @returns The current language
*/
getLanguage(): Language;
/**
* Get detailed information about a movie from its Filmaffinity URL
* @param url - The Filmaffinity movie URL
* @returns Promise with movie information or null if an error occurs
*/
getMovie(url: string): Promise<MovieInfo | null>;
/**
* Get trailers information from a movie's trailer page
* @param trailersUrl - The URL of the trailers page
* @returns Promise with array of trailer objects or null if an error occurs
*/
getTrailers(trailersUrl: string): Promise<TrailerInfo[] | null>;
/**
* Search for movies by title
* @param query - The search query
* @returns Promise with an array of search results
*/
searchMovies(query: string): Promise<MovieSearchResult[]>;
}
export * from './types';