Forums

Pytube - IncompleteRead error with paid PythonAnywhere account.

I am trying to download audio from a YouTube video and get a IncompleteRead error in both my notebooks and a Flask web app trying to do the same thing. I get the error with new videos, trying different streams within a video, etc.

The same notebook and Flask app work just fine locally.

I have a paid account, and think that I have done all I need to to restart web apps, use new consoles, etc. since upgrading, so am a bit stuck.

Please could you share any guidance on what I may have missed that causes this issue and any potential fixes. Many thanks in advance for any help.

What is the actual error? Does the code work in a console?

Hi Glenn, thanks for your answer.

No, exact same issue in the console as in Flask & notebook:

http.client.IncompleteRead: IncompleteRead(2981872 bytes read, 557347 more expected)

Caused by a line downloading a stream using pytube that works locally in Flask, notebooks & on Colab.

Does that provide any more useful information?

That doesn't provide any more information. It just looks like the request is not finishing for some reason. There's no way that I can tell why that might be.

Understood, was more wondering if there were general considerations I may have missed when upgrading to a paid account beyond the ones listed here: https://help.pythonanywhere.com/pages/403ForbiddenError - i.e. "After you upgrade you'll need to kill any old consoles and start new ones to get your new Internet settings. You'll also need to restart any webapps and scheduled tasks."

But having done those things and now being able to download from non-whitelisted accounts, I guess not. I'll go back to the drawing board. Thanks again for your time.