Mithronn / rusty_ytdl

A Rust library for Youtube video searcher and downloader
https://docs.rs/rusty_ytdl
MIT License
107 stars 21 forks source link

Very rare unwrap panic at util.rs line 517 "abrupt end" #28

Closed luis10barbo closed 1 month ago

luis10barbo commented 4 months ago

Hello, i'm making a private app which depends on your project, and it works pretty well! but sometimes, when downloading videos, at line 517 of util.rs, there is a panic on the unwrap image image

Knowing that in Rust there are no exceptions, this unwrap, when it panics, ends up crashing my entire program, and i can't do a thing about it (that i know of).

I don't know if it would be a large endeavor, but if you judge it's not, i'd kindly ask for you to remote the unwrap at that line, so that if any errors occour, i'm able to handle them from my side.

Mithronn commented 4 months ago

@luis10barbo thanks for the feedback. Is it happening on specific videos? If yes can you provide video IDs

xNoobyyy commented 4 months ago

The same error occurs for me on Mac with every video, every time up to this point. I haven't encountered this error on Windows yet.

nick42d commented 4 months ago

Experienced the same issue, but so far unable to reproduce from my side. If I can reproduce and get some more logging information I'll let you know.

HZzz2 commented 4 months ago

thread 'tokio-runtime-worker' panicked at /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rusty_ytdl-0.7.3/src/utils.rs:517:50: called Result::unwrap() on an Err value: JsError { inner: Native(JsNativeError { kind: Syntax, message: "abrupt end", cause: None, .. }) } stack backtrace: 0: rust_begin_unwind 1: core::panicking::panic_fmt 2: core::result::unwrap_failed 3: rusty_ytdl::utils::ncode 4: core::ops::function::impls::<impl core::ops::function::FnOnce for &mut F>::call_once 5: rusty_ytdl::utils::parse_video_formats 6: rusty_ytdl::info::Video::get_info::{{closure}} 7: tgbot_app::download::y_ytdl::down_mp3::{{closure}} 8: tgbot_app::handler::handler::{{closure}} 9: <ferrisgram::ext::handlers::message_handler::MessageHandler as ferrisgram::ext::handler::Handler>::handle_update::{{closure}} 10: tokio::runtime::task::core::Core<T,S>::poll 11: tokio::runtime::task::raw::poll 12: tokio::runtime::scheduler::multi_thread::worker::Context::run_task 13: tokio::runtime::task::raw::poll note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace. Aborted

acatiadroid commented 4 months ago

thread 'tokio-runtime-worker' panicked at /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rusty_ytdl-0.7.3/src/utils.rs:517:50: called Result::unwrap() on an Err value: JsError { inner: Native(JsNativeError { kind: Syntax, message: "abrupt end", cause: None, .. }) } stack backtrace: 0: rust_begin_unwind 1: core::panicking::panic_fmt 2: core::result::unwrap_failed 3: rusty_ytdl::utils::ncode 4: core::ops::function::impls::<impl core::ops::function::FnOnce for &mut F>::call_once 5: rusty_ytdl::utils::parse_video_formats 6: rusty_ytdl::info::Video::get_info::{{closure}} 7: tgbot_app::download::y_ytdl::down_mp3::{{closure}} 8: tgbot_app::handler::handler::{{closure}} 9: ::handle_update::{{closure}} 10: tokio::runtime::task::core::Core<T,S>::poll 11: tokio::runtime::task::raw::poll 12: tokio::runtime::scheduler::multi_thread::worker::Context::run_task 13: tokio::runtime::task::raw::poll note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace. Aborted

I'm getting the same error too.

nednoodlehead commented 4 months ago

same here. every video I try. probably some yt api crap.

luis10barbo commented 4 months ago

@luis10barbo thanks for the feedback. Is it happening on specific videos? If yes can you provide video IDs

When i was having this issue, it seemed like it could happen with any videos randomly. Next time i run into the issue, ill send more info here

Mithronn commented 1 month ago

rusty_ytdl uses boa_engine v0.19.0 and its seems fixed the issue. If the issue is still there feel free to re-open the issue