Skip to main content

A Python library to automate video uploads to YouTube.

Project description

🚀 upload-socials

Streamline your content workflow by automating video uploads to YouTube with this Python library. Now supports automated monetization settings!


⚠️ Prerequisites

This is a GUI automation library and requires a specific setup to function:

  1. Screen Resolution: Your screen resolution should ideally be 1920x1080. The browser window should be maximized during the process.
  2. Reference Images: GUI automation works by finding images on the screen. You must provide your own folders of reference images (e.g., screenshots of the 'Upload', 'Next', and 'Publish' buttons).
  3. Platform Language: The YouTube Studio website must be set to English.

This library is best suited for developers comfortable with tuning GUI automation scripts.

Installation

pip install upload-socials

Setup: Reference Images

You must create a directory (e.g., assets/youtube) containing screenshots of the YouTube Studio interface. The script looks for .png files with specific names.

Basic Upload Images:

  • create.png, uploadvids.png, select.png
  • filename.png (The file input field in Windows Explorer)
  • title.png, tell.png (Description box)
  • thumbnail.png
  • showmore.png, tags.png
  • next.png, publish.png
  • processing.png (The "SD/HD processing" checkmark at the end)

Monetization Images (Required if monetization=True):

  • monetizeselect.png (The monetization tab/dropdown)
  • monetizeon.png (Radio button to turn On)
  • monetizedone.png (Done button inside dropdown)
  • monetizeactive.png
  • monetizenone.png (The "None of the above" checkbox for ad suitability)
  • monetizesubmit.png (Submit rating button)
  • monetizepublic.png (Public visibility radio button)
  • publish2.png (Secondary publish button if layout differs)

Quick Start

from upload_socials import upload_youtube

# 1. Define the path to your screenshots folder
YT_IMAGE_PATH = r"C:\\my_automation_images\\youtube"

# 2. Define Video details
video_file = r"C:\\path\\to\\my_awesome_video.mp4"
video_title = "My First Automated Upload!"
video_desc = "This was uploaded using the upload-socials Python library."
thumb_file = r"C:\\path\\to\\my_thumbnail.png"
video_tags = "python,automation,coding"

# 3. Call the function
upload_youtube(
    filepath=video_file,
    title=video_title,
    image_path=YT_IMAGE_PATH,
    description=video_desc,
    thumbnail=thumb_file,
    tags=video_tags,
    monetization=True  # Set to True to enable ads and submit rating
)

API Reference

upload_youtube(...)

Automates the upload process to YouTube Studio.

Parameter Type Default Description
filepath str Required Absolute path to the video file.
title str Required The title of the YouTube video.
image_path str .../uploadyt Path to the folder containing your .png reference screenshots.
description str None The text for the video description.
channelurl str studio.youtube.com The starting URL.
thumbnail str None Absolute path to a thumbnail image.
tags str None Comma-separated string of tags.
monetization bool False If True, performs steps to enable monetization, select "None of the above" for suitability, and submit rating.

Tips for Success

  • Wait Times: The script uses optimiseWait to look for images. If your internet is slow, ensure your screenshots are accurate so the script doesn't time out.
  • Mouse Control: Do not touch the mouse or keyboard while the script is running.
  • Smart Paste: This library uses a smart pasting method to handle emojis and special characters in titles and descriptions automatically.

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

upload_socials-1.3.3.tar.gz (104.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

upload_socials-1.3.3-py3-none-any.whl (111.7 kB view details)

Uploaded Python 3

File details

Details for the file upload_socials-1.3.3.tar.gz.

File metadata

  • Download URL: upload_socials-1.3.3.tar.gz
  • Upload date:
  • Size: 104.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.6

File hashes

Hashes for upload_socials-1.3.3.tar.gz
Algorithm Hash digest
SHA256 ca6436404208470e8be57c492707df97fb3c95cc34152ed3f214d0648a3798de
MD5 3f856414ab9016dd46d2cef0d81facd3
BLAKE2b-256 9a3ee4139543ef18f3230ed150bb2f6fd9fcfca2e9eea0e4ce3dbb16ef4a0414

See more details on using hashes here.

File details

Details for the file upload_socials-1.3.3-py3-none-any.whl.

File metadata

  • Download URL: upload_socials-1.3.3-py3-none-any.whl
  • Upload date:
  • Size: 111.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.6

File hashes

Hashes for upload_socials-1.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2ad148bdb3f31dc00392ef6acf26f4c9a004c6ac9f5ea4281fe06a439b04a9a3
MD5 c0b2dae941056706b0db2c0932b9fe6f
BLAKE2b-256 3c8e03ee2d7d028c968c033096f96d8d7ed2a87fcc0f3bc073a0f02e81b4546b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page