A library to access YouTube Public Data without YouTubeAPI
Project description
aiotube
A library to access YouTube Public Data without YouTubeAPI
Table of Contents
Installing
Python 3.6 or higher is required
# Linux/macOS
python3 -m pip install -U aiotube
# Windows
py -3 -m pip install -U aiotube
Build from source
pip install git+https://github.com/jnsougata/aiotube
Quick Start
import aiotube
channel = aiotube.Channel('UCU9FEimjiOV3zN_5kujbCMQ')
print(channel.name)
print(channel.description)
print(channel.views)
print(channel.subscribers)
# and so on...
# or
print(channel.info) # dictionary of all basic info about the channel
video = aiotube.Video('WVDT4lSozHk')
print(video.title)
print(video.description)
print(video.views)
print(video.likes)
# and so on...
# or
print(video.info) # dictionary of all basic info about the video
playlist = aiotube.Playlist('PL-xXQjd8X_Q-xXQjd8X_Q-xXQjd8X_Q-')
print(playlist.name)
print(playlist.url)
print(playlist.video_count)
# and so on...
# or
print(playlist.info) # dictionary of all basic info about the playlist
search = aiotube.Search.video('YouTube Rewind 2018')
print(search.title)
print(search.description)
print(search.views)
print(search.likes)
# and so on...
# or
print(search.info) # dictionary of all basic info about the video
search = aiotube.Search.channel('PewDiePie')
print(search.name)
print(search.description)
print(search.views)
print(search.subscribers)
# and so on...
# or
print(search.info) # dictionary of all basic info about the channel
search = aiotube.Search.playlist('Unlock Your Third Eye')
print(search.name)
print(search.url)
print(search.video_count)
# and so on...
# or
print(search.info) # dictionary of all basic info about the playlist
Usage
Channel
Method |
Return Type |
Description |
---|---|---|
uploads(limit: int) |
VideoBulk |
VideoBulk object of videos uploaded by the channel |
Attribute |
Return Type |
Description |
---|---|---|
id |
str |
unique id of the channel |
name |
str |
name of the channel |
verified |
bool |
whether the channel is verified |
description |
str |
description of the channel |
views |
str |
total number of views of the channel |
video_count |
str |
number of videos in the channel |
country |
str |
country of the channel |
custom_url |
str |
custom url of the channel |
created_at |
str |
date of the channel creation |
subscribers |
str |
number of subscribers of the channel |
avatar |
str |
url of the avatar of the channel |
banner |
str |
url of the banner of the channel |
valid |
bool |
whether the channel is valid or not |
info |
Dict[str, Any] |
dictionary of all basic info about the channel |
links |
list |
list of all links added to the channel |
live |
bool |
whether the channel is live or not |
latest |
Video |
most latest video of the channel |
livestream |
Live |
Live object of the newest livestream |
livestreams |
list |
list of occurring livestream ids of the channel |
old_streams |
VideoBulk |
VideoBulk object of the old streams |
recent_uploaded |
Video |
Video object of the most recently uploaded video |
recent_streamed |
Video |
Video object of the most recently streamed video |
upcoming |
Upcoming |
Upcoming object of the upcoming video of the channel |
all_upcoming |
list |
list of upcoming video ids of the channel |
playlists |
PlaylistBulk |
PlaylistBulk object of the playlists of the channel |
Video
Attribute |
Return Type |
Description |
---|---|---|
id |
str |
unique id of the video |
title |
str |
title of the video |
url |
str |
url of the video |
description |
str |
description of the video |
views |
str |
total number of views of the video |
likes |
str |
number of likes of the video |
duration |
float |
duration of the video in seconds |
thumbnail |
str |
url of the thumbnail of the video |
upload_date |
str |
date of the video upload |
author |
str |
id of the channel where the video was uploaded |
tags |
List[str] |
list of tags of the video |
info |
Dict[str, Any] |
dictionary of all basic info about the video |
premiered |
bool |
whether the video was premiere or not |
streamed |
bool |
whether the video was streamed or not |
Playlist
Attribute |
Return Type |
Description |
---|---|---|
id |
str |
unique id of the playlist |
name |
str |
name of the playlist |
url |
str |
url of the playlist |
video_count |
str |
number of videos in the playlist |
videos |
VideoBulk |
VideoBulk object of the videos in the playlist |
thumbnail |
str |
url of the thumbnail of the playlist |
info |
Dict[str, Any] |
dictionary of all basic info about the playlist |
Search
Method |
Return Type |
Description |
---|---|---|
channel(name: str) |
Channel |
Channel object of the channel with the given keywords |
video(name: str) |
Video |
Video object of the video with the given keywords |
playlist(name: str) |
Playlist |
Playlist object of the playlist with the given keywords |
channels(name: str, limit: int) |
ChannelBulk |
ChannelBulk object of the channels with the given keywords |
videos(name: str, limit: int) |
VideoBulk |
VideoBulk object of the videos with the given keywords |
playlists(name: str, limit: int) |
PlaylistBulk |
PlaylistBulk object of the playlists with the given keywords |
Note on Bulk Objects
This objects are made for faster access to the data using threads.
Any Bulk Object is not iterable.
It almost has the same functionality as Primary Object (not always).
It holds the same attributes as Primary Objects but in plural form.
Upon applying a valid attribute, it will return all data in list form.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file aiotube-1.5.4.tar.gz
.
File metadata
- Download URL: aiotube-1.5.4.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0241f71568e8186e0ec92186b4c42edd68a6e9f99113029fa3843fb0fac44177 |
|
MD5 | 9fe585dc7ddd2cdc7d81200f7dd7de02 |
|
BLAKE2b-256 | 394914edb20c89832aae9db359e0a9aab1fcd0ce837a2885728fa4611032aa6a |
File details
Details for the file aiotube-1.5.4-py3-none-any.whl
.
File metadata
- Download URL: aiotube-1.5.4-py3-none-any.whl
- Upload date:
- Size: 16.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96e4aa0183233b7c77d78051bf5cd1be6c061e471ba16d95822ea222332483af |
|
MD5 | 1f0c3a5d05cca5d69a70038f06f7a9f5 |
|
BLAKE2b-256 | ee2a2d5d74f3c9fe714c6748647df8733bb8f97d69bbeec1b51adac82656b6ea |