Skip to main content
Module

x/youtube_sr/mod.ts>default

Simple library for Node, Deno & Bun to make YouTube search easily
Go to Latest
class default
import { default } from "https://deno.land/x/youtube_sr@v4.3.0/mod.ts";

Constructors

new
private
default()

Static Properties

readonly
Regex

Static Methods

Attempts to parse INNERTUBE_API_KEY

getPlaylist(url: string, options?: PlaylistOptions): Promise<Playlist>

Returns playlist details

getSuggestions(query: string)
getVideo(url: string | Video, requestOptions?: RequestInit): Promise<Video>

Returns basic video info

homepage(): Promise<Video[]>

Fetches homepage videos

isPlaylist(src: string)
search(query: string, options?: SearchOptions & { type: "video"; }): Promise<Video[]>

Search

search(query: string, options?: SearchOptions & { type: "film"; }): Promise<Video[]>
search(query: string, options?: SearchOptions & { type: "channel"; }): Promise<Channel[]>
search(query: string, options?: SearchOptions & { type: "playlist"; }): Promise<Playlist[]>
search(query: string, options?: SearchOptions & { type: "all"; }): Promise<(Video | Channel | Playlist)[]>
searchOne(
query: string,
type?: "video",
safeSearch?: boolean,
requestOptions?: RequestInit,
): Promise<Video>

Search one

searchOne(
query: string,
type?: "film",
safeSearch?: boolean,
requestOptions?: RequestInit,
): Promise<Video>
searchOne(
query: string,
type?: "channel",
safeSearch?: boolean,
requestOptions?: RequestInit,
): Promise<Channel>
searchOne(
query: string,
type?: "playlist",
safeSearch?: boolean,
requestOptions?: RequestInit,
): Promise<Playlist>
validate(url: string, type?:
| "VIDEO"
| "VIDEO_ID"
| "PLAYLIST"
| "PLAYLIST_ID"
): boolean

Validates playlist