Skip to content

Commit

Permalink
chore: sanitize url at playdl validate method
Browse files Browse the repository at this point in the history
  • Loading branch information
ikariwill committed Sep 16, 2023
1 parent 838fc8e commit fc7837d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/sources/play-dl-source/play-dl-source.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -90,7 +91,9 @@ export class PlayDlSourceStream implements SourceStream {
}

async validate(input: string): Promise<boolean> {
const validatedStreamUrl = (await validateStreamUrl(input)) as string;
const validatedStreamUrl = (await validateStreamUrl(
sanitizeUrl(input)
)) as string;

this.streamType = validatedStreamUrl;

Expand Down

0 comments on commit fc7837d

Please sign in to comment.