Open reagle opened 5 years ago
My fork improves the configuration situation considerably - https://github.com/cweiske/lyrico
The plex option is a duplicate of #17.
Thanks @cweiske, but pycodestyle throws lots of errors and the program faults:
...
File "/usr/local/lib/python3.7/site-packages/lyrico/lyrico_sources/az_lyrics.py", line 115
lyrics = lyric_tag.get_text().strip()
^
TabError: inconsistent use of tabs and spaces in indentation
@abhimanyuPathania are you still maintaining this or accepting PRs?
Oh. I still use python 2 to run it and never saw this errors.
python3 tab errors fixed.
I have some PRs open since over 2 years. I don't think this repository is maintained anymore.
@cweiske, I have it working with python2, but it's the same old behavior: I have to preconfigure actions instead of just using command line options. Also, how do you specify the "plex option"?
You do not have to configure the music dir anymore. All other options still need to be configured, that's true.
There is no plex option yet. "save_to_file" will save it to the lyrics directory. I wrote that your request for a plex option is the same as issue #17.
I added a kludge in song.py
for the time being to place the txt file next to the mp3. If the lyrics_dir
has been set as '.'
, then change self.lyrics_file_path
.
Because it's a kludge at the point of writing the file, it's dumb about not knowing if a search or the file has already been done.
def save_lyrics(self):
"""
Called by self.download_lyrics to save lyrics according to
Config.save_to_file, Config.save_to_tag settings.
Handles the case if lyrics is not found. Logs errors to console
and Song object.
"""
if not self.lyrics:
Song.lyrics_errors_count += 1
print('Failed:', self.error)
return
if self.lyrics and Config.save_to_file:
try:
if self.path.startswith('./'):
self.lyrics_file_path = os.path.splitext(self.path)[0] + '.txt'
...
How about this -- check if lyrics_dir
has been set as PLEX-MODE
inside song_helper.py
(in the get_song_data(path)
function. Then, use the naming convention required by Plex (exact same filename, but with the .txt extension) to save the file.
Around line 211...
# If tag is not read or either of artist name or title is not preset
# those properties of the Song object would be intialized to None
if artist and title:
if Config.lyrics_dir == "PLEX-MODE":
song_name, song_extension = os.path.splitext(path)
lyrics_file_name = song_name + ".txt"
lyrics_file_path = os.path.join(os.path.dirname(path), lyrics_file_name)
else:
lyrics_file_name = '%s - %s.txt' % (artist, title)
lyrics_file_path = os.path.join(Config.lyrics_dir, lyrics_file_name)
else:
# Only log the following error if the tags have been read correctly but
# artist or title was simply not present in the tag.
# Else the pre-existing error due to reading of tags should be logged
if not error:
error = 'Artist name or song title not found.'```
@reagle I'm not maintaining this anymore. Got bogged down with work and life. @cweiske fork looks good and is being updated. Please use that.
This looks like a nice tool, but I find the requirement to set options before hand odd. Additionally, I can't figure out how to keep the lyrics files next to the mp3s, as plex requires.