Giter VIP home page Giter VIP logo

pyupselenium's Introduction

CodeQL pages-build-deployment

Note

This is a fork from youtube_uploader_selenium customized for my needs.

About

Python script to download videos from JSON file and then upload to YouTube using Selenium for Firefox and custom metadata.

This script allows to upload more than 61 videos per day which is the maximum [1] for all other tools that use the YouTube Data API v3.

1: Since the projects that enable the YouTube Data API have a default quota allocation of 10,000 units per day [2] and a video upload has a cost of approximately 1,600 units [3]: 10,000 / 1,600 = 6.25.

Instead, this script is only restricted by a daily upload limit for a channel on YouTube.

100 videos is the limit in the first 24 hours, then drops to 50 every 24 hours after that.

Script Installation

git clone https://github.com/ChrisK106/PyUpSelenium.git
cd PyUpSelenium
pip install -r requirements.txt

Warning

The following documentation is still under construction.

Package Usage

from youtube_uploader_selenium import YouTubeUploader

video_path = 'videos/video_to_upload.mp4'
metadata_path = 'videos/video_metadata.json'
profile_path = 'path/to/firefox_profile_folder'

uploader = YouTubeUploader(video_path, metadata_path, None, profile_path, headless_mode)
was_video_uploaded, video_id = uploader.upload()
assert was_video_uploaded

Script Usage

At a minimum, just specify a JSON file:

python main.py --json video_collection.json

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:

python upload.py --video my_video.mp4 --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!",
  "tags": ["James", "Harden", "NBA"],
  "schedule": "06/05/2013, 23:05"
}

For your convenience, the format string for the schedule is %m/%d/%Y, %H:%M

Dependencies

  • Firefox browser (works even with the latest version)
  • geckodriver
  • selenium < 4
  • selenium-firefox==1.0.35
  • colorama

FAQ

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Feedback

If you find a bug / want a new feature to be added, please open an issue

License

MIT

pyupselenium's People

Contributors

chrisk106 avatar pop123123123 avatar linouk23 avatar alafalaki avatar 7x11x13 avatar korewalidesu avatar nishantsethi avatar sakimotor avatar spacenerden avatar philnagel avatar romka777 avatar

Stargazers

 avatar Fakesum avatar

Watchers

 avatar

Forkers

fakesum grjan7

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.