I am trying to download a youtube video using python.Below is my code.But it is giving me ValueError: Attempted relative import in non-package.Can anyone help me solving this issue.I am new to python ...Someone please help
import pafy
url = raw_input("https://www.youtube.com/watch?v=PT2_F-1esPk")
video = pafy.new(url)
t= video.title
r = video.rating
print t
print r
best = video.getbest("mp4")
filename = best.download(quiet = False)