Solved — pytube.exceptions.RegexMatchError: __init__: could not find match for ^\w+\W

Code:

from pytube import YouTube

yt = YouTube('https://www.youtube.com/watch?v=aQNrG7ag2G4')
stream = yt.streams.filter(file_extension='mp4')

Error:

Traceback (most recent call last):
File ".\test.py", line 4, in <module>
stream = yt.streams.filter(file_extension='mp4')
File

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Flutter Developer

Flutter Developer

Flutter and Native Android developer