Giter Site home page Giter Site logo

invidious-rs's Introduction

invidious-rs's People

Contributors

daknig avatar lyessaadi avatar siriusmart avatar weissp avatar zaedus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

invidious-rs's Issues

Can't fetch a particular playlist

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),
)

Info for upcoming videos

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!

ClientAsync does not work in GTK mainloop

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.

Captions endpoint can result in WebVTT file.

According to the Invidious documentation it would return a WebVTT format whenever you provide a label to the following endpoint:

/// `/api/v1/comments/:ID` endpoint.
async fn captions(&self, id: &str, params: Option<&str>) -> Result<Captions, InvidiousError> {
Captions::fetch_async(self, Some(id), params).await
}

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.

sub_count field for video::Video

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.

Inconsistent types

video::Video uses u32 for length while hidden::SearchItem uses u64 for the same field. is this a difference on invidious' side?

Cannot get continuation of video::Comments

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(&param)).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>.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.