diff --git a/src/sources/play-dl-source/play-dl-source.ts b/src/sources/play-dl-source/play-dl-source.ts index 7dcc514..a924e7f 100644 --- a/src/sources/play-dl-source/play-dl-source.ts +++ b/src/sources/play-dl-source/play-dl-source.ts @@ -1,6 +1,7 @@ import { Readable } from 'node:stream'; import play, { validate as validateStreamUrl, YouTubeVideo } from 'play-dl'; +import { sanitizeUrl } from '@/helpers/helpers'; import { BotError, ERRORS } from '@/shared/errors'; import { @@ -90,7 +91,9 @@ export class PlayDlSourceStream implements SourceStream { } async validate(input: string): Promise { - const validatedStreamUrl = (await validateStreamUrl(input)) as string; + const validatedStreamUrl = (await validateStreamUrl( + sanitizeUrl(input) + )) as string; this.streamType = validatedStreamUrl;