Why do I get HTTP error 410 when trying to download YouTube videos with pytube?

Solution 1:

There is a bug in pytube3 that results in the 410 error. There is a fix linked from that issue that appears to resolve the problem. If I install the patched version:

pip install git+https://github.com/Zeecka/pytube@fix_1060#egg=pytube

Then I can fetch information about youtube videos without that error:

>>> import pytube
>>> yt = pytube.YouTube('https://www.youtube.com/watch?v=DkU9WFj8sYo')
>>> yt.title
'Space Ranger Video Game using FXGL and JavaFX'

The fix has been submitted as a pull request. Reading through the discussion it looks like there may still be some unresolved issues.