Hi I have a problem with AttributeError: 'NoneType' object has no attribute 'span' I read on the StackOverflow a channel with this problem on this I found the potential solution but it still not working here was a advice to change a
this:
152: func_regex = re.compile(r"function\([^)]+\)")
to this
152: func_regex = re.compile(r"function\([^)]?\)")
but it is not working and I do not know how to solute it because A youtube Stil upgrading a platform and this error will be probably in the future too.
So I can Ask is some other method to download a youtube video.
from pytube.__main__ import YouTube
from pytube.streams import Stream
def downloadVideo(link):video = pytube.YouTube(link)video.streams.get_highest_resolution().download()try:os.rename(video.streams.get_highest_resolution().default_filename, word +".mp4")except Exception:print("Expection in renamed file ")
Sorry for the bad indentation but the os.rename ... is too long for write it here