mirror of
https://github.com/lanyeeee/bilibili-video-downloader.git
synced 2026-09-08 17:16:52 +08:00
feat: 获取字幕失败时会提供更友好的错误信息
This commit is contained in:
@@ -47,10 +47,9 @@ impl SubtitleTask {
|
|||||||
|
|
||||||
for subtitle_detail in &player_info.subtitle.subtitles {
|
for subtitle_detail in &player_info.subtitle.subtitles {
|
||||||
let url = format!("http:{}", subtitle_detail.subtitle_url);
|
let url = format!("http:{}", subtitle_detail.subtitle_url);
|
||||||
let subtitle = bili_client
|
let subtitle = bili_client.get_subtitle(&url).await.wrap_err(
|
||||||
.get_subtitle(&url)
|
"获取字幕失败,请[继续]以重试。如果重试多次依旧失败,请在设置中取消勾选[下载字幕]",
|
||||||
.await
|
)?;
|
||||||
.wrap_err("获取字幕失败")?;
|
|
||||||
|
|
||||||
let mut srt_content = String::new();
|
let mut srt_content = String::new();
|
||||||
for (i, b) in subtitle.body.iter().enumerate() {
|
for (i, b) in subtitle.body.iter().enumerate() {
|
||||||
|
|||||||
Reference in New Issue
Block a user