Compare commits

...

2 Commits

Author SHA1 Message Date
Xinrea
7155fef677 bump version to 2.16.2 2025-11-06 22:11:38 +08:00
Xinrea
0566ae78e7 fix: douyin encoding with danmu (#221) 2025-11-06 22:09:41 +08:00
6 changed files with 18 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
{
"name": "bili-shadowreplay",
"private": true,
"version": "2.16.1",
"version": "2.16.2",
"type": "module",
"scripts": {
"dev": "vite",

2
src-tauri/Cargo.lock generated
View File

@@ -541,7 +541,7 @@ checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba"
[[package]]
name = "bili-shadowreplay"
version = "2.16.1"
version = "2.16.2"
dependencies = [
"async-ffmpeg-sidecar 0.0.1",
"async-std",

View File

@@ -4,7 +4,7 @@ resolver = "2"
[package]
name = "bili-shadowreplay"
version = "2.16.1"
version = "2.16.2"
description = "BiliBili ShadowReplay"
authors = ["Xinrea"]
license = ""

View File

@@ -2,6 +2,7 @@ use std::path::Path;
use std::sync::atomic::{AtomicBool, AtomicI64, AtomicU64, Ordering};
use std::{path::PathBuf, sync::Arc};
use chrono::Utc;
use m3u8_rs::{MediaPlaylist, Playlist};
use reqwest::header::HeaderMap;
use std::time::Duration;
@@ -207,6 +208,11 @@ impl HlsRecorder {
)));
};
let mut segment = segment.clone();
if segment.program_date_time.is_none() {
segment.program_date_time.replace(Utc::now().into());
}
// check if the stream is changed
let segment_metadata = crate::ffmpeg::extract_video_metadata(&segment_path)
.await

View File

@@ -450,6 +450,7 @@ pub async fn generate_whole_clip(
"platform": platform,
"room_id": room_id,
"parent_id": parent_id,
"encode_danmu": encode_danmu,
})
.to_string(),
)

View File

@@ -160,8 +160,8 @@ pub enum RecorderManagerError {
SubtitleNotFound { live_id: String },
#[error("Subtitle generation failed: {error}")]
SubtitleGenerationFailed { error: String },
#[error("Invalid playlist without date time")]
InvalidPlaylistWithoutDateTime,
#[error("Invalid live id, not timestamp str")]
InvalidLiveID,
#[error("Archive danmu ass generation failed: {error}")]
ArchiveDanmuAssGenerationFailed { error: String },
}
@@ -754,11 +754,15 @@ impl RecorderManager {
.find(|t| t.tag == "X-PROGRAM-DATE-TIME");
let Some(program_date_time) = program_date_time else {
return Err(RecorderManagerError::InvalidPlaylistWithoutDateTime);
return live_id
.parse::<i64>()
.map_err(|_| RecorderManagerError::InvalidLiveID);
};
let Some(value) = &program_date_time.rest else {
return Err(RecorderManagerError::InvalidPlaylistWithoutDateTime);
return live_id
.parse::<i64>()
.map_err(|_| RecorderManagerError::InvalidLiveID);
};
// example: "2025-10-18T17:18:17.004+0800"