How does one set a timeout for grabbing the description of the video?
YouTube('https://www.youtube.com/watch?v=B4BorKfhjYU')
Don't know if this is related to a connection issue or not, but would be nice to be able to set a timeout so we can close the connection and raise a error.
Suggestion:
YouTube('https://www.youtube.com/watch?v=B4BorKfhjYU', timeout=5)
Is there any news about this?
I'd also like to see this. I've been downloading videos, and sometimes it gets stuck. Right now, it's at 88.0%, but it's been there for nearly 30 minutes. I automate multiple videos in a row, so it prevents all the other videos from downloading. Looking for a timeout fix.
Programmer have been ready urllib2(python2)/urllib(python3) for you. And your python version must more than 2.6
You could change request.py under:
< python directory >/site-packages/pytube
find out 27 line, it is:
response = urlopen(req)
change it to:
response = urlopen(req,timeout=< you want time >)
If your VPN disconnected while your computer are downloading, this might be work.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
Is there any news about this?