2

After running this:

from pytube import YouTube

yt = YouTube('http://youtube.com/watch?v=2lAe1cqCOXo')
print(yt.title)

python version 3.11.3

I receive this error:

raceback (most recent call last):
  File "C:\Users\jay\PycharmProjects\pythonProject\youtube.py", line 4, in <module>
    print(yt.title)
          ^^^^^^^^
  File "C:\Users\jay\PycharmProjects\pythonProject\venv\Lib\site-packages\pytube\__main__.py", line 346, in title
    raise exceptions.PytubeError(
pytube.exceptions.PytubeError: Exception while accessing title of https://youtube.com/watch?v=2lAe1cqCOXo.

I was expecting to receive a title

Jay
  • 21
  • 3
  • 2
    since yesterday pytube doesn't work at all **__main__.py", line 161, in streaming_data return self.vid_info['streamingData'] KeyError: 'streamingData'** Did YouTube change something? – Module_art Apr 27 '23 at 21:27
  • tnx, what other options do we have? youtube-dl is also not working – Jay Apr 28 '23 at 02:01

3 Answers3

1

According to the solution here

Try going to Pytube/innertube.py in line 78 change client = 'ANDRIOD' to client = 'WEB'

for newbies using linux like me: Pytube is hidden somewhere in /home/user/.local/share/...(virtualenvs depending on your's)

S7bvwqX
  • 147
  • 3
  • 13
0

Try going to Pytube/__main__.py in line 244 change client = 'ANDRIOD' to client = 'WEB'

this worked for me.

Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
krishi
  • 1
  • 2
0

I started using yt-dlp plugin.

Jay
  • 21
  • 3