pytube: AttributeError: 'NoneType' 对象没有属性 'span' cipher.py

问题描述 投票:0回答:1

昨天这工作正常,今天我在我的本地机器上出现错误,colab notebook,甚至在我的 VPS 上。

/usr/local/lib/python3.9/dist-packages/pytube/cipher.py in get_throttling_plan(js)
    409     match = plan_regex.search(raw_code)
    410 
--> 411     transform_plan_raw = find_object_from_startpoint(raw_code, match.span()[1] - 1)
    412 
    413     # Steps are either c[x](c[y]) or c[x](c[y],c[z])

从 pytube 导入 YouTube def audio_download(video_url): audio_file = YouTube(video_url).streams.filter(only_audio=True).first().download(filename="audio.mp4") 返回“确定”

预计下载音频。 我什至尝试按照其他解决方案中的说明更改 cipher.py 文件,但没有用。

python youtube youtube-dl pytube
1个回答
0
投票

找到解决方案。 cipher.py 第 411 行

transform_plan_raw = find_object_from_startpoint(raw_code, match.span()[1] - 1)

transform_plan_raw = js
© www.soinside.com 2019 - 2024. All rights reserved.