Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jnsougata/aiotube
An Alternative to YouTube Public Data API v3
https://github.com/jnsougata/aiotube
python youtube youtube-api youtube-api-v3 youtube-data-api youtube-search
Last synced: about 6 hours ago
JSON representation
An Alternative to YouTube Public Data API v3
- Host: GitHub
- URL: https://github.com/jnsougata/aiotube
- Owner: jnsougata
- License: mit
- Created: 2021-08-22T06:16:02.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-08-31T05:58:22.000Z (25 days ago)
- Last Synced: 2024-09-24T03:32:26.771Z (about 18 hours ago)
- Topics: python, youtube, youtube-api, youtube-api-v3, youtube-data-api, youtube-search
- Language: Python
- Homepage: https://aiotube.deta.dev
- Size: 1.27 MB
- Stars: 62
- Watchers: 3
- Forks: 11
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
[![Release](https://github.com/jnsougata/aiotube/actions/workflows/publish.yml/badge.svg)](https://github.com/jnsougata/aiotube/actions/workflows/publish.yml)
# aiotube
A library to access YouTube Public Data without YouTubeAPI
- [Discord](https://discord.gg/YAFGAaMrTC)
- [GitHub](https://github.com/jnsougata/aiotube)
- [REST API (BETA)](https://aiotube.deta.dev/)# Table of Contents
- [Installation](#installing)
- [Building](#build-from-source)
- [Quick Start](#quick-start)
- [Usage](#usage)
- [Channel](#channel)
- [Video](#video)
- [Playlist](#playlist)## Installing
**Python 3.6 or higher is required**
``` sh
# Linux/macOS
python3 -m pip install -U aiotube
`````` sh
# Windows
python -m pip install -U aiotube
```## Build from source
``` sh
pip install git+https://github.com/jnsougata/aiotube
```## Quick Start
``` py
import aiotubechannel = aiotube.Channel('@GYROOO')
print(channel.metadata)video = aiotube.Video('WVDT4lSozHk')
print(video.metadata)playlist = aiotube.Playlist('PL-xXQjd8X_Q-xXQjd8X_Q-xXQjd8X_Q-')
print(playlist.metadata)search = aiotube.Search.video('YouTube Rewind 2018')
print(search.metadata)search = aiotube.Search.channel('PewDiePie')
print(search.metadata)search = aiotube.Search.playlist('Unlock Your Third Eye')
print(search.metadata)
```## Usage
### Channel
| Property | Return Type | Description |
|-------------------|------------------|--------------------------------------------------------|
| `live` | `bool` | Returns True if the channel is live |
| `streaming_now` | `str` | Returns the video id of the ongoing livestream |
| `current_streams` | `List[str]` | Returns a list of ids of ongoing livestreams |
| `old_streams` | `List[str]` | Returns a list of ids of old livestreams |
| `video_count` | `int` | Returns total number of videos uploaded by the channel |
| `upcoming` | `Video` | Returns a video object of the upcoming video |
| `upcomings` | `List[str]` | Returns a list of ids of upcoming videos |
| `playlists` | `List[str]` | Returns a list of playlist ids |
| `metadata` | `Dict[str, Any]` | Returns the metadata of the channel in dict format |
| `last_uploaded` | `Video` | Most recently uploaded video of the channel |
| `last_streamed` | `Video` | Most recently completed livestream of the channel || Method | Return Types | Description |
|-------------------------------|--------------|----------------------------------------------------|
| `uploads(limit: int \| None)` | `List[str]` | Returns a list of video ids of the uploaded videos |### Video
| Properties | Return Types | Description |
|------------|------------------|--------------------------------------------------|
| `metadata` | `Dict[str, Any]` | Returns the metadata of the video in dict format |### Playlist
| Properties | Return Types | Description |
|------------|------------------|-----------------------------------------------------|
| `metadata` | `Dict[str, Any]` | Returns the metadata of the playlist in dict format |### Search
| Method | Return Type | Description |
|--------------------------------------------|-------------|-----------------------------------------------------|
| `channel(name: str)` | `Channel` | Finds a channel with the given keywords |
| `video(name: str)` | `Video` | Finds a video with the given keywords |
| `playlist(name: str)` | `Playlist` | Finds a playlist with the given keywords |
| `channels(name: str, limit: int \| None)` | `List[str]` | Finds all channels that matches the given keywords |
| `videos(name: str, limit: int \| None)` | `List[str]` | Finds all videos that matches the given keywords |
| `playlists(name: str, limit: int \| None)` | `List[str]` | Finds all playlists that matches the given keywords |### Possible Exceptions
| Class | Description |
|-------------------|-----------------------------------------------------------------|
| `InvalidURL` | Raised when then url is not a valid YouTube endpoint |
| `TooManyRequests` | Raised when client IP receives soft ban from YouTube |
| `RequestError` | Raised for any type of request error not handled by the library |