diff --git a/youtubedownloader/youtubedownloader.py b/youtubedownloader/youtubedownloader.py index c68d84c..514b601 100644 --- a/youtubedownloader/youtubedownloader.py +++ b/youtubedownloader/youtubedownloader.py @@ -65,7 +65,8 @@ class YouTubeDownloader(commands.Cog): def youtube_download(url: str, path: str): """This function does the actual downloading of the YouTube Video.""" yt = YouTube(url=url) - filename = f"{yt.title} ({yt.video_id})" + translation_table = dict.fromkeys(map(ord, r'<>:"/\|?*'), None) + filename = f"{yt.title.translate(translation_table)} ({yt.video_id})" if audio_only: stream = yt.streams.filter(only_audio=True, mime_type='audio/mp4') stream = stream.order_by('abr')