Skip to main content

A fast, lightweight Python library for extracting information from YouTube without requiring API keys

Project description

ytbpy

A fast, lightweight Python library for extracting information from YouTube without requiring API keys or authentication.

Features

  • Zero Dependencies: Uses only Python standard libraries
  • No API Key Required: Works without YouTube API credentials
  • Fast & Lightweight: Minimal overhead for quick information extraction
  • No Authentication: No need for login or OAuth

Installation

Via pip (Recommended)

pip install ytbpy

Local Installation

git clone https://github.com/tn3w/ytbpy.git
cd ytbpy
pip install -e .

Usage

Get Video Information

from ytbpy import video

# Get details about a video using URL or ID
video_info = video.get_video_info('https://www.youtube.com/watch?v=rZ6luwT8kuc')
# OR
video_info = video.get_video_info('rZ6luwT8kuc')

print(video_info['title'])
print(video_info['duration'])
print(video_info['views_count'])

Using OEmbed API

from ytbpy import video

# Get details about a video using URL or ID
video_info = video.get_video_info_oembed('https://www.youtube.com/watch?v=rZ6luwT8kuc')
# OR
video_info = video.get_video_info_oembed('rZ6luwT8kuc')

print(video_info['title'])

Search YouTube

from ytbpy import search

# Search YouTube videos
results = search.search_youtube('python tutorial', max_results=5)

for video in results:
    print(f"{video['title']} - {video['url']}")

Get Playlist Information

from ytbpy import playlist

# Get all videos in a playlist
playlist_info = playlist.get_playlist_info('https://www.youtube.com/playlist?list=PLOU2XLYxmsIJQPs-2nnII-n59vYoxKsmq')

print(f"Playlist: {playlist_info['title']}")
print(f"Videos: {playlist_info['video_count']}")

for video in playlist_info['videos']:
    print(video['title'])

Get Channel Information

from ytbpy import channel

# Get channel info and recent videos
channel_info = channel.get_channel_info('https://www.youtube.com/channel/UC_x5XG1OV2P6uZZ5FSM9Ttw')

print(f"Channel: {channel_info['title']}")
print(f"Subscribers: {channel_info['subscriber_count']}")

# List recent videos
for video in channel_info['videos']:
    print(video['title'])

License

Copyright 2025 TN3W

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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

ytbpy-0.1.1.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ytbpy-0.1.1-py3-none-any.whl (23.6 kB view details)

Uploaded Python 3

File details

Details for the file ytbpy-0.1.1.tar.gz.

File metadata

  • Download URL: ytbpy-0.1.1.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for ytbpy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b101f2e920cdede7077ffa4587c005c7b0777c4a5624a24f2120ebbe4a61f65a
MD5 21adee15e536855ffbf01aab239245c0
BLAKE2b-256 e9aaf4ee579041558ff2c9b8ace133b6e87ea8017e52186fe470fdbdda099fb4

See more details on using hashes here.

File details

Details for the file ytbpy-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ytbpy-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 23.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for ytbpy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4aa86312a08ff1de0cc2e132e17b2c287aa712ec9d3bacb99cb95ab610d104e4
MD5 073aa68272ddaab4fd25b268cd6a1463
BLAKE2b-256 2c2c947a93495065fdf4fca740a8dba46c68ebe29b0c377883a9cad154f0fe41

See more details on using hashes here.

Supported by

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