JuanBindez / pytubefix

Python3 library for downloading YouTube Videos.
http://pytubefix.rtfd.io/
MIT License
454 stars 67 forks source link

Added bot detection exception #170

Closed felipeucelli closed 1 month ago

felipeucelli commented 1 month ago

Added bot detection exception #157 #161 #166

YouTube is working tirelessly to prevent ad blockers and third-party applications, so it may require a captcha to access the streams.

Most reports are from known VPN users, see more at #119, yt-dlp, TeamNewPipe.

As this can occur even on official clients, there is no sure way to prevent this from happening, so we will have to log in using oauth or try to change IP.

Changes

This PR adds an exception class that checks captcha detection and asks the user to try again or log in.

The LoginRequired class receives the reason parameter to facilitate debugging new errors.