youtube-dl-rs icon indicating copy to clipboard operation
youtube-dl-rs copied to clipboard

bug: YouTube Links with Additional Junk

Open onkoe opened this issue 1 year ago • 2 comments

When submitting a YouTube link with some additional junk (stuff behind the first query), such as https://www.youtube.com/watch?v=CDWHVRqhfto&t=930s, you find that the parser often can't keep up: json error: invalid type: floating point \930`, expected a string`

Is this expected behavior? If so, could you please tell me if there's a way to skip the error and continue serving the downloaded file? It is certainly on my hard drive after a YoutubeDl::new..., but the error prevents me from confidently using the file.

Many thanks, Barrett

onkoe avatar Jun 10 '23 23:06 onkoe

I'm gonna guess that doesn't actually have anything to do with the URL itself, I guess that passing the time offset changes some fields in the output JSON, which then causes errors because the JSON output doesn't match the schema in the library.

GyrosOfWar avatar Aug 19 '23 13:08 GyrosOfWar

The new version (0.9.0) now supports returning the JSON as a serde_json::Value so that you don't have to rely on the struct definitions matching the JSON (because of the nature of how youtube-dl/yt-dlp work, it's difficult to make an exact schema)

GyrosOfWar avatar Aug 20 '23 18:08 GyrosOfWar