youtube_selenium_py
![Discord](https://img.shields.io/discord/1225776155626307594)
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
- Introduction
- Installation
- Usage
- Features
- Examples
- Documentation
- Contributing
- 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
-
Install package via pip:
pip install youtube_selenium_py
-
Upgrade setuptools (required for undetected chromedriver to work):
pip install --upgrade setuptools
-
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
yt = Youtube(email="your_email@example.com", password="your_password")
channel_creation_result = yt.create_channel()
print(channel_creation_result)
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)
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.