Skip to main content

youtube_selenium_py

License Python Version PyPI Version Discord

youtube_selenium_py is a Python package that simplifies interactions with YouTube using Selenium.

(Video iframe, title: "Youtube Selenium Py | Automate Youtube with Selenium and Python)


Table of Contents

  1. Introduction
  2. Installation
  3. Usage
  4. Features
  5. Examples
  6. Documentation
  7. Contributing
  8. License

Introduction

This package provides functionalities to perform various actions on YouTube, such as creating channels, uploading videos, managing community posts, retrieving channel statistics, and more. It mostly uses Selenium to automate interactions with the YouTube platform. The package has two main classes at this moment, the Youtube class, and the YoutubeData class. The Youtube class is used for creating and getting information for the specific YouTube channel that is signed in, and the YoutubeData class is used to get some basic information from a YouTube channel and YouTube videos.


Installation

  1. Install package via pip:

    pip install youtube_selenium_py
    
  2. Upgrade setuptools (required for undetected chromedriver to work):

    pip install --upgrade setuptools
    
  3. Make sure you have Chromium browser installed on your operating system:

    Windows:

    macOS:

    brew install chromium
    

    Linux:

    Debian/Ubuntu-based:

    sudo apt update
    sudo apt install chromium-browser
    

    Arch Linux:

    sudo pacman -S chromium
    

Usage

After installation, import the package and utilize its classes and methods. Detailed usage instructions and examples are provided in the documentation.

Here is a quick video I recorded, of me going through the source code of the package, explaining each method, and also testing out the package:

(youtube video href)


Features

  • Create and edit YouTube channels
  • Upload videos to channels
  • Manage community posts
  • Retrieve channel and video statistics
  • Delete channels and sub-channels
  • Download videos and thumbnails
  • And more (read documentation)

Examples

from youtube_selenium_py.classes import Youtube

# Initialize the Youtube object
yt = Youtube(email="your_email@example.com", password="your_password")

# There is a 20 second implicit sleep after signing in, because maybe you have 2 step authentication enabled, or it will send confirmation code to your phone. We suggest using a brand new google account, then this won't happen, everything will be automatic.

# Example: Create a channel
channel_creation_result = yt.create_channel()
print(channel_creation_result)

# Example: Upload a video
video_upload_result = yt.create_video(
    absolute_video_path="/path/to/video.mp4",
    video_title="My Video Title",
    video_description="Description of my video"
)
print(video_upload_result)

# Close the driver when done
yt.close()

Documentation

Refer to the provided documentation for detailed usage instructions, method descriptions, and return formats.


Contributing

Contributions are welcome! Please follow the guidelines outlined in the CONTRIBUTING.md file.


License

This project is licensed under the MIT License.

Metadata

Release files for youtube-selenium-py 1.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for youtube-selenium-py 1.0.9
File Size Uploaded
youtube_selenium_py-1.0.9.tar.gz 25.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for youtube-selenium-py 1.0.9
File Interpreter ABI Platform
youtube_selenium_py-1.0.9-py3-none-any.whl Python 3 none any Details

Total release size: 67.5 kB

Release files / youtube_selenium_py-1.0.9.tar.gz

Download URL youtube_selenium_py-1.0.9.tar.gz
Size 25.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d2dfe2036ce67522d576507f9c0d721087473e418e7d24a7f3709021b6c7ec43
BLAKE2b-256 checksum
How to use checksums
a2282a8d84d37d93afcc367f219adc7e4f094148678620d41a36510d5f1a48f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.2

Release files / youtube_selenium_py-1.0.9-py3-none-any.whl

Download URL youtube_selenium_py-1.0.9-py3-none-any.whl
Size 42.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea11ad1d57858126f03a16e72aafa5068dfd05daf7ba18649945e63667515813
BLAKE2b-256 checksum
How to use checksums
b22016790a0b542f556f4bf2fbffc51d37206d9304c58610a2e0a054e05d4c3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.2

Release history Release notifications | RSS feed

This release

1.0.9 This release

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page