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)
Telegram bot to stream videos in telegram voicechat for both groups and channels

Telegram bot to stream videos in telegram voicechat for both groups and channels. Supports live streams, YouTube videos and telegram media. With record stream support, Schedule streams, and many more

ALBY 9 Feb 20, 2022
Stinky ID - A stable pluggable Telegram userbot + Voice & Video Call music bot, based on Telethon

Ultroid - UserBot A stable pluggable Telegram userbot + Voice & Video Call music

Riyan.rz 1 Jan 03, 2022
A cut down version of QUANT containing just the model in Python (QUANTPy)

A cut down version of QUANT containing just the model in Python (QUANTPy)

2 Apr 15, 2022
Reddit cli to slack at work

Reddit CLI (v1.0) Introduction Why Reddit CLI? Coworker who sees me looking at something in a browser: "Glad you're not busy; I need you to do this, t

3 Jun 22, 2021
Embed the Duktape JS interpreter in Python

Introduction Pyduktape is a python wrapper around Duktape, an embeddable Javascript interpreter. On top of the interpreter wrapper, pyduktape offers e

Stefano 78 Dec 15, 2022
The Python client library for the Tuneup Technology App.

Tuneup Technology App Python Client Library The Python client library for the Tuneup Technology App. This library allows you to interact with the cust

Tuneup Technology 0 Jun 29, 2022
🔪 Block replies to viral tweets from users getting paid to promote useless products

This Tweet Took Off Ublock Origin filter list targeting long reply chains posted by twitter users who get paid to promote random products on viral twe

Xetera 12 Jan 14, 2022
Discord bot do sprawdzania ceny pizzy.

Discord bot do sprawdzania ceny pizzy w pizzeri Bombola. Umieszczony jest na platformie Heroku, dzięki czemu działa 24/7. Commands List Info: Jako com

1 Sep 18, 2021
A python wrapper for the mangadex API V5. Work in progress

mangadex A python wrapper for the mangadex API V5. It uses the requests library and all the aditional arguments can be viewed in the Official Mangadex

Eduardo Ceja 27 Dec 14, 2022
This is simply code for bitcoin fair value.

About The Project This is a code for bitcoin fair value, its simply exclude bubble data using RANSAC method, and then plot the results. Check youtube

BitcoinRaven 4 Mar 26, 2022
This asynchronous telegram bot sells books.

Selling_Books_Bot Description Say, you have a bunch of items you need no more and you want to sell it all out. That's where you're going to have to us

Roman 1 Oct 24, 2021
Python 3 SDK/Wrapper for Huobi Crypto Exchange Api

This packages intents to be an idiomatic PythonApi wrapper for https://www.huobi.com/ Huobi Api Doc: https://huobiapi.github.io/docs Showcase TODO Con

3 Jul 28, 2022
Automation for grabbing keys from a Linux host. Useful during red team exercises to quickly help assess what access to a Linux host can lead to.

keygrabber Automation for grabbing keys from a Linux host. This can be helpful during red team exercises when you gain access to a Linux host and want

Cedric Owens 14 Sep 27, 2022
An open-source Discord bot that alerts your server when it's Funky Monkey Friday!

Funky-Monkey-Friday-Bot An open-source Discord bot that alerts your server when it's Funky Monkey Friday! Add it to your server here! https://discord.

Cole Swinford 0 Nov 10, 2022
A multipurpose Telegram Bot written in Python for mirroring files on the Internet to Google Drive

Mirror Leech Bot Mirror Leech Bot is a multipurpose Telegram Bot written in Python for mirroring files on the Internet to our beloved Google Drive. Ba

1 Jan 01, 2022
Cities bot - A simple example of using aiogram and the wikipedia package

Cities game A simple example of using aiogram and the wikipedia package. The bot

Artem Meller 2 Jan 29, 2022
A Tool to scrape URLs for a given domain from wayback machine, Commoncrawl and OTX Alienvault

Mr_URL Mr.URL fetches known URLs for a given domain from Wayback Machine, Commoncrawl and OTX Alienvault. It also finds old versions of any given URL

Stinger 9 Sep 05, 2022
Centralized whale instance using github actions, sourcing metadata from bigquery-public-data.

Whale Demo Instance: Bigquery Public Data This is a fully-functioning demo instance of the whale data catalog, actively scraping data from Bigquery's

Hyperquery 17 Dec 14, 2022
An example Music Bot written in Disnake and uses slash commands to operate.

Music Bot An example music bot that is written in Disnake [Maintained discord.py Fork] Disnake Disnake is a maintained and updated fork of discord.py.

6 Jan 08, 2022
A Discord bot to combat phishing links for Steam trades and Discord gifts.

delink-bot A Discord bot to combat phishing links for Steam trades and Discord gifts. Requirement python3 -m pip install -U discord.py python3 -m pip

hugonun 15 Dec 09, 2022