Uploading YouTube video using a Telegram bot is a easy way to share your content. However, to upload videos, you need to create Google project with YouTube API V3 upload permission. In this article i will show you how to do this
To upload facebook videos using telegram bot click here
To upload files to google drive using telegram bot click here
Available Commands
- /yupload <reply to a file / direct URL> title=my title;tags=tag1,tag2;status=public;description=hello - upload videos to your youtube
- /ylogin - login to your youtube account
- /reylogin - relogin youtube account
- /reyauth - reauth your expired token
Important Notes
0:22 - your project must be 1 week old to upload public videos or verify your app 1:55 - Add upload scope to your app 2:06 - you must add your Youtube account"s email that you want to upload otherwise you will get 403-permission denied error 3:28 - Verify your Youtube account with phone number to upload big videos
Youtube Limits
- new youtube accounts can upload only 10 videos per day
- you can upload only 6 videos ( any size) per day using one project however you can create many projects
- unverified apps token expired after one week you need to re-auth every week
Steps
- create a new google project
- enable youtube data api v3
- Setup OAuth consent screen
- Create client id , client sercet
- Login with bot
- Upload videos
how to create a new google project?
To create a new Google project, log in to the Google Cloud Console and click on the project drop-down menu in the top bar. From there, select "New Project." Give your project a name, select an organization if applicable, and choose a billing account if you have multiple accounts. Finally, click "Create.How to enable youtube data api v3 in my project?
To enable the YouTube Data API, click on the hamburger menu (three horizontal lines) in the top-left corner of the Console and select APIs & Services > Library. Find the YouTube Data API v3, select it, and click the "Enable" button.Go to app library and search youtube api
After you found enable the youtube data api v3
Setup OAuth consent screen with youtube data api v3
- To create an OAuth Consent Screen, navigate to the Google Cloud Console and click on the hamburger menu. Select APIs & Services > OAuth consent screen. Follow the video and add the upload scope and your YouTube email.
first go to auth consent screen and select external and create app
After click add or remove scope and add youtube data api upload scope and press save and continue
Add your youtube email as test user and press save and continue
Create client id , client sercet
go to credentials > create credentials > Create OAuth client ID
Now you got your client id , client secret
How to login with bot with your client id , client secret
type /ylogin to bot bot will ask your client id and client secret
Thats all now you successfully logged with bot
How to upload videos using this bot
type /yupload <reply to a file or direct url> to upload your file to youtube
Now you can upload Youtube videos using telegram bot easily using this guide! if you have any doubts watch youtube video or ask in comment