lyrics-transcriber 0.35.0__py3-none-any.whl → 0.36.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.
Files changed (25) hide show
  1. lyrics_transcriber/cli/cli_main.py +2 -0
  2. lyrics_transcriber/core/config.py +1 -1
  3. lyrics_transcriber/core/controller.py +13 -0
  4. lyrics_transcriber/frontend/dist/assets/{index-CQCER5Fo.js → index-ztlAYPYT.js} +23 -23
  5. lyrics_transcriber/frontend/dist/index.html +1 -1
  6. lyrics_transcriber/frontend/src/components/AudioPlayer.tsx +18 -7
  7. lyrics_transcriber/frontend/src/components/CorrectionMetrics.tsx +28 -26
  8. lyrics_transcriber/frontend/src/components/DetailsModal.tsx +94 -4
  9. lyrics_transcriber/frontend/src/components/EditModal.tsx +1 -1
  10. lyrics_transcriber/frontend/src/components/LyricsAnalyzer.tsx +18 -17
  11. lyrics_transcriber/frontend/src/components/ReferenceView.tsx +7 -0
  12. lyrics_transcriber/frontend/src/components/shared/components/HighlightedText.tsx +7 -4
  13. lyrics_transcriber/frontend/src/components/shared/components/SourceSelector.tsx +17 -19
  14. lyrics_transcriber/frontend/src/components/shared/hooks/useWordClick.ts +2 -2
  15. lyrics_transcriber/frontend/src/components/shared/types.ts +3 -3
  16. lyrics_transcriber/frontend/src/components/shared/utils/newlineCalculator.ts +1 -1
  17. lyrics_transcriber/frontend/src/components/shared/utils/referenceLineCalculator.ts +1 -1
  18. lyrics_transcriber/frontend/src/types.ts +3 -12
  19. lyrics_transcriber/lyrics/base_lyrics_provider.py +1 -0
  20. lyrics_transcriber/lyrics/file_provider.py +89 -0
  21. {lyrics_transcriber-0.35.0.dist-info → lyrics_transcriber-0.36.1.dist-info}/METADATA +1 -1
  22. {lyrics_transcriber-0.35.0.dist-info → lyrics_transcriber-0.36.1.dist-info}/RECORD +25 -24
  23. {lyrics_transcriber-0.35.0.dist-info → lyrics_transcriber-0.36.1.dist-info}/LICENSE +0 -0
  24. {lyrics_transcriber-0.35.0.dist-info → lyrics_transcriber-0.36.1.dist-info}/WHEEL +0 -0
  25. {lyrics_transcriber-0.35.0.dist-info → lyrics_transcriber-0.36.1.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,89 @@
1
+ from pathlib import Path
2
+ import logging
3
+ from typing import Optional, Dict, Any
4
+ from .base_lyrics_provider import BaseLyricsProvider, LyricsProviderConfig
5
+ from lyrics_transcriber.types import LyricsData, LyricsMetadata
6
+ from karaoke_lyrics_processor import KaraokeLyricsProcessor
7
+
8
+
9
+ class FileProvider(BaseLyricsProvider):
10
+ """Provider that loads lyrics from a local file."""
11
+
12
+ def __init__(self, config: LyricsProviderConfig, logger: Optional[logging.Logger] = None):
13
+ super().__init__(config, logger)
14
+ self.config = config # Store the config for use in other methods
15
+ self.logger.debug(f"FileProvider initialized with config: {config}")
16
+ self.title = None # Initialize title
17
+ self.artist = None # Initialize artist
18
+
19
+ def get_lyrics(self, artist: str, title: str) -> Optional[LyricsData]:
20
+ """Get lyrics for the specified artist and title."""
21
+ self.title = title # Store title for use in other methods
22
+ self.artist = artist # Store artist for use in other methods
23
+ return super().get_lyrics(artist, title)
24
+
25
+ def _fetch_data_from_source(self, artist: str, title: str) -> Optional[Dict[str, Any]]:
26
+ """Load lyrics from the specified file."""
27
+ self.logger.info(f"Attempting to fetch lyrics from file for {artist} - {title}")
28
+
29
+ if not self.config.lyrics_file:
30
+ self.logger.warning("No lyrics file specified in config")
31
+ return None
32
+
33
+ lyrics_file = Path(self.config.lyrics_file)
34
+ self.logger.debug(f"Looking for lyrics file at: {lyrics_file} (absolute: {lyrics_file.absolute()})")
35
+
36
+ if not lyrics_file.exists():
37
+ self.logger.error(f"Lyrics file not found: {lyrics_file}")
38
+ return None
39
+
40
+ self.logger.info(f"Found lyrics file: {lyrics_file}")
41
+ self.logger.debug(f"File size: {lyrics_file.stat().st_size} bytes")
42
+
43
+ try:
44
+ processor = KaraokeLyricsProcessor(
45
+ log_level=self.logger.getEffectiveLevel(),
46
+ log_formatter=self.logger.handlers[0].formatter if self.logger.handlers else None,
47
+ input_filename=str(lyrics_file),
48
+ max_line_length=self.max_line_length,
49
+ )
50
+
51
+ self.logger.debug("Created KaraokeLyricsProcessor instance")
52
+ processed_text = processor.process()
53
+ self.logger.debug(f"Processed text length: {len(processed_text)} characters")
54
+ self.logger.debug(f"First 100 characters of processed text: {processed_text[:100]}...")
55
+
56
+ result = {"text": processed_text, "source": "file", "filepath": str(lyrics_file)}
57
+ self.logger.info("Successfully processed lyrics file")
58
+ self.logger.debug(f"Returning result dictionary: {result}")
59
+ return result
60
+
61
+ except Exception as e:
62
+ self.logger.error(f"Error processing lyrics file: {str(e)}", exc_info=True)
63
+ return None
64
+
65
+ def _convert_result_format(self, raw_data: Dict[str, Any]) -> LyricsData:
66
+ """Convert the raw file data to LyricsData format."""
67
+ self.logger.debug(f"Converting raw data to LyricsData format: {raw_data}")
68
+
69
+ try:
70
+ # Create metadata object like Genius provider does
71
+ metadata = LyricsMetadata(
72
+ source="file",
73
+ track_name=self.title,
74
+ artist_names=self.artist,
75
+ lyrics_provider="file",
76
+ lyrics_provider_id=raw_data["filepath"],
77
+ is_synced=False,
78
+ provider_metadata={"filepath": raw_data["filepath"]},
79
+ )
80
+
81
+ lyrics_data = LyricsData(
82
+ source="file", lyrics=raw_data["text"], segments=[], metadata=metadata # No timing information from file
83
+ )
84
+ self.logger.debug(f"Created LyricsData object: {lyrics_data}")
85
+ return lyrics_data
86
+
87
+ except Exception as e:
88
+ self.logger.error(f"Error converting result format: {str(e)}", exc_info=True)
89
+ raise
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: lyrics-transcriber
3
- Version: 0.35.0
3
+ Version: 0.36.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
@@ -1,9 +1,9 @@
1
1
  lyrics_transcriber/__init__.py,sha256=JpdjDK1MH_Be2XiSQWnb4i5Bbil1uPMA_KcuDZ3cyUI,240
2
2
  lyrics_transcriber/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- lyrics_transcriber/cli/cli_main.py,sha256=TFB7CwzgLuwPfoV7ggPPe5dh4WKNcWRoZkCu_WWUcLQ,9818
3
+ lyrics_transcriber/cli/cli_main.py,sha256=I4YXULnIA_H9ESmXdEspOcidY2n24KdUkOTDZb7r680,9967
4
4
  lyrics_transcriber/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- lyrics_transcriber/core/config.py,sha256=y6MsAL0gFz7zRErtRRF81Z0vFOrySIrCw2aKDHExBz8,1160
6
- lyrics_transcriber/core/controller.py,sha256=iLDbMcn1BD1bTBiT9JDTBlLXs-2Frex-I_CKig3gdqk,17844
5
+ lyrics_transcriber/core/config.py,sha256=yR0hG4BFEgyzd1hdb27t5B2RI7eYdAvQ9w9RUnoIpuY,1197
6
+ lyrics_transcriber/core/controller.py,sha256=ouMtp8oiXPzEp10Z_24frlb6CbUaUZWyWZacmQ36U0s,18607
7
7
  lyrics_transcriber/correction/anchor_sequence.py,sha256=YpKyY24Va5i4JgzP9ssqlOIkaYu060KaldiehbfgTdk,22200
8
8
  lyrics_transcriber/correction/corrector.py,sha256=RVANu99cX-fmgr70C5aKZKjNOnu8o8NyJVqQ1wRGUqo,13342
9
9
  lyrics_transcriber/correction/handlers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -21,8 +21,8 @@ lyrics_transcriber/correction/phrase_analyzer.py,sha256=dtO_2LjxnPdHJM7De40mYIdH
21
21
  lyrics_transcriber/correction/text_utils.py,sha256=VkOqgZHa9wEqLJdVNi4-KLFojQ6d4lWOGl_Y_vknenU,808
22
22
  lyrics_transcriber/frontend/.gitignore,sha256=lgGIPiVpFVUNSZl9oNQLelLOWUzpF7sikLW8xmsrrqI,248
23
23
  lyrics_transcriber/frontend/README.md,sha256=-D6CAfKTT7Y0V3EjlZ2fMy7fyctFQ4x2TJ9vx6xtccM,1607
24
- lyrics_transcriber/frontend/dist/assets/index-CQCER5Fo.js,sha256=cNVRhdGBCEh8WhvstqPAV2f1W34hR8qNSzUJ-NvJ0aw,424046
25
- lyrics_transcriber/frontend/dist/index.html,sha256=aicpama1D98ChWrPgrngwqBFhH03Mnx33SWB8jacE9I,400
24
+ lyrics_transcriber/frontend/dist/assets/index-ztlAYPYT.js,sha256=Gmw7wWwQyyM2T48AHKbiNfpo9EmrFYKzQP1XpbkXR6w,426233
25
+ lyrics_transcriber/frontend/dist/index.html,sha256=KMcJA7Cjy6SF5mE7yFk1MxtMoAp7a0aW2CesyMzx_0E,400
26
26
  lyrics_transcriber/frontend/dist/vite.svg,sha256=SnSK_UQ5GLsWWRyDTEAdrjPoeGGrXbrQgRw6O0qSFPs,1497
27
27
  lyrics_transcriber/frontend/eslint.config.js,sha256=3ADH23ANA4NNBKFy6nCVk65e8bx1DrVd_FIaYNnhuqA,734
28
28
  lyrics_transcriber/frontend/index.html,sha256=KfqJVONzpUyPIwV73nZRiCWlwLnFWeB3z0vzxDPNudU,376
@@ -31,30 +31,30 @@ lyrics_transcriber/frontend/package.json,sha256=7WBOIcjE3T8bg9GpJWziPYyhTe724AFn
31
31
  lyrics_transcriber/frontend/public/vite.svg,sha256=SnSK_UQ5GLsWWRyDTEAdrjPoeGGrXbrQgRw6O0qSFPs,1497
32
32
  lyrics_transcriber/frontend/src/App.tsx,sha256=yUsB9SZvOar0PKBMzmgfbJHv6fJW2mXdBExUZYgSaWY,6035
33
33
  lyrics_transcriber/frontend/src/api.ts,sha256=ORzQqlEKkFYrc78qFbOCNsSP6zW_vN2PFT_IiEwiiao,2089
34
- lyrics_transcriber/frontend/src/components/AudioPlayer.tsx,sha256=v_UBNwIBoll20z7-_yItibIhucpDPaJg6ePZF2Q62d4,4343
35
- lyrics_transcriber/frontend/src/components/CorrectionMetrics.tsx,sha256=Bp8h_x7dOq9lo2lDwj9f6Zf_lE04b6L2169YPUCKup0,5342
36
- lyrics_transcriber/frontend/src/components/DetailsModal.tsx,sha256=bQmrsneXiMD7ecEAbV_bD8_ZDQaxyV7KGpP5j999k1I,3917
37
- lyrics_transcriber/frontend/src/components/EditModal.tsx,sha256=m15ahAgWfLqz2q9qyAiFQfNCv3bNH1d2dZbPNE9sJWE,14941
34
+ lyrics_transcriber/frontend/src/components/AudioPlayer.tsx,sha256=FbrN9WHLar_Sih977icyNcYW0AQF23ZBxj7vZZfs9io,4770
35
+ lyrics_transcriber/frontend/src/components/CorrectionMetrics.tsx,sha256=TDB7eBcnAEAeJE-EaHHNIsffsappXK8eEd5RgZ2zNwE,5798
36
+ lyrics_transcriber/frontend/src/components/DetailsModal.tsx,sha256=v_AuIWqWbgnoFUj3gErPB6-0cOXQG5mcm64oNRPL_ao,9087
37
+ lyrics_transcriber/frontend/src/components/EditModal.tsx,sha256=avdnrfZ2zCmMxbdTEyr_-_g9lrVRdFhJg6zJ-ixTYEs,14874
38
38
  lyrics_transcriber/frontend/src/components/FileUpload.tsx,sha256=Q_Y2YvlVGJvucdoDBbbI2pzymycWAprrc7vtSEGuIHs,2375
39
- lyrics_transcriber/frontend/src/components/LyricsAnalyzer.tsx,sha256=mXZhfK5Us7HLv0jspT9Z5l9P0L2EfyPf3kAN0VmVxus,19173
39
+ lyrics_transcriber/frontend/src/components/LyricsAnalyzer.tsx,sha256=_MAPCC5t5LGEzLB9lzto2XpFWSFZbnwr2hiiUoi-ZnQ,19126
40
40
  lyrics_transcriber/frontend/src/components/ModeSelector.tsx,sha256=bHtjmj5DQx2CwkdL5A4fgLP3XEifu-QecPsMZVdMTmU,1422
41
- lyrics_transcriber/frontend/src/components/ReferenceView.tsx,sha256=VgeGhDlcO1bqKSU8gBH_d3MBO2_Z50J_kh7iG8QACoM,1941
41
+ lyrics_transcriber/frontend/src/components/ReferenceView.tsx,sha256=R6LmY1JEL-oHjS9HuIqDIyI_HruhtFUp4fGylJsSGqU,2183
42
42
  lyrics_transcriber/frontend/src/components/ReviewChangesModal.tsx,sha256=LokjuN0ukt6ao_ClWX3PCeQlV19V2hvEAWF0SPHzG3M,8974
43
43
  lyrics_transcriber/frontend/src/components/SegmentDetailsModal.tsx,sha256=6ME02FkFwCgDAxW49yW260N4vbr80eAJ332Ex811GOo,1643
44
44
  lyrics_transcriber/frontend/src/components/TimelineEditor.tsx,sha256=FABlfssDFKubdFmeEAv4VbvxnxugdlG8jswAUXOqfRQ,11025
45
45
  lyrics_transcriber/frontend/src/components/TranscriptionView.tsx,sha256=Zw909OCLJbUCpEOD5N2ts0nLz1oC9nXJhizdGmw8qHk,5486
46
46
  lyrics_transcriber/frontend/src/components/WordEditControls.tsx,sha256=5mMztxoYhHwn6cUhLBcBis7fA21h03tlt-U3-9yytO0,3369
47
- lyrics_transcriber/frontend/src/components/shared/components/HighlightedText.tsx,sha256=hqdJI5zL2JuJgHSQ1IsrDwR_4oZQU4TIGR7PXkGTDKk,10713
48
- lyrics_transcriber/frontend/src/components/shared/components/SourceSelector.tsx,sha256=f4PZ-XEhGvp4rZAaST_AhkZRDlVkWipYtM0_2ZhSN3c,842
47
+ lyrics_transcriber/frontend/src/components/shared/components/HighlightedText.tsx,sha256=I0b58Ap8hMFNph7XQjqK87rxZzsbs2I9fEoP211jFBw,10973
48
+ lyrics_transcriber/frontend/src/components/shared/components/SourceSelector.tsx,sha256=i6qIEx7mv6lE111oSeonarlOvb97Z1cthvqq7xM2Lig,853
49
49
  lyrics_transcriber/frontend/src/components/shared/components/Word.tsx,sha256=xed50sPTI4edKp5fwz9vLyBqTNOU4MbhTe-NEApS3JI,1324
50
50
  lyrics_transcriber/frontend/src/components/shared/constants.ts,sha256=25q1qjCwzV-hR72wSb_rJSe4dVuQ0l-piLMoZSpynGQ,488
51
- lyrics_transcriber/frontend/src/components/shared/hooks/useWordClick.ts,sha256=pgaAC_rhzGS1ppXzmcQ9IH9PSZPcQo1lJJqOJ9OqWjM,5447
51
+ lyrics_transcriber/frontend/src/components/shared/hooks/useWordClick.ts,sha256=OYv_poh0sTHRS8v0rtLScwpMXKpXnpOAq2BT-YN7wqY,5440
52
52
  lyrics_transcriber/frontend/src/components/shared/styles.ts,sha256=J1jCSuRqpk1mOFYAqJudhxeozH-q1bi-dsOibLukBJU,411
53
- lyrics_transcriber/frontend/src/components/shared/types.ts,sha256=AeNIhKUZu9sHhOClDUaBgo1myixLjpkikbuky29UCw4,2928
54
- lyrics_transcriber/frontend/src/components/shared/utils/newlineCalculator.ts,sha256=vhOP-VS7H_NIK3JSpN_yPjy6qcJqZoA6eDWopOCWB2c,1530
55
- lyrics_transcriber/frontend/src/components/shared/utils/referenceLineCalculator.ts,sha256=vzXdLDlQ1hKWfco1RB6aLztbjBg1BXL6gend34qXKd4,2753
53
+ lyrics_transcriber/frontend/src/components/shared/types.ts,sha256=jyttCqO6_m5B2kO6cTHvU1qcxeidtmBhAM9EEdmWtKg,2886
54
+ lyrics_transcriber/frontend/src/components/shared/utils/newlineCalculator.ts,sha256=11vs1l6WdpPZyWlUlr-Y2BfbGnHhMLAMVBSitkv4XmU,1516
55
+ lyrics_transcriber/frontend/src/components/shared/utils/referenceLineCalculator.ts,sha256=9u89QpkfljIzEQQjk1pVSp_nUDFjwm0xoA_sooEqK3o,2739
56
56
  lyrics_transcriber/frontend/src/main.tsx,sha256=gKJOIr1laz68BhgxWz0JXb1LNacA2oxfbypxW_B1USo,139
57
- lyrics_transcriber/frontend/src/types.ts,sha256=yv4A8AamI9VPXGqNi7rH6vdUZdDiUhTJsO2016e4u8s,2840
57
+ lyrics_transcriber/frontend/src/types.ts,sha256=yrUitI_KuZLDNEzrDuLRyio6XRfMuujZuNRt1EC3DAA,2734
58
58
  lyrics_transcriber/frontend/src/vite-env.d.ts,sha256=ZZlpNvuwQpFfe3SiAPzd5-QQ8ypmmxq5WXz6pLD63bU,38
59
59
  lyrics_transcriber/frontend/tsconfig.app.json,sha256=7aUBVcaBqEtmtfQXsbwsgBxSUng06xzQi5t4QCgWQ3E,665
60
60
  lyrics_transcriber/frontend/tsconfig.json,sha256=AOS5v1AsNPL3wGc8bt58Ybh8HHpbYrlK91q0KIzaSgs,627
@@ -63,7 +63,8 @@ lyrics_transcriber/frontend/tsconfig.tsbuildinfo,sha256=NR-Uu3EJ34W4mGOQJT-Vkp_X
63
63
  lyrics_transcriber/frontend/vite.config.d.ts,sha256=S5bdGf0pSdKM6A6RNBKwAm3EIeW_bDHYfHtesRtXU7Q,76
64
64
  lyrics_transcriber/frontend/vite.config.js,sha256=rJsgKgeHdZ3lUbab4NaNcxVsiUmmtTQee4iPweN5Ktc,165
65
65
  lyrics_transcriber/frontend/vite.config.ts,sha256=TTbbNSKnst0Q4JNuEAQ3PH7mXxD3zXkgzXZBBFnBWkU,161
66
- lyrics_transcriber/lyrics/base_lyrics_provider.py,sha256=l61XJCvazt7wb6_vIQ23N8x9Otane8Pac5nvnBVCig8,6563
66
+ lyrics_transcriber/lyrics/base_lyrics_provider.py,sha256=OAGuvuLCguzOnI1Cu2s41Y3BKIWKJZSfpzf7u3QqsME,6601
67
+ lyrics_transcriber/lyrics/file_provider.py,sha256=Id3Kt0gYUqLt0QQ0gPxu4pj1ziT66UAPZAR1D1LDeRE,4024
67
68
  lyrics_transcriber/lyrics/genius.py,sha256=x8dNOygrDRZgwK0v2qK6F6wmqGEIiXe_Edgx-IkNWHA,5003
68
69
  lyrics_transcriber/lyrics/spotify.py,sha256=8Abxc7B_1eGPOCHDJ-zVAdhWRvz0nls9LipD7L4fhV8,4004
69
70
  lyrics_transcriber/output/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -123,8 +124,8 @@ lyrics_transcriber/transcribers/audioshake.py,sha256=QzKGimVa6BovlvYFj35CbGpaGeP
123
124
  lyrics_transcriber/transcribers/base_transcriber.py,sha256=yPzUWPTCGmzE97H5Rz6g61e-qEGL77ZzUoiBOmswhts,5973
124
125
  lyrics_transcriber/transcribers/whisper.py,sha256=P0kas2_oX16MO1-Qy7U5gl5KQN-RuUIJZz7LsEFLUiE,12906
125
126
  lyrics_transcriber/types.py,sha256=xGf3hkTRcGZTTAjMVIev2i2DOU6co0QGpW8NxvaBQAA,16759
126
- lyrics_transcriber-0.35.0.dist-info/LICENSE,sha256=BiPihPDxhxIPEx6yAxVfAljD5Bhm_XG2teCbPEj_m0Y,1069
127
- lyrics_transcriber-0.35.0.dist-info/METADATA,sha256=I23-5rG95JB0m7Ew5hLebDRGZGhkw71q0dXNeXMQ_AE,5856
128
- lyrics_transcriber-0.35.0.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
129
- lyrics_transcriber-0.35.0.dist-info/entry_points.txt,sha256=ChnmR13YoalGnC3sHW0TppX5FbhEXntYIha24tVQJ1M,104
130
- lyrics_transcriber-0.35.0.dist-info/RECORD,,
127
+ lyrics_transcriber-0.36.1.dist-info/LICENSE,sha256=BiPihPDxhxIPEx6yAxVfAljD5Bhm_XG2teCbPEj_m0Y,1069
128
+ lyrics_transcriber-0.36.1.dist-info/METADATA,sha256=QSWzLdk_FD3FQta4TrvwJv105oy_GhiwK2r-dWUkaAc,5856
129
+ lyrics_transcriber-0.36.1.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
130
+ lyrics_transcriber-0.36.1.dist-info/entry_points.txt,sha256=ChnmR13YoalGnC3sHW0TppX5FbhEXntYIha24tVQJ1M,104
131
+ lyrics_transcriber-0.36.1.dist-info/RECORD,,