Upload YouTube videos from Python and more.
Project description
PillarGG YouTube Uploader
Upload Youtube Videos and more via Python.
Getting Started
pip install pillar-youtube-upload
This project uses the Youtube Data API.
All implementations of youtube upload needs some form of authentication.
Client Side youtube upload
To upload youtube videos as a client, you need to follow this guide.
Server Side youtube upload
To upload youtube videos as a server, you need to follow this guide.
Getting a youtube api key
- First, you need to go to this website.
- If prompted, select a project, or create a new one.
- Use the Library page to find and enable the YouTube Data API v3.
- Go to the credentials page.
- Click
Create Credentials > OAuth client ID
. - Select the Web application app type.
- Fill in the form and click create. For testing redirect URIs that refer to the local machine with
http://localhost:8080
. - Download the client_secret.json file from the API Console and securely store the file in a location that only your application can access. By default, the application gets this file from the directory your script is being ran in. The path can also be changed when the class
YouTubeUploader
is being initialized. - Get your
client_id
andclient_secret
.
We recommend that you design your app's auth endpoints so that your application does not expose authorization codes to other resources on the page.
The key must have the scope 'https://www.googleapis.com/auth/youtube.upload'.
Usage Info
This module uploads a given video to a youtube channel, as such there are 2 things this module needs.
-
A video
-
Video Options
- Title
- Description
- Tags
- Category
- Status
- DeclaredMadeForKids
-
A channel to upload to(In the form of a authentication file)
-
The authentication file should contain the following:
- access_token: token_here
- refresh_token: token_here
- scope: scope_here
- token_type: Bearer
- expires_in: 3599
This file should be called client_secrets.sjon and exist in the directory this script is.
Usage
# youtube upload api
from youtube_upload.client import YouTubeUploader
uploader = YoutubeUploader(client_id,client_secret)
uploader.authenticate()
# Video options
options = {
title : "Example title",
description : "Example description",
tags : ["tag1", "tag2", "tag3"],
categoryId : "22",
privacyStatus : "private",
kids : False
thumbnailLink : "https://cdn.havecamerawilltravel.com/photographer/files/2020/01/youtube-logo-new-1068x510.jpg"
}
# upload video
uploader.upload(file_path, options)
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
Built Distribution
Hashes for pillar-youtube-upload-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 280301a70a53ebd37c313201c5154d3a0856b47fa5953fd430ce63f17deb17a1 |
|
MD5 | d97c1b1a8166d42d4031590e922c50bd |
|
BLAKE2b-256 | 06dfcfe49e681a3692848dfbfc019eeeae92d924766d60ce2bdccd3b5eabe721 |
Hashes for pillar_youtube_upload-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79ca7b9618962702a8c291117d16164c8d0f04e75989dde4c4d14f7967cf96c2 |
|
MD5 | 49f8b328eae95b86c6ddc717720c3e4c |
|
BLAKE2b-256 | 152b3ac642a9e5a1df34e94b23ffb197ea19c37dd5af1737b1b45b58fe6bdf31 |