【问题标题】:pytube-Youtube function not initializingpytube-Youtube 函数未初始化
【发布时间】:2018-11-25 22:57:39
【问题描述】:

我安装了pytube,运行它时出现错误(我使用的是python 3.7),问题似乎出在pytube 本身,我正在使用该模块的确切教程代码。

import pytube

link ='https://www.youtube.com/watch?v=9bZkp7q19f0'
yt = pytube.YouTube(link)
stream = yt.streams.first()
finished = stream.download()
print('Download is complete')


Traceback (most recent call last):
  File "C:\automate the boring stuff\youtubetry.py", line 6, in <module>
    yt = pytube.YouTube(link)
  File "C:\Users\diodi\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pytube\__main__.py", line 88, in __init__
    self.prefetch_init()


[Finished in 6.0s with exit code 1]

【问题讨论】:

    标签: python python-3.x youtube


    【解决方案1】:

    上周我遇到了这个问题。由于我在 Ubuntu 上,对我有用的是导航到:

    /home/<username>/anaconda3/lib/python3.6/site-packages/pytube
    

    并添加

    r'\bc\s*&&\s*d\.set\([^,]+,.*?\((?P<sig>[a-zA-Z0-9$]+)\(\(0\s*,\s*window.decodeURIComponent'
    

    cipher.py 中的get_initial_function_name() 函数中的模式列表。 this Github thread 中进一步讨论了该错误。

    【讨论】:

    • @timmy 我没有写答案,只是编辑让它看起来更好
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-09-23
    • 2021-07-08
    • 2014-05-19
    • 2011-01-02
    • 1970-01-01
    • 2019-03-30
    • 1970-01-01
    相关资源
    最近更新 更多