File size: 917 Bytes
3b13b0e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
"""
定义项目中使用的数据类型
"""
from typing import List, Dict, Optional
from dataclasses import dataclass


@dataclass
class PlotPoint:
    timestamp: str
    title: str
    picture: str


@dataclass
class Commentary:
    timestamp: str
    title: str
    copywriter: str


@dataclass
class SubtitleSegment:
    start_time: float
    end_time: float
    text: str


@dataclass
class ScriptItem:
    timestamp: str
    title: str
    picture: str
    copywriter: str


@dataclass
class PipelineResult:
    output_video_path: str
    plot_points: List[PlotPoint]
    subtitle_segments: List[SubtitleSegment]
    commentaries: List[Commentary]
    final_script: List[ScriptItem]
    error: Optional[str] = None


class VideoProcessingError(Exception):
    pass


class SubtitleProcessingError(Exception):
    pass


class PlotAnalysisError(Exception):
    pass


class CopywritingError(Exception):
    pass