Here is the code:
import pytube as p
video_url = input("Enter the link: ")
youtube = p.YouTube(video_url)
filters = youtube.streams.filter(progressive=True, file_extension="mp4")
filters.get_highest_resolution().download("MyPath")
I tried to write a code to download a YouTube video. But it's throwing an error saying:
AttributeError: partially initialized module 'pytube' has no attribute 'YouTube' (most likely due to a circular import)`
I even copy-pasted codes from the internet, re-installed Python, and re-installed pytube but none worked. What's even more frustrating is, that it was working fine when I executed it a few months before.