abot-scraper
Version:
scraper random for downloader and searching
125 lines (107 loc) • 2.87 kB
TypeScript
interface ApiResponse<T = unknown> {
creator: string;
status: number | boolean;
result?: T;
msg?: string;
}
interface FacebookResult {
thumbnail: string;
videoUrl: string;
}
interface TikTokResult {
title: string;
video: string;
audio: string;
}
interface InstagramUserInfo {
username: string;
[key: string]: unknown;
}
interface InstagramStoriesResult {
user_info: InstagramUserInfo;
links: string[];
}
interface InstagramMediaItem {
type: "video" | "image";
url: string;
}
interface SfileSearchResult {
title: string;
size: string;
link: string;
}
interface YtPlayResult {
status: string;
title: string;
ftype: string;
thumb: string;
size_mp3: string;
link: string;
}
interface WallpaperResult {
title: string;
type: string;
source: string;
image: string[];
}
interface WikimediaResult {
title: string;
source: string;
image: string;
}
interface YtSearchResult {
title: string;
thumbnail: string;
url: string;
}
interface YoutubeResult {
title: string;
thumbnail: string;
downloadLinks: Record<string, string>;
mp3DownloadUrl: string;
}
interface YoutubeResultV2 {
title: string;
thumbnail: string | null;
downloadLinks: Record<string, string>;
video: string | null;
audio: string | null;
formats: unknown[];
}
interface SfileDownloadResult {
filename: string;
mimetype: string;
download: string;
}
declare global {
var creator: string;
}
declare class Downloader {
private generator;
constructor();
facebook(url: string): Promise<ApiResponse<FacebookResult>>;
tiktokDownloader(url: string): Promise<ApiResponse<TikTokResult>>;
igstory(username: string): Promise<ApiResponse<InstagramStoriesResult>>;
instagram(url: string): Promise<ApiResponse<InstagramMediaItem[]>>;
youtubeDownloader(url: string): Promise<ApiResponse<YoutubeResult>>;
ytMp3Downloader: (url: string) => Promise<unknown>;
youtubeDownloaderV2(url: string): Promise<ApiResponse<YoutubeResultV2>>;
sfileDownloader(url: string): Promise<ApiResponse<SfileDownloadResult>>;
}
declare global {
var creator: string;
}
declare class Search {
sfileSearch(query: string, page?: number): Promise<ApiResponse<SfileSearchResult[]>>;
ytSearch(query: string): Promise<ApiResponse<YtSearchResult[]>>;
ytPlay: (text: string) => Promise<ApiResponse<YtPlayResult>>;
wallpaper: (title: string, page?: string) => Promise<ApiResponse<WallpaperResult[]>>;
wikimedia: (title: string) => Promise<ApiResponse<WikimediaResult[]>>;
}
declare const downloader: Downloader;
declare const search: Search;
declare const _default: {
downloader: Downloader;
search: Search;
};
export { Downloader, Search, _default as default, downloader, search };