I download and clip some youtube videos with pytube but some videos are not downloading and asking for age verification. How can I solve this? Thanks for your advice
For pytube 15.0.0 I had the AgeRestrictedError in streams contents even using the use_oauth option.
I fixed the problem only replacing ANDROID_MUSIC with ANDROID as "client" at line 223 of innertube.py:
def __init__(self, client='ANDROID_MUSIC', use_oauth=False, allow_cache=True):
def __init__(self, client='ANDROID', use_oauth=False, allow_cache=True):
I fixed the problem by overwriting ANDROID_MUSIC with ANDROID_CREATOR
from pytube import YouTube
from pytube.innertube import _default_clients
_default_clients["ANDROID_MUSIC"] = _default_clients["ANDROID_CREATOR"]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With