Metadata-Version: 2.4
Name: ytbpy
Version: 0.1.1
Summary: A fast, lightweight Python library for extracting information from YouTube without requiring API keys
Author-email: TN3W <tn3w@protonmail.com>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/tn3w/ytbpy
Project-URL: Documentation, https://github.com/tn3w/ytbpy
Project-URL: Repository, https://github.com/tn3w/ytbpy.git
Project-URL: Issues, https://github.com/tn3w/ytbpy/issues
Keywords: youtube,api,scraper,video,playlist,channel,search
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Multimedia :: Video
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# 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)

```bash
pip install ytbpy
```

### Local Installation

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

## Usage

### Get Video Information

```python
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

```python
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

```python
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

```python
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

```python
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.
