An automated, headless YouTube Uploader

Overview

Logo

MIT License Code style: black
Platform: YouTube Uses Docker Automation supporting Firefox and Chrome
Firefox supported Chrome supported

An automated, headless YouTube Uploader

Authors: Christian C., Moritz M., Luca S.
Related Projects: YouTube Watcher, Twitch Compilation Creator, Neural Networks


About

This project aims to automate the upload process for YouTube Videos. Since videos can only be publicly uploaded through the YouTube Data API by using a Google Workspaces Account (not free!), we decided to create a headless uploader using Selenium and Docker. This approach also bypasses API restrictions (e.g. Rate Limits/Endcards can't be set through the API).

Note: Because the upload process is often updated by Google, the code might not work when you try it! Often, there are only minor changes that have to be made. If you find yourself in this situation, please open an Issue or provide a quick fix in form of a Pull Request to make sure that the codebase stays up to date!

This project is for educational purposes only. Automating video uploads to YouTube with automation software might be against YouTube's Terms of Service. Even though our tests went smoothly, one might encounter problems when using the YouTube Uploader extensively.

Setup

Dockerized Browser

To run the uploader in a headless mode, it needs to connect to a docker container. To test the uploader locally without using docker, this section can be skipped. Otherwise, the docker container can be started by executing the following steps:

  1. Install docker and docker-compose

Note: On Windows and Mac, docker-compose is already installed when installing docker.

  1. Clone/Download this repository
  2. Navigate to the root of the repository
  3. Run docker-compose up to start the docker container (append -d if you want to run it in a detached mode)

Note: Selenium can now connect to the browser via port 4444. In Python the connection can be established with the following command.

driver = webdriver.Remote(
    command_executor="http://127.0.0.1:4444/wd/hub",
    desired_capabilities=DesiredCapabilities.FIREFOX,
)

See main.py for more information.

  1. Continue with the YouTube Uploader Setup

YouTube Uploader

This project requires Poetry to install the required dependencies. Check out this link to install Poetry on your operating system.

Make sure you have installed Python 3.8! Otherwise Step 3 will let you know that you have no compatible Python version installed.

  1. Clone/Download this repository
  2. Navigate to the root of the repository
  3. Run poetry install to create a virtual environment with Poetry
  4. In a browser of your choice, login into the YouTube account that you want to use the uploader with
  5. Use a cookie extraction tool to extract the YouTube cookies into a JSON file (for example EditThisCookie [Chrome] or Cookie Quick Manager [Firefox])

Note: This is required so that the uploader is automatically logged in into the YouTube account using the cookies. Performing a Google login through automated software is extremely hard due to Google's bot detection/Login safety features

  1. Either run the dockerized Browser with docker-compose up, install geckodriver for a local Firefox or ChromeDriver for Chromium. Ensure that geckodriver/ChromeDriver are in a location in your $PATH.
  2. Run poetry run python main.py to run the program. Alternatively you can run poetry shell followed by python main.py. By default this connects to the dockerized Firefox Browser (headless). To automate a different Browser (not-headless) use the --browser [chrome/firefox] command line option.

Note: When using Docker, the video that should be uploaded needs to be in the repository's uploads folder. This is because REPOSITORY_ROOT/uploads/ is mounted to /uploads/ in the Docker container. Therefore, the video_path argument has to be passed in the following format: /uploads/VIDEO_FILE_NAME.xxx

Run Parameters

You can also get these definitions by running main.py --help

usage: main.py [-h] [-B {docker,chrome,firefox}] -l LOGIN_COOKIES [--thumbnail-path THUMBNAIL] -t TITLE -d DESCRIPTION [-g GAME] [-k KIDS] [-ut UPLOAD_TIME] video_path

positional arguments:
  video_path            Path to the video file. When using docker, this path has to be inside the container (default mount is /uploads/).

optional arguments:
  -h, --help            show this help message and exit
  -B {docker,chrome,firefox}, --browser {docker,chrome,firefox}
                        Select the driver/browser to use for executing the script (default: docker).
  -l LOGIN_COOKIES, --login-cookies-path LOGIN_COOKIES
                        A json file that contains the cookies required to sign into YouTube in the target browser.
  --thumbnail-path THUMBNAIL, -T THUMBNAIL
                        Path to the thumbnail file (default: None).
  -t TITLE, --title TITLE
                        This argument declares the title of the uploaded video.
  -d DESCRIPTION, --description DESCRIPTION
                        This argument declares the description of the uploaded video.
  -g GAME, --game GAME  This argument declares the game of the uploaded video (default: None).
  -k KIDS, --kids KIDS  Whether the video is made for kids or not. (default: False)
  -ut UPLOAD_TIME, --upload_time UPLOAD_TIME
                        This argument declares the scheduled upload time (UTC) of the uploaded video. (Example: 2021-04-04T20:00:00)
A Bot Telegram Anti Users Channel to automatic ban users who using channel to send message in group.

Tg_Anti_UsersChannel A Bot Telegram Anti Users Channel to automatic ban users who using channel to send message in group. Features: Automatic ban Whit

idzeroid 6 Dec 26, 2021
This is a telegram bot built using the Oxford Dictionary API

Oxford Dictionaries Telegram Bot This is a telegram bot built using the Oxford Dictionary API Source: Oxford Dictionaries API Documentation Install En

Abhijith N T 2 Mar 18, 2022
gBasic - The easy multiplatform bot

gBasic The easy multiplatform bot gBasic is the module at the core of @GianpiertoldaBot, maintained with 3 for the entire community by the Stockdroid

Stockdroid Fans 5 Nov 03, 2021
Tickergram is a Telegram bot to look up quotes, charts, general market sentiment and more.

Tickergram is a Telegram bot to look up quotes, charts, general market sentiment and more.

Alberto Ortega 25 Nov 26, 2022
Bot Realm of the Mad God Exalt (ROTMG). (Auto_nexus, Auto_HP, Auto_Loot)

Bot_ROTMG Bot Realm of the Mad God Exalt (ROTMG). (Auto_nexus, Auto_HP, Auto_Loot) *Este projeto visa apenas o aprendizado, quem faz mal uso é o único

Guilherme Silva Uchoa 1 Oct 30, 2021
WhatsApp Status Tracker With Python

Warning!! This Repo is Purly educational purpose Don't use this to stalk on others, which is subjective to crime Pre-Req: Telegram bot of your own wit

Vignesh Karunagaran 10 Dec 09, 2022
A bot can play all variants, but standard are abit weak, so if you need strongest you can change fsf instead of stockfish_14_Dev

MAINTAINERS Drdisrespect1 and drrespectable lichess-bot Engine communication code taken from https://github.com/ShailChoksi/lichess-bot by ShailChoksi

RPNS Nimsilu 1 Dec 12, 2021
Bulk convert image types with Python

Bulk Image Converter 🔥 Helper script to convert a folder's worth of images from one filetype to another, and optionally delete originals Use Setup /

1 Nov 13, 2021
FAIR Enough Metrics is an API for various FAIR Metrics Tests, written in python

☑️ FAIR Enough metrics for research FAIR Enough Metrics is an API for various FAIR Metrics Tests, written in python, conforming to the specifications

Maastricht University IDS 3 Jul 06, 2022
A Telegram Userbot to play Audio and Video songs / files in Telegram Voice Chats.

VC UserBot A Telegram Userbot to play Audio and Video songs / files in Telegram Voice Chats. It's made with PyTgCalls and Pyrogram Requirements Python

조던 1 Nov 29, 2021
A pyrogram simple bot for Educational purpose.

A pyrogram simple bot for Educational purpose. To Learn More check at @PyrogramBot or on Documentation Mandatory variables API_ID - Get It From my.tel

SpamShield 10 Dec 06, 2022
A multi-password‌ cracking tool that can help you hack facebook accounts very quickly

FbCracker This is a multi-password‌ cracking tool that can help you hack facebook accounts very quickly. Facebook Hacking Tool Installation On Termux

ReD H4CkeR 9 Nov 16, 2022
Set up recurring buys in Gemini

Overview Set up recurring buys in Gemini. Given some keys (Create API Keys), allows you to configure a recurring buy using the reduced API maker and t

Ahmad Abuomar 3 Jan 06, 2022
Retrieve information from DBLP and update BibTex files automatically

Rebib TLDR: This script retrieves information from DBLP to update your BibTex files. python rebib.py --bibfile xxx.bib It first parses the bib entries

Shangtong Zhang 49 Jan 01, 2023
YouTube bot, this is just my introduction to api and requests, this isn't intended on being an actual view bot.

YouTube bot, this is just my introduction to api and requests, this isn't intended on being an actual view bot.

Aran 2 Jul 25, 2022
Braintree Python library

Braintree Python library The Braintree Python library provides integration access to the Braintree Gateway. TLS 1.2 required The Payment Card Industry

Braintree 230 Dec 18, 2022
Library written in Python that wraps Halo Infinite API.

haloinfinite Library written in Python that wraps Halo Infinite API. Before start It's unofficial, reverse-engineered, neither stable nor production r

Miguel Ferrer 4 Dec 28, 2022
Neofetch/pfetch, but for weather

Wfetch Neofetch/pfetch, but for weather Features Information about the weather outside: Weather condition Temperature Humidity Pressure Wind Sunrise-s

G_cat 72 Nov 18, 2022
Companion "receiver" to matrix-appservice-webhooks for [matrix].

Matrix Webhook Receiver Companion "receiver" to matrix-appservice-webhooks for [matrix]. The purpose of this app is to listen for generic webhook mess

Kim Brose 13 Sep 29, 2022
Export Statistics for a Telegram Group Chat

Telegram Statistics Export Statistics for a Telegram Group Chat How to Run First, in main repo directory, run the following code to add src to your PY

Ali Hejazizo 22 Dec 05, 2022