I have a telegram bot that downloads videos from youtube. i have 2 problems.
- I used the pytube library to create the bot. shows age limit error while downloading some videos. How to avoid this. I tried this answers but it didn't work.
- Normal telegram bots cannot send videos larger than 50 mb. For this, you need to create a telegram bot local server and run the bot on this local server. Is there an easier way?
# simple code
# exeption: age restricted
from pytube import YouTube
url='https://www.youtube.com/watch?v=m9ezpAUvMC8&pp=ygUPbG92ZSB5b3VyIHZvaWNl'
yt=YouTube(url,use_oauth=True,allow_oauth_cache=True)
print(yt.age_restricted)
print(yt.streams)
Go to your site-packages: C:\Users\myname\AppData\Local\Programs\Python\Python311\Lib\site-packages\pytube\innertube.py line 223 change
client='ANDROID_MUSIC'toclient='ANDROID'