ERROR: unable to open for writing: [Errno 13] Permission denied #6274
Unanswered
mrracoonman
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to get my bot to use youtube_dl to download and play a youtube link. Here's what I have:
(I promise everything is properly indented, it just looks strange on here)
@bot.command(pass_context=True, aliases=['p'])
async def play(ctx, url: str):
song_there = os.path.isfile('song.mp3')
try:
if song_there:
os.remove('song.mp3')
print('Removed old song file.')
except PermissionError:
print('Trying to delete song file, but is being played.')
await ctx.send(f'ERROR, Music playing')
return
It works up until about
ydl.download([url])
in which it sends the error:discord.ext.commands.errors.CommandInvokeError: Command raised an exception: DownloadError: ERROR: unable to open for writing: [Errno 13] Permission denied: 'C:\\Users\\User\\Downloads\\mp3 files\\ytdldownloads'
I've tried changing the location it downloads it to, you can see that in the error itself, but it still says it need permission. Does anyone know how to get past that or grant said permission if needed?
Win10, py 3.8.6
Beta Was this translation helpful? Give feedback.
All reactions