Git Product home page Git Product logo

simple-youtube-api's Introduction

Simple Youtube API

Simple YouTube API page on the Python Package Index

Build status on travis

Coverage on coveralls

Simple Youtube API(full documentation) is a Youtube API wrapper for python, making it easier to search and upload your videos.

Examples

In this example we log in into a YouTube channel, set the appropriate variables for a video and upload the video to the YouTube channel that we logged into:

from simple_youtube_api.Channel import Channel
from simple_youtube_api.LocalVideo import LocalVideo

# loggin into the channel
channel = Channel()
channel.login("client_secret.json", "credentials.storage")

# setting up the video that is going to be uploaded
video = LocalVideo(file_path="test_vid.mp4")

# setting snippet
video.set_title("My Title")
video.set_description("This is a description")
video.set_tags(["this", "tag"])
video.set_category("gaming")
video.set_default_language("en-US")

# setting status
video.set_embeddable(True)
video.set_license("creativeCommon")
video.set_privacy_status("private")
video.set_public_stats_viewable(True)

# setting thumbnail
video.set_thumbnail_path('test_thumb.png')

# uploading video and printing the results
video = channel.upload_video(video)
print(video.id)
print(video)

# liking video
video.like()

Installation

Simple YouTube API needs API keys from Google in order to be able to make queries to YouTube.

Installation by hand: you can download the source files from PyPi or Github:

python setup.py install

Installation with pip: make sure that you have pip installed, type this in a terminal:

pip install simple-youtube-api

Generating YouTube API Keys

  1. Log into https://console.cloud.google.com
  2. Create a new Project
  3. Search for "YouTube Data API V3" or go to https://console.cloud.google.com/apis/library/youtube.googleapis.com
  4. Click Credentials
  5. Click Create Credentials

For user data:

  1. Select OAuth Client ID
  2. Select that you will call API from "Web Server"
  3. Download or copy your API key from the Credentials tab

For non-user data:

  1. Select API Key
  2. Paste the key into a file

Running Tests

Run the python command

python setup.py test

References

YouTube API Documentation

Python YouTube API Examples

Contribute

  1. Fork the repository from Github
  2. Clone your fork
git clone https://github.com/yourname/simple-youtube-api.git
  1. Add the main repository as a remote
git remote add upstream https://github.com/jonnekaunisto/simple-youtube-api.git
  1. Create a pull request and follow the guidelines

Maintainers

jonnekaunisto (owner)

simple-youtube-api's People

Contributors

boldie avatar dependabot-preview[bot] avatar dependabot[bot] avatar jonnekaunisto avatar mcofficer avatar saujanyam avatar

Watchers

 avatar

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.