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 Git Alert Bot - Github Integration for Pyrogram & Telethon

Yet Another GitAlertBot Inspired From @Pokurt's GitGram Run Bot: Local Host Git Clone Repo : For Telethon Version : git clone https://github.com/DevsE

DevsExpo 23 Oct 21, 2022
Some examples regarding how to use the Twitter APIs for academic research

Twitter Developer Platform: Using Twitter APIs for Academic Research All the scripts require a config.ini file in which the keys are put. There is a t

Federico Bianchi 6 Feb 13, 2022
A Happy and lightweight Python Package that Provides an API to search for articles on Google News and returns a JSON response.

A Happy and lightweight Python Package that Provides an API to search for articles on Google News and returns a JSON response.

Muhammad Abdullah 273 Dec 31, 2022
A GitHub Follower Bot that is a WIP.

GitHub Follower Bot (WIP) Work In Progress This bot is a WIP. There are still many features I plan to add and code I need to improve (I'm still fairly

Christian Deacon 71 Dec 29, 2022
Parse 11.000 free proxies!

Proxy Machine Description I did this project in order to boost views with the teleboost ✈️ in my Telegram channel. You can use it not only for boostin

VLDSLV 77 Jan 08, 2023
API which uses discord+mojang api to scrape NameMC searches/droptime/dropping status of minecraft names, and texture links

API which uses discord+mojang api to scrape NameMC searches/droptime/dropping status of minecraft names, and texture links

2 Dec 22, 2021
使用appium进行抖音粉丝的自动化获取

DYfans 使用appium进行抖音粉丝的自动化获取 工具: appium appium inspector Fiddler 夜神模拟器或者安卓手机 mitmdump mitmproxy 推荐使用安卓5.0夜神模拟器 库: appium selenium json 环境: jdk 安卓sdk 安卓

kaba 0 Mar 25, 2022
A simple and modular Discord bot with various functionalities.

All-In-Bot for Discord A simple and modular Discord bot with various functionalities. How to use the bot? Simple! Just invite the bot to your server u

Th3J0nny 3 Jan 29, 2022
Request based Python module(s) to help with the Newegg raffle.

Newegg Shuffle Python module(s) to help you with the Newegg raffle How to use $ git clone https://github.com/Matthew17-21/Newegg-Shuffle $ cd Newegg-S

Matthew 45 Dec 01, 2022
Full-featured Python interface for the Slack API

This repository is archived and will not receive any updates It's time to say goodbye. I'm archiving Slacker. It's been getting harder to find time to

Oktay Sancak 1.6k Dec 13, 2022
Convenient script for trading with python.

Convenient script for trading with python.

VladKochetov007 66 Dec 07, 2022
This is a tutorial on how to make a Discord Bot using the discord.py library

HowToMakeADiscordBot This Github repository is here to help you code a Discord Bot using the discord.py library! 1 - Setup: Download the code inside t

Baz 1 Oct 31, 2021
And now, for the first time, you can send alerts via action from ArcSight ESM Console to the TheHive when Correlation Rules are triggered.

ArcSight Integration with TheHive And now, for the first time, you can send alerts via action from ArcSight ESM Console to the TheHive when Correlatio

Amir Hossein Zargaran 3 Jan 19, 2022
Currency Merger is a simple tool for joining values in different currencies

Currency Merger Description Currency Merger is a simple tool for joining values in different currencies. For example, if I have money in USD, EUR, BRL

Arthur Diniz 1 Feb 08, 2022
A python api to get info on covid-19

A python api to get info on covid-19

roof 2 Sep 18, 2022
Discord-disnake - This package allows to use disnake without changing the discord namespace

This package is a shim This module allows to use disnake using discord namespace. This is not an independent library. Installing Python 3.8 or higher

5 Dec 13, 2022
Python library for the eWarehousing Solutions API.

eWarehousing Solutions Python Library This library provides convenient access to the eWarehousing Solutions API from applications written in the Pytho

eWarehousing Solutions 2 Nov 09, 2022
A FORKED AND Modded version of TL:GD for 🅱️3R0K🧲support

for support join here working example group Leech Here For Any Issues/Imrovements or Discussions go here or here Please Leave A star And Fork this Rep

KangersHub 202 Dec 26, 2022
A Really Simple and Advanced Google Colab NoteBook to Setup and start using Rclone on Google Colab easily.

Rclone on Google Colab (Advanced!) 🔥 1.Setup and Start using Rclone on Google Colab and Create/Edit/View and delete your Rclone config file and keep

Dr.Caduceus 14 May 24, 2022
1 Feb 18, 2022