Skip to content

Commit

Permalink
🩹 Fix wrong link error message
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitryScaletta committed Dec 19, 2023
1 parent 549d4ed commit a45e0cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,10 @@ export class TwitchClipsDownloaderService implements OnModuleDestroy {
}

private getMp4Link(thumbnailUrl: string, quality: '480' | '720' | 'best') {
return quality === 'best'
? thumbnailUrl.replace(THUMBNAIL_REGEX, '.mp4')
: thumbnailUrl.replace(THUMBNAIL_REGEX, `-${quality}.mp4`);
return thumbnailUrl.replace(
THUMBNAIL_REGEX,
quality === 'best' ? '.mp4' : `-${quality}.mp4`,
);
}

getSlug(url: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class TwitchClipsDownloaderUpdate {
this.twitchClipsDownloaderService.logger.log(text);
const slug = this.twitchClipsDownloaderService.getSlug(text);
if (!slug) {
ctx.sendMessage('Error: Wrong link');
if (text.includes('twitch.tv')) ctx.sendMessage('Error: Wrong link');
return;
}
ctx.sendChatAction('upload_video');
Expand Down

0 comments on commit a45e0cb

Please sign in to comment.