Unable to download from pytube

Asked 2 years ago, Updated 2 years ago, 19 views

I am a person who writes scripts using pytube and downloads video files from youtube.
I was able to download it smoothly until yesterday, but suddenly I can't.
Try running the script in Pycharm
I got an error message while downloading the video file.
In other words,

yt=YouTube('https://www.youtube.com/watch?**********')

In , create a YouTube object

print(yt.title+' downloading...\n')

displays the title successfully.However,

yt.streams.filter(progressive=True, file_extension='mp4') .order_by('resolution') .desc().first().download(
dl_path

When I got to , the process stopped

AttributeError: 'NoneType' object has no attribute 'span'

The message appears.

Yesterday, I automatically downloaded about 60 programs in a row.
I downloaded about the same number a few days ago.
There was no problem at that time, but
When I try to download it today, I get an error.
Reinstalling pytube will not work.

Actually, I downloaded it using YouTube-dl at first, but

Downloading multiple programs at the same time I switched to pytube because the download speed was extremely slow and the download was no longer meaningful.
On YouTube-dl, I thought it was bad that I tried to download too many at the same time, so I decided not to download multiple at the same time, but to download them one by one automatically.But it turned out like this.

Is there a solution?

I started the program on my own about a year ago.
So I don't know much about it.
Thank you for your guidance.

python

2022-09-30 16:32

1 Answers

If you have changed the code, please try updating the pytube library as the specification of YouTube has been changed and it will no longer work.
If you want to get the latest version, $python-mpip install pytube may not have the latest version applied yet, so it is recommended that you update it with the GitHub repository.

$python-mpip install git+https://github.com/pytube/pytube


2022-09-30 16:32

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.