Coder Social home page Coder Social logo

utube's Introduction

Simple Telegram Bot to Upload videos to Youtube written in Python3.

Contents

Info

This is a simple hobby project which i was really curious about to impliment. This is a Telegram bot which uses Youtube Data API v3 to upload videos to Youtube. This bot uses OAuth 2.0 to connect to your Youtube Channel.

Libraries Used

Pyrogram

Pyrogram is used to connect the bot with telegram servers.

Google Client API

Google Client API is used to connect the bot with Google and then with Youtube.

Setup

โ— This project requires Python3.7 (as this was written and tested with Python 3.7.3, try and see if it works with other versions)

Clone and setup virtual environment

git clone https://github.com/odysseusmax/utube.git

cd utube

virtualenv .

source bin/activate

Setup config.py

  • Head to Manage Apps and get your API_ID and API_HASH, and save it at the respective positions in config.py

  • Head to Google console, create a new project named Youtube Uploader and enable API'S AND SERVISES. Search for YOUTUBE DATA API v3 and enable the API. Go to Credentials page, select your project Youtube Uploader create a new credential with other as type. Copy the CLIENT_ID and CLIENT_SECRET and paste them to config.py

  • Head to Bot Father, create new bot and paste the bot token to BOT_TOKEN

  • Paste the bot owner's Telegram id to BOT_OWNER and add AUTH_USERS if you need others to use your bot.

  • All the contents of config.py must be kept secret as they contain sensitive informations

Install requirements

With all the above procedures done, its time to install our dependencies. Run :

pip3 install -r requirements.txt

Run bot

Lets run our bot for the first time!

python3 bot.py

If you did everything correctly, the bot should be running. Go do /start to see if the bot is live or not. Follow the instructions provided by bot to setup authorisation and to start uploading.

Or the easy way of directly deploying to heroku

Deploy

Status

This project is actively maintained and will continue so until I'm tired of it.

Special notes

  • With the Youtube Data API you are awarded with 10,000 points of requests. For one video upload it costs 1605 points, regardless of file size, which calculates to about 6 uploads daily. Once you have exhausted your daily points, you have to wait till daily reset. Resets happens at 0:00 PST, i.e. 12:30 IST. So make your uploads count.

  • Uploading copyright contents will leads to immediate blocking of the video, and will not be added to your MyVideos section of youtube. But still the video can be played directly through the link provided by the bot.

  • All the videos are uploaded as private. You may change it after youtube processes the video.

Screenshots

Upload

Contact

Share the FeedBack and Suggestions with me. You can contact me Here

utube's People

Contributors

odysseusmax avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.