Update: Applied Black formatting
This commit is contained in:
@@ -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.")
|
||||
|
||||
Reference in New Issue
Block a user