Update: Applied Black formatting

This commit is contained in:
Orihara Izaya
2023-10-09 15:56:25 +02:00
parent f92830facc
commit dc2ee55c4a
5 changed files with 48 additions and 27 deletions
+7 -5
View File
@@ -28,7 +28,7 @@ class TranscriptGenerator:
"""
for i, source in enumerate(input_sources):
try:
if source.startswith('http'):
if source.startswith("http"):
mp4_filename = f"audio_{i + 1}.mp4"
wav_filename = f"audio_{i + 1}.wav"
self.file_manager.download_youtube_audio(source, mp4_filename)
@@ -36,11 +36,13 @@ class TranscriptGenerator:
else:
wav_filename = self.file_manager.load_local_file(source)
self.transcriber.transcribe(wav_filename)
json_output_file = f'result_{i + 1}.json'
txt_output_file = f'transcripts_{i + 1}.txt'
json_output_file = f"result_{i + 1}.json"
txt_output_file = f"transcripts_{i + 1}.txt"
self.transcriber.save_transcript(json_output_file, txt_output_file)
except Exception as e:
logger.exception(f"Failed to generate transcript for source {source}. Error: {str(e)}")
logger.exception(
f"Failed to generate transcript for source {source}. Error: {str(e)}"
)
continue
logger.info('Transcription generation completed.')
logger.info("Transcription generation completed.")