From dc527d0b8e99414dceaf8df72d1e7b1a1abef31e Mon Sep 17 00:00:00 2001 From: Timothy D Witham Date: Sun, 1 Sep 2024 00:27:43 -0500 Subject: [PATCH] Upgrade to CU LRC 6.6.7 which adds RCLyricsBand and fixes others --- .../scripts/metadata/Music/lyrics/.gitignore | 2 + .../scripts/metadata/Music/lyrics/README | 5 +- .../metadata/Music/lyrics/changelog.txt | 20 +++++ .../metadata/Music/lyrics/common/culrcwrap.py | 2 +- .../culrcscrapers/lyricscom/lyricsScraper.py | 7 +- .../culrcscrapers/lyricsify/lyricsScraper.py | 28 ++++++- .../culrcscrapers/megalobiz/lyricsScraper.py | 2 +- .../culrcscrapers/musixmatch/lyricsScraper.py | 32 +++++++- .../musixmatchlrc/lyricsScraper.py | 2 +- .../rclyricsband/lyricsScraper.py | 75 +++++++++++++++++++ .../metadata/Music/lyrics/lib/scrapertest.py | 44 ++++++++--- .../metadata/Music/lyrics/lib/utils.py | 5 +- .../metadata/Music/lyrics/lyricsify.py | 4 +- .../metadata/Music/lyrics/rclyricsband.py | 18 +++++ 14 files changed, 220 insertions(+), 26 deletions(-) create mode 100644 mythtv/programs/scripts/metadata/Music/lyrics/lib/culrcscrapers/rclyricsband/lyricsScraper.py create mode 100644 mythtv/programs/scripts/metadata/Music/lyrics/rclyricsband.py diff --git a/mythtv/programs/scripts/metadata/Music/lyrics/.gitignore b/mythtv/programs/scripts/metadata/Music/lyrics/.gitignore index 0164cc0d587..1ddb500e261 100644 --- a/mythtv/programs/scripts/metadata/Music/lyrics/.gitignore +++ b/mythtv/programs/scripts/metadata/Music/lyrics/.gitignore @@ -3,6 +3,8 @@ addon.xml default.py README.txt resources +lib/gui.py +lib/sync.py # twitham's extra files not needed: filetweak.py diff --git a/mythtv/programs/scripts/metadata/Music/lyrics/README b/mythtv/programs/scripts/metadata/Music/lyrics/README index 169fdea34e5..9c0d2b2a60a 100644 --- a/mythtv/programs/scripts/metadata/Music/lyrics/README +++ b/mythtv/programs/scripts/metadata/Music/lyrics/README @@ -24,6 +24,7 @@ FileLyrics 90 Yes/No musixmatchlrc 100 Yes NEW in v34 lrclib 110 Yes NEW in v34 lyricsify 130 Yes NEW in v34 +rclyricsband 140 Yes NEW in v35 2024/08 genius 200 No musixmatch 210 No NEW in v34 lyricsmode 220 No @@ -31,7 +32,7 @@ azlyrics 230 No NEW in v34 lyricscom 240 No supermusic 250 No NEW in v34 darklyrics 260 No -megalobiz 400 Yes (too slow to be earlier, was 140) +megalobiz 400 Yes (too slow to be earlier, was 150) music163 500 Yes (sometimes returns author only, was 120) @@ -52,7 +53,7 @@ Simply overwrite lib/ with the latest from the source: 2 of addon.xml in the source and update the latest version number into the header of ./common/culrcwrap.py -* ./testlyrics -k -t +* ./testlyrics.pl -k -t That's all! diff --git a/mythtv/programs/scripts/metadata/Music/lyrics/changelog.txt b/mythtv/programs/scripts/metadata/Music/lyrics/changelog.txt index 50c2e60ade1..3a256fa672b 100644 --- a/mythtv/programs/scripts/metadata/Music/lyrics/changelog.txt +++ b/mythtv/programs/scripts/metadata/Music/lyrics/changelog.txt @@ -1,3 +1,23 @@ +v6.6.7 +- fixed RCLyricsBand scraper + +v6.6.6 +- fixed several scrapers + +v6.6.5 +- added "%A - %B - %N - %T" file format + +v6.6.4 +- added "%N. %A - %T" file format + +v6.6.3 +- fix issue with empty ListItem.Property(part1) +- fix for spotify (and others) not in sync +- don't search online sources for saved lyrics files + +v6.6.2 +- improve megalobiz scraper + v6.6.1 - add supermusic scraper diff --git a/mythtv/programs/scripts/metadata/Music/lyrics/common/culrcwrap.py b/mythtv/programs/scripts/metadata/Music/lyrics/common/culrcwrap.py index da62d2f29c0..ee1c6ace33d 100644 --- a/mythtv/programs/scripts/metadata/Music/lyrics/common/culrcwrap.py +++ b/mythtv/programs/scripts/metadata/Music/lyrics/common/culrcwrap.py @@ -7,7 +7,7 @@ # UPDATE THIS from https://gitlab.com/ronie/script.cu.lrclyrics # second line of its addon.xml: -__version__ = '6.6.2' +__version__ = '6.6.7' # simulate kodi/xbmc via very simplified Kodistubs. import os diff --git a/mythtv/programs/scripts/metadata/Music/lyrics/lib/culrcscrapers/lyricscom/lyricsScraper.py b/mythtv/programs/scripts/metadata/Music/lyrics/lib/culrcscrapers/lyricscom/lyricsScraper.py index a04720c1cce..6b2dacab99d 100644 --- a/mythtv/programs/scripts/metadata/Music/lyrics/lib/culrcscrapers/lyricscom/lyricsScraper.py +++ b/mythtv/programs/scripts/metadata/Music/lyrics/lib/culrcscrapers/lyricscom/lyricsScraper.py @@ -10,6 +10,7 @@ __priority__ = '240' __lrc__ = False +UserAgent = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36"} class LyricsFetcher: def __init__(self, *args, **kwargs): @@ -25,7 +26,7 @@ def get_lyrics(self, song): lyrics.source = __title__ lyrics.lrc = __lrc__ try: - request = sess.get(self.url % urllib.parse.quote_plus(song.artist), timeout=10) + request = sess.get(self.url % urllib.parse.quote_plus(song.artist), headers=UserAgent, timeout=10) response = request.text except: return @@ -37,7 +38,7 @@ def get_lyrics(self, song): break if url: try: - req = sess.get(url, timeout=10) + req = sess.get(url, headers=UserAgent, timeout=10) resp = req.text except: return @@ -49,7 +50,7 @@ def get_lyrics(self, song): break if url: try: - req2 = sess.get(url, timeout=10) + req2 = sess.get(url, headers=UserAgent, timeout=10) resp2 = req2.text except: return diff --git a/mythtv/programs/scripts/metadata/Music/lyrics/lib/culrcscrapers/lyricsify/lyricsScraper.py b/mythtv/programs/scripts/metadata/Music/lyrics/lib/culrcscrapers/lyricsify/lyricsScraper.py index dba13e3dd9e..686709db92d 100644 --- a/mythtv/programs/scripts/metadata/Music/lyrics/lib/culrcscrapers/lyricsify/lyricsScraper.py +++ b/mythtv/programs/scripts/metadata/Music/lyrics/lib/culrcscrapers/lyricsify/lyricsScraper.py @@ -13,8 +13,9 @@ __priority__ = '130' __lrc__ = True -UserAgent = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36"} +UserAgent = {"Host": "www.lyricsify.com", "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:126.0) Gecko/20100101 Firefox/126.0", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8", "Accept-Language": "en-US,en;q=0.5", "Accept-Encoding": "gzip, deflate, br, zstd", "DNT": "1", "Alt-Used": "www.lyricsify.com", "Connection": "keep-alive", "Upgrade-Insecure-Requests": "1", "Sec-Fetch-Dest": "document", "Sec-Fetch-Mode": "navigate", "Sec-Fetch-Site": "none", "Sec-Fetch-User": "?1", "Priority": "u=1"} +# lyricsify uses captcha's & cloudflare protection for the search option, only direct lyrics access works class LyricsFetcher: def __init__(self, *args, **kwargs): @@ -23,6 +24,30 @@ def __init__(self, *args, **kwargs): self.SEARCH_URL = 'https://www.lyricsify.com/lyrics/%s/%s' self.LYRIC_URL = 'https://www.lyricsify.com%s' + def get_lyrics(self, song): + log("%s: searching lyrics for %s - %s" % (__title__, song.artist, song.title), debug=self.DEBUG) + lyrics = Lyrics(settings=self.settings) + lyrics.song = song + lyrics.source = __title__ + lyrics.lrc = __lrc__ + artist = song.artist.replace("'", '').replace('!', '').replace('?', '').replace('"', '').replace('/', '').replace('.', '').replace('&', '').replace(',', '').replace('(', '').replace(')', '').replace(' ', '-') + title = song.title.replace("'", '').replace('!', '').replace('?', '').replace('"', '').replace('/', '').replace('.', '').replace('&', '').replace(',', '').replace('(', '').replace(')', '').replace(' ', '-') + url = self.SEARCH_URL % (artist.lower(), title.lower()) + try: + log('%s: search url: %s' % (__title__, url), debug=self.DEBUG) + search = requests.get(url, headers=UserAgent, timeout=10) + response = search.text + except: + return None + matchcode = re.search('details">(.*?)', '', lyricscode) + lyrics.lyrics = lyr + return lyrics + return None + +''' def get_lyrics(self, song): log("%s: searching lyrics for %s - %s" % (__title__, song.artist, song.title), debug=self.DEBUG) lyrics = Lyrics(settings=self.settings) @@ -73,3 +98,4 @@ def get_lyrics_from_list(self, link): lyricscode = (matchcode.group(1)) cleanlyrics = re.sub('<[^<]+?>', '', lyricscode) return cleanlyrics +''' diff --git a/mythtv/programs/scripts/metadata/Music/lyrics/lib/culrcscrapers/megalobiz/lyricsScraper.py b/mythtv/programs/scripts/metadata/Music/lyrics/lib/culrcscrapers/megalobiz/lyricsScraper.py index 2a90ee2bfb0..43c8b21ffc2 100644 --- a/mythtv/programs/scripts/metadata/Music/lyrics/lib/culrcscrapers/megalobiz/lyricsScraper.py +++ b/mythtv/programs/scripts/metadata/Music/lyrics/lib/culrcscrapers/megalobiz/lyricsScraper.py @@ -13,7 +13,7 @@ from lib.utils import * __title__ = "Megalobiz" -__priority__ = '140' +__priority__ = '150' __lrc__ = True diff --git a/mythtv/programs/scripts/metadata/Music/lyrics/lib/culrcscrapers/musixmatch/lyricsScraper.py b/mythtv/programs/scripts/metadata/Music/lyrics/lib/culrcscrapers/musixmatch/lyricsScraper.py index 60e6e36b8fb..1b1aa1f3c44 100644 --- a/mythtv/programs/scripts/metadata/Music/lyrics/lib/culrcscrapers/musixmatch/lyricsScraper.py +++ b/mythtv/programs/scripts/metadata/Music/lyrics/lib/culrcscrapers/musixmatch/lyricsScraper.py @@ -10,6 +10,7 @@ import re import random import difflib +import html from bs4 import BeautifulSoup from lib.utils import * @@ -20,14 +21,40 @@ headers = {} headers['User-Agent'] = 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0' +# search is not possible as it requires javascript, only direct access to the lyrics work. class LyricsFetcher: def __init__(self, *args, **kwargs): self.DEBUG = kwargs['debug'] self.settings = kwargs['settings'] - self.SEARCH_URL = 'https://www.musixmatch.com/search/' - self.LYRIC_URL = 'https://www.musixmatch.com' + self.SEARCH_URL = 'https://www.musixmatch.com/search?query=' + self.LYRIC_URL = 'https://www.musixmatch.com/lyrics/%s/%s' + def get_lyrics(self, song): + log("%s: searching lyrics for %s - %s" % (__title__, song.artist, song.title), debug=self.DEBUG) + lyrics = Lyrics(settings=self.settings) + lyrics.song = song + lyrics.source = __title__ + lyrics.lrc = __lrc__ + artist = song.artist.replace("'", '').replace('!', '').replace('?', '').replace('"', '').replace('/', '').replace('.', '').replace('&', '').replace(',', '').replace('(', '').replace(')', '').replace(' ', '-') + title = song.title.replace("'", '').replace('!', '').replace('?', '').replace('"', '').replace('/', '').replace('.', '').replace('&', '').replace(',', '').replace('(', '').replace(')', '').replace(' ', '-') + url = self.LYRIC_URL % (artist, title) + try: + log('%s: search url: %s' % (__title__, url), debug=self.DEBUG) + search = requests.get(url, headers=headers, timeout=10) + response = search.text + except: + return None + matchcode = re.search('Lyrics of (.*?)Writer\(s\): ', response, flags=re.DOTALL) + if matchcode: + lyricscode = (matchcode.group(1)) + lyr = re.sub('<[^<]+?>', '\n', lyricscode) + lyr = html.unescape(lyr) + lyrics.lyrics = lyr.replace('\n\n\n\n', '\n') + return lyrics + return None + +''' def get_lyrics(self, song): log("%s: searching lyrics for %s - %s" % (__title__, song.artist, song.title), debug=self.DEBUG) lyrics = Lyrics(settings=self.settings) @@ -84,3 +111,4 @@ def get_lyrics_from_list(self, link): for part in lyr: lyrics = lyrics + part.get_text() + '\n' return lyrics +''' diff --git a/mythtv/programs/scripts/metadata/Music/lyrics/lib/culrcscrapers/musixmatchlrc/lyricsScraper.py b/mythtv/programs/scripts/metadata/Music/lyrics/lib/culrcscrapers/musixmatchlrc/lyricsScraper.py index 783f818e8ce..74a7598ade2 100644 --- a/mythtv/programs/scripts/metadata/Music/lyrics/lib/culrcscrapers/musixmatchlrc/lyricsScraper.py +++ b/mythtv/programs/scripts/metadata/Music/lyrics/lib/culrcscrapers/musixmatchlrc/lyricsScraper.py @@ -78,7 +78,7 @@ def get_lyrics(self, song): search = '%s - %s' % (artist, title) try: url = self.SEARCH_URL % 'track.search' - query = [('q', search), ('page_size', '5'), ('page', '1'), ('s_track_rating', 'desc'), ('quorum_factor', '1.0'), ('app_id', 'web-desktop-app-v1.0'), ('usertoken', self.token), ('t', self.current_time)] + query = [('q', search), ('page_size', '5'), ('page', '1'), ('app_id', 'web-desktop-app-v1.0'), ('usertoken', self.token), ('t', self.current_time)] response = requests.get(url, params=query, timeout=10) result = response.json() except: diff --git a/mythtv/programs/scripts/metadata/Music/lyrics/lib/culrcscrapers/rclyricsband/lyricsScraper.py b/mythtv/programs/scripts/metadata/Music/lyrics/lib/culrcscrapers/rclyricsband/lyricsScraper.py new file mode 100644 index 00000000000..bfd33e796d7 --- /dev/null +++ b/mythtv/programs/scripts/metadata/Music/lyrics/lib/culrcscrapers/rclyricsband/lyricsScraper.py @@ -0,0 +1,75 @@ +#-*- coding: utf-8 -*- +''' +Scraper for https://www.rclyricsband.com/ +''' + +import requests +import re +import difflib +import html +from bs4 import BeautifulSoup +from lib.utils import * + +__title__ = "RCLyricsBand" +__priority__ = '140' +__lrc__ = True + +UserAgent = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36"} + +class LyricsFetcher: + def __init__(self, *args, **kwargs): + self.DEBUG = kwargs['debug'] + self.settings = kwargs['settings'] + self.SEARCH_URL = 'https://rclyricsband.com/' + self.LYRIC_URL = 'https://rclyricsband.com/%s' + + + def get_lyrics(self, song): + log("%s: searching lyrics for %s - %s" % (__title__, song.artist, song.title), debug=self.DEBUG) + lyrics = Lyrics(settings=self.settings) + lyrics.song = song + lyrics.source = __title__ + lyrics.lrc = __lrc__ + artist = song.artist + title = song.title + try: + url = self.SEARCH_URL + searchdata = {} + searchdata['search'] = '%s %s' % (artist, title) + search = requests.post(url, data=searchdata, headers=UserAgent, timeout=10) + response = search.text + except: + return None + links = [] + soup = BeautifulSoup(response, 'html.parser') + for link in soup.find_all('a', {'class': 'song_search'}): + if link.string: + foundsong = link.string.split(' - ')[0] + foundartist = link.string.split(' - ')[-1] + if (difflib.SequenceMatcher(None, artist.lower(), foundartist.lower()).ratio() > 0.8) and (difflib.SequenceMatcher(None, title.lower(), foundsong.lower()).ratio() > 0.8): + links.append((foundartist + ' - ' + foundsong, self.LYRIC_URL % link.get('href'), foundartist, foundsong)) + if len(links) == 0: + return None + elif len(links) > 1: + lyrics.list = links + for link in links: + lyr = self.get_lyrics_from_list(link) + if lyr: + lyrics.lyrics = lyr + return lyrics + return None + + def get_lyrics_from_list(self, link): + title,url,artist,song = link + try: + log('%s: search url: %s' % (__title__, url), debug=self.DEBUG) + search = requests.get(url, headers=UserAgent, timeout=10) + response = search.text + except: + return None + matchcode = re.search("lrc_text_format'>(.*?)', '\n', lyricscode) + cleanlyrics = html.unescape(cleanlyrics) + return cleanlyrics diff --git a/mythtv/programs/scripts/metadata/Music/lyrics/lib/scrapertest.py b/mythtv/programs/scripts/metadata/Music/lyrics/lib/scrapertest.py index 9b64c98414f..2ced98b976b 100644 --- a/mythtv/programs/scripts/metadata/Music/lyrics/lib/scrapertest.py +++ b/mythtv/programs/scripts/metadata/Music/lyrics/lib/scrapertest.py @@ -12,6 +12,7 @@ from lib.culrcscrapers.music163 import lyricsScraper as lyricsScraper_music163 from lib.culrcscrapers.musixmatch import lyricsScraper as lyricsScraper_musixmatch from lib.culrcscrapers.musixmatchlrc import lyricsScraper as lyricsScraper_musixmatchlrc +from lib.culrcscrapers.rclyricsband import lyricsScraper as lyricsScraper_rclyricsband from lib.culrcscrapers.supermusic import lyricsScraper as lyricsScraper_supermusic FAILED = [] @@ -47,7 +48,7 @@ def test_scrapers(): return # test darklyrics - dialog.update(8, LANGUAGE(32163) % 'darklyrics') + dialog.update(7, LANGUAGE(32163) % 'darklyrics') log('==================== darklyrics ====================', debug=True) song = Song(opt=lyricssettings) song.artist = 'Neurosis' @@ -66,7 +67,7 @@ def test_scrapers(): return # test genius - dialog.update(16, LANGUAGE(32163) % 'genius') + dialog.update(14, LANGUAGE(32163) % 'genius') log('==================== genius ====================', debug=True) song = Song(opt=lyricssettings) song.artist = 'Maren Morris' @@ -85,7 +86,7 @@ def test_scrapers(): return # test lrclib - dialog.update(24, LANGUAGE(32163) % 'lrclib') + dialog.update(21, LANGUAGE(32163) % 'lrclib') log('==================== lrclib ====================', debug=True) song = Song(opt=lyricssettings) song.artist = 'CHVRCHES' @@ -104,7 +105,7 @@ def test_scrapers(): return # test lyricscom - dialog.update(32, LANGUAGE(32163) % 'lyricscom') + dialog.update(28, LANGUAGE(32163) % 'lyricscom') log('==================== lyricscom ====================', debug=True) song = Song(opt=lyricssettings) song.artist = 'Blur' @@ -123,11 +124,11 @@ def test_scrapers(): return # test lyricsify - dialog.update(40, LANGUAGE(32163) % 'lyricsify') + dialog.update(35, LANGUAGE(32163) % 'lyricsify') log('==================== lyricsify ====================', debug=True) song = Song(opt=lyricssettings) - song.artist = 'Madonna' - song.title = 'Crazy For You' + song.artist = 'Tears For Fears' + song.title = 'Shout' st = time.time() lyrics = lyricsScraper_lyricsify.LyricsFetcher(settings=lyricssettings, debug=True).get_lyrics(song) ft = time.time() @@ -142,7 +143,7 @@ def test_scrapers(): return # test lyricsmode - dialog.update(48, LANGUAGE(32163) % 'lyricsmode') + dialog.update(42, LANGUAGE(32163) % 'lyricsmode') log('==================== lyricsmode ====================', debug=True) song = Song(opt=lyricssettings) song.artist = 'Maren Morris' @@ -161,7 +162,7 @@ def test_scrapers(): return # test megalobiz - dialog.update(56, LANGUAGE(32163) % 'megalobiz') + dialog.update(50, LANGUAGE(32163) % 'megalobiz') log('==================== megalobiz ====================', debug=True) song = Song(opt=lyricssettings) song.artist = 'Michael Jackson' @@ -180,7 +181,7 @@ def test_scrapers(): return # test music163 - dialog.update(64, LANGUAGE(32163) % 'music163') + dialog.update(58, LANGUAGE(32163) % 'music163') log('==================== music163 ====================', debug=True) song = Song(opt=lyricssettings) song.artist = 'Madonna' @@ -199,7 +200,7 @@ def test_scrapers(): return # test musixmatch - dialog.update(72, LANGUAGE(32163) % 'musixmatch') + dialog.update(66, LANGUAGE(32163) % 'musixmatch') log('==================== musixmatch ====================', debug=True) song = Song(opt=lyricssettings) song.artist = 'Kate Bush' @@ -218,7 +219,7 @@ def test_scrapers(): return # test musixmatchlrc - dialog.update(80, LANGUAGE(32163) % 'musixmatchlrc') + dialog.update(73, LANGUAGE(32163) % 'musixmatchlrc') log('==================== musixmatchlrc ====================', debug=True) song = Song(opt=lyricssettings) song.artist = 'Kate Bush' @@ -236,6 +237,25 @@ def test_scrapers(): if dialog.iscanceled(): return + # test rclyricsband + dialog.update(80, LANGUAGE(32163) % 'rclyricsband') + log('==================== rclyricsband ====================', debug=True) + song = Song(opt=lyricssettings) + song.artist = 'Taylor Swift' + song.title = 'The Archer' + st = time.time() + lyrics = lyricsScraper_rclyricsband.LyricsFetcher(settings=lyricssettings, debug=True).get_lyrics(song) + ft = time.time() + tt = ft - st + TIMINGS.append(['rclyricsband',tt]) + if lyrics: + log(lyrics.lyrics, debug=True) + else: + FAILED.append('rclyricsband') + log('FAILED: rclyricsband', debug=True) + if dialog.iscanceled(): + return + # test supermusic dialog.update(88, LANGUAGE(32163) % 'supermusic') log('==================== supermusic ====================', debug=True) diff --git a/mythtv/programs/scripts/metadata/Music/lyrics/lib/utils.py b/mythtv/programs/scripts/metadata/Music/lyrics/lib/utils.py index 03f30cc3d48..582485f3bcd 100644 --- a/mythtv/programs/scripts/metadata/Music/lyrics/lib/utils.py +++ b/mythtv/programs/scripts/metadata/Music/lyrics/lib/utils.py @@ -68,7 +68,7 @@ def get_artist_from_filename(*args, **kwargs): elif SETTING_READ_FILENAME_FORMAT == 2: title = os.path.splitext(basename)[0].split(' ', 1)[1].lstrip('-').strip() # Track Artist - title.ext - elif SETTING_READ_FILENAME_FORMAT == 3: + elif SETTING_READ_FILENAME_FORMAT in (3,5): at = basename.split(' ', 1)[1].strip() artist = at.split('-', 1)[0].strip() title = os.path.splitext(at.split('-', 1)[1].strip())[0] @@ -76,6 +76,9 @@ def get_artist_from_filename(*args, **kwargs): elif SETTING_READ_FILENAME_FORMAT == 4: artist = basename.split('-', 2)[1].strip() title = os.path.splitext(basename.split('-', 2)[2].strip())[0] + elif SETTING_READ_FILENAME_FORMAT == 6: + artist = basename.split('-', 1)[0].strip() + title = os.path.splitext(basename.split('-', 3)[3].strip())[0] except: # invalid format selected log('failed to get artist and title from filename', debug=DEBUG) diff --git a/mythtv/programs/scripts/metadata/Music/lyrics/lyricsify.py b/mythtv/programs/scripts/metadata/Music/lyrics/lyricsify.py index 6b96885e910..be21e11af47 100644 --- a/mythtv/programs/scripts/metadata/Music/lyrics/lyricsify.py +++ b/mythtv/programs/scripts/metadata/Music/lyrics/lyricsify.py @@ -10,8 +10,8 @@ 'author': 'ronie', 'priority': '130', 'syncronized': True, - 'artist': 'Madonna', - 'title': 'Crazy For You', + 'artist': 'Tears For Fears', + 'title': 'Shout', } if __name__ == '__main__': diff --git a/mythtv/programs/scripts/metadata/Music/lyrics/rclyricsband.py b/mythtv/programs/scripts/metadata/Music/lyrics/rclyricsband.py new file mode 100644 index 00000000000..18295cf2000 --- /dev/null +++ b/mythtv/programs/scripts/metadata/Music/lyrics/rclyricsband.py @@ -0,0 +1,18 @@ +# -*- Mode: python; coding: utf-8; indent-tabs-mode: nil; -*- + +from common import culrcwrap +from lib.culrcscrapers.rclyricsband.lyricsScraper import LyricsFetcher +# make sure this-------^^^^^^^^^ matches this file's basename + +info = { + 'name': 'RCLyricsBand', + 'description': 'Search http://www.rclyricsband.com for lyrics', + 'author': 'ronie', + 'priority': '140', + 'syncronized': True, + 'artist': 'Taylor Swift', + 'title': 'The Archer', +} + +if __name__ == '__main__': + culrcwrap.main(__file__, info, LyricsFetcher)