mirror of
https://github.com/YuzuZensai/play-dl-test.git
synced 2026-01-31 14:58:05 +00:00
Add option to unblur thumbnails in YouTube search results
This commit is contained in:
@@ -67,6 +67,11 @@ interface SearchOptions {
|
||||
};
|
||||
fuzzy?: boolean;
|
||||
language?: string;
|
||||
/**
|
||||
* !!! Before enabling this for public servers, please consider using Discord features like NSFW channels as not everyone in your server wants to see NSFW images. !!!
|
||||
* Unblurred images will likely have different dimensions than specified in the {@link YouTubeThumbnail} objects.
|
||||
*/
|
||||
unblurNSFWThumbnails?: boolean;
|
||||
}
|
||||
|
||||
import { createInterface } from 'node:readline';
|
||||
@@ -184,6 +189,9 @@ async function search(query: string, options?: SearchOptions): Promise<YouTubeVi
|
||||
*
|
||||
* - `number` limit : No of searches you want to have.
|
||||
* - `string` language : Sets language of searched content [ YouTube search only. ], e.g. "en-US"
|
||||
* - `boolean` unblurNSFWThumbnails : Unblurs NSFW thumbnails. Defaults to `false` [ YouTube search only. ]
|
||||
* !!! Before enabling this for public servers, please consider using Discord features like NSFW channels as not everyone in your server wants to see NSFW images. !!!
|
||||
* Unblurred images will likely have different dimensions than specified in the {@link YouTubeThumbnail} objects.
|
||||
* - `boolean` fuzzy : Whether the search should be fuzzy or only return exact matches. Defaults to `true`. [ for `Deezer` Only ]
|
||||
* - `Object` source : Contains type of source and type of result you want to have
|
||||
* ```ts
|
||||
@@ -204,7 +212,8 @@ async function search(
|
||||
return await yt_search(query, {
|
||||
limit: options.limit,
|
||||
type: options.source.youtube,
|
||||
language: options.language
|
||||
language: options.language,
|
||||
unblurNSFWThumbnails: options.unblurNSFWThumbnails
|
||||
});
|
||||
else if (options.source.spotify) return await sp_search(query, options.source.spotify, options.limit);
|
||||
else if (options.source.soundcloud) return await so_search(query, options.source.soundcloud, options.limit);
|
||||
|
||||
Reference in New Issue
Block a user