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


Bot link: @youtube_apiv3_bot



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

  1. create a new google project
  2. enable youtube data api v3
  3. Setup OAuth consent screen
  4. Create client id , client sercet
  5. Login with bot
  6. 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.


First go to Google Cloud api and select project > create new project




use any name and create a project


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




Then add app name , user support email , Developer contact information and save






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



Check your summery and make sure its like this



Create client id , client sercet

To create credentials, navigate to the Google Cloud Console and click on the hamburger menu. Select APIs & Services > Credentials and then click the "Create credentials" button. Choose "OAuth client ID." You will then be asked to configure the consent screen. Select desktop app and fill in the required information and click "Create."

go to  credentials > create credentials > Create OAuth client ID



select application type desktop app and create

After created click download icon to get your client id , client secret ( do not share these values with others like this)



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

now login with youtube account that you add as test user and enter your code




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