If you do care, things are on my website.
siriusmart / invidious-rs Goto Github PK
View Code? Open in Web Editor NEWRust bindings for the Invidious API
License: GNU Affero General Public License v3.0
Rust bindings for the Invidious API
License: GNU Affero General Public License v3.0
If you do care, things are on my website.
instead of having many different Video structs like ChannelVideo, have one unified common Video type. same for playlists, thumbnails etc.
https://docs.invidious.io/api/common_types/
I could not find anything in this lib for search suggestions, it could speed up loading time...
Hi, I'm unable to fetch data about this playlist:
https://www.youtube.com/playlist?list=OLAK5uy_kciTzXJBH4KscvdNJrW3FtCO6kInaZxgo
Other playlists work fine. Maybe it's the different ID lenght that is causing this?
My code:
use invidious::*;
#[tokio::main]
async fn main() {
let client = ClientAsync::default();
let playlist = client.playlist("OLAK5uy_kciTzXJBH4KscvdNJrW3FtCO6kInaZxgo", None).await;
dbg!(playlist);
}
The output:
[src/main.rs:8] playlist = Err(
Error("invalid type: null, expected a string", line: 0, column: 0),
)
running my app to get the popular vids (and then requesting the Video object for the relevant ID) I get this error: (first part is my own, I added it)
can't fetch the data of vid ID rhrZK0uo0KM: Invalid request: This live event will begin in 10 hours.
but I want to give the users the info on the video!
Despite looking like ClientSync, it is not Clone.
most fields of most structs are easy to understand, this one is not, please explain what this field does and how to use it!
when trying to get ClientAsync::default().popular()
future to process inside GTK mainloop (not based on tokio), it complains about there not being a tokio reactor active.
there are runtimes outside tokio, please support them, or document that requirement.
According to the Invidious documentation it would return a WebVTT format whenever you provide a label
to the following endpoint:
invidious-rs/src/traits/clients.rs
Lines 174 to 177 in c3407a7
For example: https://vid.puffyan.us/api/v1/captions/Rnvoq6uQC4w?label=Dutch+(auto-generated)
However, because of the deserialization calling this function in this lib results in:
called `Result::unwrap()` on an `Err` value: ExpectedError("Cannot deserialize response: expected value at line 1 column 1")
So this lib does not take this into account it seems.
As a workaround you can do the following:
let client = get_invidious_client(); // The invidious client of this lib
let result = client
.fetch(&format!(
"{}/api/v1/captions/{caption_id}?label={label}&languageCode={language}",
client.instance
))
.await?;
However it has not been stated anywhere in this lib that this is the case.
please make it clone, there's no reason not to imo
you provide sub_count_text
, but not a float for sub_count
. thats inconsistent given we have published
, published_text
etc.
I am not sure about the official API.
video::Video uses u32 for length while hidden::SearchItem uses u64 for the same field. is this a difference on invidious' side?
use inv::ClientSyncTrait;
fn main() {
let mut client = inv::ClientSync::default();
client.set_instance("https://invidious.slipfox.xyz".to_owned());
let video_id = "rP_Ht6LsQ8I".to_owned();
let first_comments = client.comments(&video_id, None).unwrap();
let param = format!("continuation={}", first_comments.continuation.unwrap());
let next_comments = client.comments(&video_id, Some(¶m)).unwrap();
println!("%");
for comment in first_comments.comments {
println!("{}\n%", comment.content);
}
for comment in next_comments.comments {
println!("{}\n%", comment.content);
}
}
'called `Result::unwrap()` on an `Err` value: SerdeError { error: Error("missing field `commentCount`", line: 0, column: 0), original: None }'
It appears that Invidious drops the commentCount
field from the comments object, but this library assumes that it will always be there. The field comment_count
in type video::Comments
should be changed to Option<u32>
.
on Video
it is called .views
, on ChannelVideo
it is called .view_count
. this ... just makes my day harder and nothing more :)
instead of seconds since 1970, use time::Instant, more useful...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.