Python Client for Google's Private InnerTube API. Works with Youtube, YouTube Music and more!
Project description
innertube
Python Client for Google's Private InnerTube API. Works with YouTube, YouTube Music, YouTube Kids, YouTube Studio and more!
About
This library handles low-level interactions with the underlying InnerTube API used by each of the YouTube services.
Here are a few articles available online relating to the InnerTube API:
- Gizmodo - How Project InnerTube Helped Pull YouTube Out of the Gutter
- Fast Company - To Take On HBO And Netflix, YouTube Had To Rewire Itself
Installation
innertube
uses Poetry under the hood and can easily be installed from source or from PyPI using pip.
Latest Release
pip install innertube
Bleeding Edge
pip install git+https://github.com/tombulled/innertube@develop
Usage
>>> import innertube
>>>
>>> # Construct a client
>>> client = innertube.InnerTube("WEB")
>>>
>>> # Get some data!
>>> data = client.search(query="foo fighters")
>>>
>>> # Power user? No problem, dispatch requests yourself
>>> data = client("browse", body={"browseId": "FEwhat_to_watch"})
>>>
>>> # The core endpoints are implemented, so the above is equivalent to:
>>> data = client.browse("FEwhat_to_watch")
Comparison with the YouTube Data API
The InnerTube API provides access to data you can't get from the Data API, however it comes at somewhat of a cost (explained below).
This Library | YouTube Data API | |
---|---|---|
Google account required | No | Yes |
Request limit | No | Yes |
Clean data | No | Yes |
The InnerTube API is used by a variety of YouTube services and is not designed for consumption by users. Therefore, the data returned by the InnerTube API will need to be parsed and sanitised to extract data of interest.
Endpoints
Currently only the following core, unauthenticated endpoints are implemented:
YouTube | YouTubeMusic | YouTubeKids | YouTubeStudio | |
---|---|---|---|---|
config | ✓ | ✓ | ✓ | ✓ |
browse | ✓ | ✓ | ✓ | ✓ |
player | ✓ | ✓ | ✓ | ✓ |
next | ✓ | ✓ | ✓ | |
search | ✓ | ✓ | ✓ | |
guide | ✓ | ✓ | ||
get_transcript | ✓ | |||
music/get_search_suggestions | ✓ | |||
music/get_queue | ✓ |
Authentication
The InnerTube API uses OAuth2, however this has not yet been implemented, therefore this library currently only provides unauthenticated API access.
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 innertube-2.1.9.tar.gz
.
File metadata
- Download URL: innertube-2.1.9.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.1 CPython/3.10.6 Linux/5.15.0-76-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58059a116282a12e93603228ba42dfc1aa726d9c5ab435315a151d5fb07ae4e6 |
|
MD5 | 2e766f4e7f21939b0dd81bb02bd42bb5 |
|
BLAKE2b-256 | 612f8763e1830751f6e9c1ec1f2464a2868376283c367f42279871dd5368cfd8 |
File details
Details for the file innertube-2.1.9-py3-none-any.whl
.
File metadata
- Download URL: innertube-2.1.9-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.1 CPython/3.10.6 Linux/5.15.0-76-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fb6cf3827031f289aa5dd016241b5ee42dbd4350efb21fb72569a1946fdf45f |
|
MD5 | 5e2af8cda719502166c00d2863b4bcc9 |
|
BLAKE2b-256 | 7988d107bac465b2fce73e4c91565f309e11334d7574aba17d5c6dc964fea098 |