Python script to upload videos on RuTube using Selenium. Based on https://github.com/linouk23/youtube_uploader_selenium
pip3 install --upgrade rutube-uploader-selenium
git clone https://github.com/romka777/rutube_uploader_selenium
cd rutube-uploader-selenium
from youtube_uploader_selenium import YouTubeUploader
video_path = '123/rockets.flv'
metadata_path = '123/rockets_metadata.json'
uploader = YouTubeUploader(video_path, metadata_path, thumbnail_path)
was_video_uploaded, video_id = uploader.upload()
assert was_video_uploaded
At a minimum, just specify a video:
python3 upload.py --video rockets.flv
If it is the first time you've run the script, a browser window should popup and prompt you to provide YouTube credentials (and then simply press Enter after a successful login). A token will be created and stored in a file in the local directory for subsequent use.
Video title, description and other metadata can specified via a JSON file using the --meta
flag:
python3 upload.py --video rockets.flv --meta metadata.json
An example JSON file would be:
{
"title": "Best Of James Harden | 2019-20 NBA Season",
"description": "Check out the best of James Harden's 2019-20 season so far!",
"genre": "Videogames",
"adult": 0
}
- geckodriver
- Firefox (Works with version 77)
- selenium_firefox
- Selenium using Python - Geckodriver executable needs to be in PATH
- SessionNotCreatedException: Message: Unable to find a matching set of capabilities
- Please make sure that Firefox browser is installed on your machine.