之前能用的代码爬取YouTube视频,突然pytube模块不能用了,很惊奇,就用Google搜了一下:最终找到可解决方案:
参考搜索解决问题网址:
https://github.com/nficano/pytube/issues/381
意思就是需要找到报错的extract.py文件,将下面几句注释就可以了。
extract.py文件路径:Python36是我的安装python软件路径。
Python36\site-packages\pytube\extract.py

在这里插入图片描述
主要参考解决方法:

在这里插入图片描述
谷歌自带翻译一下:

在这里插入图片描述
至此问题解决。可以爬取YouTube视频了。