From fc7837df970e2b49b8d2909725759e801daa5cbc Mon Sep 17 00:00:00 2001 From: Willian Silva Date: Sat, 16 Sep 2023 14:10:00 -0300 Subject: [PATCH] chore: sanitize url at playdl validate method --- src/sources/play-dl-source/play-dl-source.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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;