Skip to main content

A python library that wraps around the YouTube V3 API. You can use it find and manage YouTube resources including Videos, Playlists, Channels and Comments.

Project description

youtube-wrapper

Overview

A python library that wraps around the YouTube V3 API. You can use it find and manage YouTube resources including Videos, Playlists, Channels and Comments.

The library is modelled after Google's own documentation.

Requirements

  • Python 3.10+
  • Works on Linux, Windows, macOS, BSD

Installation

pip install ayv

Get started

To get started, you need a verified Google Account and Google API keys with the correct permissions.

How to Get A Google API Key

Follow the instructions in this short article to get an API key.

To get a particular video using the videos' id:

  1. Create an instance of the YouTube API passing in the path to the downloaded client secret file:
from youtube import YouTube

client_secrets_file = '/home/lyle/Downloads/secrets.json'
youtube = YouTube(client_secrets_file)
youtube.authenticate()
  1. Use the video id to find the video:
video = youtube.find_video_by_id('rfscVS0vtbw')
  1. To find many videos using their id's:
ids = ['rfscVS0vtbw', 'TFa38ONq5PY']
videos = youtube.find_videos(ids)
  1. To find the most popular videos in a given region e.g Kenya, pass in the region code:
popular_kenyan_videos = youtube.find_most_popular_video_by_region('ke')
  1. To search for videos (this returns an iterator):
query = 'Python programming'
video_iterator = youtube.search_video('Python')
videos = next(video_iterator)

Documentation and Tutorials

To learn more about the library including the documentation and tutorials, check out the libraries' documentation.

How to Contribute

To contribute, chack out the contribution guideline.

License

The API uses an MIT License

Developer

Lyle Okoth – @lylethedesigner on twitter

lyle okoth on medium

My email is lyceokoth@gmail.com

Here is my GitHub Profile

You can also find me on Linkedin

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

ayv-0.5.1.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

ayv-0.5.1-py3-none-any.whl (35.7 kB view details)

Uploaded Python 3

File details

Details for the file ayv-0.5.1.tar.gz.

File metadata

  • Download URL: ayv-0.5.1.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for ayv-0.5.1.tar.gz
Algorithm Hash digest
SHA256 896c737adb62d32f89677b2e0e45a032c80b879dc26359060fabe1753a4b91d9
MD5 78ca0fcf1ba910320fbc3886eb827efa
BLAKE2b-256 616020befeb83f27cdb20aaf2d76a7b7784b25f9ced9f17129549ca3045be5ab

See more details on using hashes here.

File details

Details for the file ayv-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: ayv-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 35.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for ayv-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b4229ed5428154d2261d171dda4e912dd8685fab08f34dd9601f0cc352236861
MD5 f7470a5b2a6c69808b9050dc52064570
BLAKE2b-256 52c87246d59339a9942f5e2d76afa46100fa88a7a4da2ed0bf42b49a0ed1b6c4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page