|
@@ -90,6 +90,7 @@ class VideoAnalyzer:
|
|
|
]
|
|
|
}
|
|
|
response = chat_session.send_message( message_content )
|
|
|
+ self.video_file.delete()
|
|
|
return response
|
|
|
|
|
|
def video_duration(self, filename):
|
|
@@ -113,7 +114,7 @@ async def main(video_path, api_key):
|
|
|
# 初始化视频分析类
|
|
|
analyzer = VideoAnalyzer(api_key )
|
|
|
for file in genai.list_files():
|
|
|
- file.delete()
|
|
|
+ print( " ", file.name )
|
|
|
duration = analyzer.video_duration( video_path )
|
|
|
print( f"视频时长为{duration}秒" )
|
|
|
if int( duration ) >= 600 or int( duration ) == 0:
|