Pytube error: AttributeError: object 'module' does not have attribute 'Client'

I try to use the Pytube module, and every time I use its Client attribute, it continues to appear with the following error:

Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    client = pytube.Client('my-app-identifier')
AttributeError: 'module' object has no attribute 'Client'
+4
source share
2 answers

First of all, the latest version pytube (which is installed with pip install pytube, today is version 6.1.5 , so you should probably look at this PyPI version page. The brief documentation on the PyPI page says nothing about the class Client, instead the main API Class YouTube, as shown in this excerpt:

from pytube import YouTube
yt = YouTube("http://www.youtube.com/watch?v=Ik-RsDGPI5Y")

# Once set, you can see all the codec and quality options YouTube has made
# available for the perticular video by printing videos.

pprint(yt.get_videos())

"PyTube" , , . , PyPI.

+3
+3

Source: https://habr.com/ru/post/1622124/


All Articles