I have attempted to debug it using pdb from the error message, I can see that the problem closest to my problem occurs in audiowriter. This is especially interesting:
File "D:\Python37\lib\site-packages\moviepy\audio\io\ffmpeg_audiowriter.py", line 121, in close self.proc.stdin.close() OSError: [Errno 22] Invalid argument https://youtube.com/watch?v=pc0mxOXbWIU
It seems to me that it's telling me it can't save the url as a file but it didn't attempt to do that until the 59th itteration
HOWEVER the function that looks like this
def Youtube_playlist_downloader():
import pytube
playlist = pytube.Playlist(input("input playlist url here (note if it is a irl with &index=number at the end that's a song url not a playlist url):"))#note playlist is a list of urls
num = 0
for v in playlist.videos:
print(v.watch_url)
Video = pytube.YouTube(v.watch_url)
Video_v = Video.streams.get_lowest_resolution()
Name = Video_v.default_filename
try:
Video_v.download("./videos")
except:
print("Failed to download" + Name[:-3])
num += 1
try:
audio = mp.VideoFileClip(r"./videos/" + Name)
audio.audio.write_audiofile(r"./audio/" + Name[:-3] + Audio_type)
except:
print("Failed to extract audio from" + Name[:-3])
Choice_choosing()
DOESN'T tell it to save as a url so i'm not certain why this is happening, there's no reason why i can't do something like this then loop over every file in the folder but I want to understand why this happens and have the options to play songs while waiting for the rest to download (not that i've attempted this)
Here is the full code if it helps thank you for any help in advance