youtubei-rs
A asynchronous implementation of the invidious innertube aka youtubei API wrapper.
Using tokio,reqwest, serde and serde_json.
Dependencies
- serde_json
- serde: features = ["derive"]
- reqwest: features = ["json","gzip"]
- tokio: features = ["full"]
Roadmap
- query: load more videos from a playlist
- propper error handling
- implementing proxy support
- removing panics
- possibly optimize the extractor
- adding more endpoints
Implemented endpoints
- next
- browse
- search
- resolve_url
- player
Supported queries
- get_video: Fetches all information about the video except captions and storyboards
- getchannelinfo: Fetches all channel informantion and about tab
- getchanneltab: Fetches a specific tab like videos to get channel videos
- search: Search youtube
- load_search: Continue search with ctoken
- get_comments: Loads initial comments or more comments for video
- loadrelatedvideos: Loads more related videos
- get_playlist: Loads a playlist
For more in depth infos take a look at query.rs and tests.rs
General information
The most structs have common fields such as thumbnail and others.
- thumbnail represent the url of the thumbnail
- views/viewcount/viewcount are all taken from the innertube data and they are in readable format eg 103K views might be the value of this field where views is always there
Example
```
use youtubers::query::getvideo;
[tokio::main]
async fn main() {
// create default clientconfig with WEB client
let clientconfig = &defaultclientconfig();
// get video with id gC6dQrScmHE
let videoquery = getvideo(String::from("gC6dQrScmHE"),String::from(""),&clientconfig).await.unwrap();
println!("{}",videoquery.video.title); // video title
}
```