lyrics-transcriber 0.43.0__py3-none-any.whl → 0.43.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -63,8 +63,12 @@ class VideoGenerator:
63
63
  raise FileNotFoundError(f"Audio file not found: {audio_path}")
64
64
 
65
65
  try:
66
- # Create a temporary copy of the ASS file with a safe filename
67
- temp_ass_path = os.path.join(self.cache_dir, "temp_subtitles.ass")
66
+ # Create a temporary copy of the ASS file with a unique filename
67
+ import time
68
+
69
+ safe_prefix = "".join(c if c.isalnum() else "_" for c in output_prefix)
70
+ timestamp = int(time.time() * 1000)
71
+ temp_ass_path = os.path.join(self.cache_dir, f"temp_subtitles_{safe_prefix}_{timestamp}.ass")
68
72
  import shutil
69
73
 
70
74
  shutil.copy2(ass_path, temp_ass_path)
@@ -75,13 +79,14 @@ class VideoGenerator:
75
79
  self.logger.info(f"Video generated: {output_path}")
76
80
 
77
81
  # Clean up temporary file
78
- os.remove(temp_ass_path)
82
+ if os.path.exists(temp_ass_path):
83
+ os.remove(temp_ass_path)
79
84
  return output_path
80
85
 
81
86
  except Exception as e:
82
87
  self.logger.error(f"Failed to generate video: {str(e)}")
83
88
  # Clean up temporary file in case of error
84
- if "temp_ass_path" in locals():
89
+ if "temp_ass_path" in locals() and os.path.exists(temp_ass_path):
85
90
  try:
86
91
  os.remove(temp_ass_path)
87
92
  except:
@@ -109,8 +114,12 @@ class VideoGenerator:
109
114
  raise FileNotFoundError(f"Audio file not found: {audio_path}")
110
115
 
111
116
  try:
112
- # Create a temporary copy of the ASS file with a safe filename
113
- temp_ass_path = os.path.join(self.cache_dir, "temp_preview_subtitles.ass")
117
+ # Create a temporary copy of the ASS file with a unique filename
118
+ import time
119
+
120
+ safe_prefix = "".join(c if c.isalnum() else "_" for c in output_prefix)
121
+ timestamp = int(time.time() * 1000)
122
+ temp_ass_path = os.path.join(self.cache_dir, f"temp_preview_subtitles_{safe_prefix}_{timestamp}.ass")
114
123
  import shutil
115
124
 
116
125
  shutil.copy2(ass_path, temp_ass_path)
@@ -121,13 +130,14 @@ class VideoGenerator:
121
130
  self.logger.info(f"Preview video generated: {output_path}")
122
131
 
123
132
  # Clean up temporary file
124
- os.remove(temp_ass_path)
133
+ if os.path.exists(temp_ass_path):
134
+ os.remove(temp_ass_path)
125
135
  return output_path
126
136
 
127
137
  except Exception as e:
128
138
  self.logger.error(f"Failed to generate preview video: {str(e)}")
129
139
  # Clean up temporary file in case of error
130
- if "temp_ass_path" in locals():
140
+ if "temp_ass_path" in locals() and os.path.exists(temp_ass_path):
131
141
  try:
132
142
  os.remove(temp_ass_path)
133
143
  except:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: lyrics-transcriber
3
- Version: 0.43.0
3
+ Version: 0.43.1
4
4
  Summary: Automatically create synchronised lyrics files in ASS and MidiCo LRC formats with word-level timestamps, using Whisper and lyrics from Genius and Spotify
5
5
  License: MIT
6
6
  Author: Andrew Beveridge
@@ -130,7 +130,7 @@ lyrics_transcriber/output/lyrics_file.py,sha256=_KQyQjCOMIwQdQ0115uEAUIjQWTRmShk
130
130
  lyrics_transcriber/output/plain_text.py,sha256=XARaWcy6MeQeQCUoz0PV_bHoBw5dba-u79bjS7XucnE,3867
131
131
  lyrics_transcriber/output/segment_resizer.py,sha256=R2Z15F7aa7DQwgAf0EMNIQ-aYQhjs0JbhqoK_bW5hCA,17453
132
132
  lyrics_transcriber/output/subtitles.py,sha256=yQCR7YO3aitKnGRjfAtSwsdi6byfpEZgnCumJO16M2E,19085
133
- lyrics_transcriber/output/video.py,sha256=stthD0-sX5tdwIYCFRgp-r9VjuRJInRbyiAu5KmKyRQ,13211
133
+ lyrics_transcriber/output/video.py,sha256=L_KB33YM4X-EQBRcLIPO4ZqlNEcVwqTWKjaJZVtkN-4,13751
134
134
  lyrics_transcriber/review/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
135
135
  lyrics_transcriber/review/server.py,sha256=6_eVJfCSuP5bHvoKyIfMwnTeByWb8YkaMOcutBoF5P0,15380
136
136
  lyrics_transcriber/storage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -140,8 +140,8 @@ lyrics_transcriber/transcribers/base_transcriber.py,sha256=T3m4ZCwZ9Bpv6Jvb2hNcn
140
140
  lyrics_transcriber/transcribers/whisper.py,sha256=YcCB1ic9H6zL1GS0jD0emu8-qlcH0QVEjjjYB4aLlIQ,13260
141
141
  lyrics_transcriber/types.py,sha256=d73cDstrEI_tVgngDYYYFwjZNs6OVBuAB_QDkga7dWA,19841
142
142
  lyrics_transcriber/utils/word_utils.py,sha256=-cMGpj9UV4F6IsoDKAV2i1aiqSO8eI91HMAm_igtVMk,958
143
- lyrics_transcriber-0.43.0.dist-info/LICENSE,sha256=BiPihPDxhxIPEx6yAxVfAljD5Bhm_XG2teCbPEj_m0Y,1069
144
- lyrics_transcriber-0.43.0.dist-info/METADATA,sha256=huAjpyM3slOpREvROVRaG8THoNN-jty-Q0DbwCPm6M4,5973
145
- lyrics_transcriber-0.43.0.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
146
- lyrics_transcriber-0.43.0.dist-info/entry_points.txt,sha256=kcp-bSFkCACAEA0t166Kek0HpaJUXRo5SlF5tVrqNBU,216
147
- lyrics_transcriber-0.43.0.dist-info/RECORD,,
143
+ lyrics_transcriber-0.43.1.dist-info/LICENSE,sha256=BiPihPDxhxIPEx6yAxVfAljD5Bhm_XG2teCbPEj_m0Y,1069
144
+ lyrics_transcriber-0.43.1.dist-info/METADATA,sha256=lHgcbB3j-X8-R7MVc6sbUADN3U-ND49WefleCSIjAlM,5973
145
+ lyrics_transcriber-0.43.1.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
146
+ lyrics_transcriber-0.43.1.dist-info/entry_points.txt,sha256=kcp-bSFkCACAEA0t166Kek0HpaJUXRo5SlF5tVrqNBU,216
147
+ lyrics_transcriber-0.43.1.dist-info/RECORD,,