Reputation: 105
I've been trying to use the Pytube module and every time I use its Client attribute it keeps coming up 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'
Upvotes: 4
Views: 5391
Reputation: 134038
First of all, the latest version of pytube
(which gets installed with pip install pytube
is today the version 6.1.5; so you should probably be looking at that version's PyPI page instead. The brief documentation on the PyPI page says nothing about the Client
class; instead the main API class is 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())
The "PyTube" documentation at Read the Docs seems to be for a completely unrelated project. As far as I can see, this project is not available on PyPI.
Upvotes: 3
Reputation: 388233
The “PyTube documentation” you are looking at is for the PyTube, a library written by Noah Silas and Kai Powell, available on GitHub. The library hasn’t been updated in 5 years, and with YouTube’s many changes, it’s likely that it will no longer work.
The pytube library available from PyPI is a completely different library written by Nick Ficano and does not really come with a lot of documentation. Instead, the only manual is on the GitHub project page.
Upvotes: 3