diff --git a/lLyrics/AZLyricsParser.py b/lLyrics/AZLyricsParser.py index fcb5830..b6d84d3 100755 --- a/lLyrics/AZLyricsParser.py +++ b/lLyrics/AZLyricsParser.py @@ -18,13 +18,13 @@ import Util + class Parser(object): - def __init__(self, artist, title): self.artist = artist self.title = title self.lyrics = "" - + def parse(self): # remove unwanted characters from artist and title strings clean_artist = self.artist @@ -33,11 +33,11 @@ def parse(self): clean_artist = clean_artist.replace(" and ", "") clean_artist = clean_artist.replace(" ", "") clean_artist = Util.remove_punctuation(clean_artist) - + clean_title = self.title clean_title = clean_title.replace(" ", "") clean_title = Util.remove_punctuation(clean_title) - + # create lyrics Url url = "http://www.azlyrics.com/lyrics/" + clean_artist + "/" + clean_title + ".html" print("azlyrics Url " + url) @@ -46,30 +46,29 @@ def parse(self): except: print("could not connect to azlyrics.com") return "" - + resp = Util.bytes_to_string(resp) self.lyrics = self.get_lyrics(resp) self.lyrics = string.capwords(self.lyrics, "\n").strip() - + return self.lyrics - + def get_lyrics(self, resp): # cut HTML source to relevant part start = resp.find("that. -->") if start == -1: print("lyrics start not found") return "" - resp = resp[(start+9):] + resp = resp[(start + 9):] end = resp.find("") if end == -1: print("lyrics end not found ") return "" - resp = resp[:(end-1)] - + resp = resp[:(end - 1)] + # replace unwanted parts resp = resp.replace("
", "") resp = resp.replace("", "") resp = resp.replace("", "") - + return resp - diff --git a/lLyrics/ChartlyricsParser.py b/lLyrics/ChartlyricsParser.py index fd3bc02..1a34896 100755 --- a/lLyrics/ChartlyricsParser.py +++ b/lLyrics/ChartlyricsParser.py @@ -24,8 +24,8 @@ import Util + class Parser(HTMLParser): - def __init__(self, artist, title): HTMLParser.__init__(self) self.artist = artist @@ -33,15 +33,15 @@ def __init__(self, artist, title): self.tag = None self.correct = True self.lyrics = "" - + # define handler for parsing def handle_starttag(self, tag, attrs): self.tag = tag - + # definde handler for parsing def handle_endtag(self, tag): self.tag = None - + # definde handler for parsing def handle_data(self, data): if self.tag == "lyricsong": @@ -54,20 +54,20 @@ def handle_data(self, data): return if self.correct and self.tag == "lyric": self.lyrics = data - + def parse(self): # API searchLyric request - url = "http://api.chartlyrics.com/apiv1.asmx/SearchLyricDirect?artist=" + urllib.parse.quote(self.artist) + "&song=" + urllib.parse.quote(self.title) + url = "http://api.chartlyrics.com/apiv1.asmx/SearchLyricDirect?artist=" + urllib.parse.quote( + self.artist) + "&song=" + urllib.parse.quote(self.title) print("call chartlyrics API: " + url) try: resp = urllib.request.urlopen(url, None, 3).read() except: print("could not connect to chartlyric.com API") - + resp = Util.bytes_to_string(resp) self.feed(resp) - + self.lyrics = string.capwords(self.lyrics, "\n").strip() - + return self.lyrics - \ No newline at end of file diff --git a/lLyrics/Config.py b/lLyrics/Config.py index ad5cd6b..238bfdb 100755 --- a/lLyrics/Config.py +++ b/lLyrics/Config.py @@ -26,15 +26,14 @@ import lLyrics import lLyrics_rb3compat as Compat - DCONF_DIR = 'org.gnome.rhythmbox.plugins.llyrics' + class Config(object): - def __init__(self): self.settings = Gio.Settings(DCONF_DIR) - - def check_active_sources(self): + + def check_active_sources(self): # remove invalid entries changed = False entries = self.settings["active-sources"] @@ -43,11 +42,11 @@ def check_active_sources(self): entries.remove(source) changed = True print("remove invalid entry in active-sources: " + source) - + # update key, if changed if changed: self.settings["active-sources"] = entries - + def check_scanning_order(self): # remove invalid entries changed = False @@ -57,27 +56,27 @@ def check_scanning_order(self): entries.remove(source) changed = True print("remove invalid entry in scanning-order: " + source) - + # fill up missing keys for source in lLyrics.LYRICS_SOURCES: if source not in entries: entries.append(source) changed = True print("append missing entry in scanning-order: " + source) - + # update key, if changed if changed: self.settings["scanning-order"] = entries - + def check_lyrics_folder(self): folder = self.settings["lyrics-folder"] changed = False - + # expand user directory if "~" in folder: folder = os.path.expanduser(folder) changed = True - + # path not set or invalid if not folder or not os.path.exists(folder): folder = os.path.join(RB.user_cache_dir(), "lyrics") @@ -86,13 +85,13 @@ def check_lyrics_folder(self): os.mkdir(folder) changed = True print("invalid path in lyrics-folder, set to default") - + if changed: self.settings["lyrics-folder"] = folder - + def get_settings(self): return self.settings - + def get_lyrics_sources(self): self.check_active_sources() self.check_scanning_order() @@ -100,30 +99,29 @@ def get_lyrics_sources(self): for source in self.settings["scanning-order"]: if source in self.settings["active-sources"]: lyrics_sources.append(source) - + return lyrics_sources - + def get_show_first(self): return self.settings["show-first"] - + def get_cache_lyrics(self): return self.settings["cache-lyrics"] - + def get_lyrics_folder(self): self.check_lyrics_folder() return self.settings["lyrics-folder"] - + def get_ignore_brackets(self): return self.settings["ignore-brackets"] - + def get_left_sidebar(self): return self.settings["left-sidebar"] - + def get_hide_label(self): return self.settings["hide-label"] - - - + + class ConfigDialog(GObject.Object, PeasGtk.Configurable): __gtype_name__ = 'lLyricsConfigDialog' object = GObject.property(type=GObject.Object) @@ -138,93 +136,94 @@ def do_create_configure_widget(self): # page 1 for general settings page1 = Gtk.VBox() - + # switch for show-first hbox = Gtk.HBox() switch = Gtk.Switch() switch.set_active(self.settings["show-first"]) switch.connect("notify::active", self.switch_toggled, "show-first") - + label = Gtk.Label("" + _("Show sidebar on first playback") + "") label.set_use_markup(True) - + hbox.pack_start(label, False, False, 5) hbox.pack_start(switch, False, False, 5) page1.pack_start(hbox, False, False, 10) - + # switch for cache-lyrics hbox = Gtk.HBox() switch = Gtk.Switch() switch.set_active(self.settings["cache-lyrics"]) switch.connect("notify::active", self.switch_toggled, "cache-lyrics") - + label = Gtk.Label("" + _("Save lyrics ") + "") label.set_use_markup(True) - - descr = Gtk.Label("" + _("Whether to automatically save retrieved lyrics in the folder specified below") + "") + + descr = Gtk.Label( + "" + _("Whether to automatically save retrieved lyrics in the folder specified below") + "") descr.set_alignment(0, 0) descr.set_margin_left(15) descr.set_line_wrap(True) descr.set_use_markup(True) - + hbox.pack_start(label, False, False, 5) hbox.pack_start(switch, False, False, 5) vbox = Gtk.VBox() vbox.pack_start(hbox, False, False, 0) vbox.pack_start(descr, False, False, 0) page1.pack_start(vbox, False, False, 10) - + # file chooser for lyrics-folder hbox = Gtk.HBox() file_chooser = Gtk.FileChooserButton() file_chooser.set_action(Gtk.FileChooserAction.SELECT_FOLDER) file_chooser.set_current_folder(self.settings["lyrics-folder"]) file_chooser.connect("current-folder-changed", self.folder_set) - + default_button = Gtk.Button(_("default")) default_button.connect("clicked", self.set_folder_default, file_chooser) - + label = Gtk.Label("" + _("Folder for lyrics") + "") label.set_use_markup(True) - + hbox.pack_start(label, False, False, 5) hbox.pack_start(file_chooser, True, True, 5) hbox.pack_start(default_button, False, False, 5) page1.pack_start(hbox, False, False, 10) - + # switch for ignore-brackets hbox = Gtk.HBox() switch = Gtk.Switch() switch.set_active(self.settings["ignore-brackets"]) switch.connect("notify::active", self.switch_toggled, "ignore-brackets") - + label = Gtk.Label("" + _("Always ignore parentheses in song title") + "") label.set_use_markup(True) - + descr = Gtk.Label("" + _("When turned off, only parentheses containing specific strings " - "(e.g. 'remix', 'live', 'edit', etc) are filtered") + "") + "(e.g. 'remix', 'live', 'edit', etc) are filtered") + "") descr.set_alignment(0, 0) descr.set_margin_left(15) descr.set_line_wrap(True) descr.set_use_markup(True) - + hbox.pack_start(label, False, False, 5) hbox.pack_start(switch, False, False, 5) vbox = Gtk.VBox() vbox.pack_start(hbox, False, False, 0) vbox.pack_start(descr, False, False, 0) - + page1.pack_start(vbox, False, False, 10) - + # page 2 for sources settings page2 = Gtk.VBox() - + # check buttons for lyric sources label = Gtk.Label("" + _("Sources:") + "") label.set_alignment(0, 0) label.set_padding(5, 0) label.set_use_markup(True) - + vbox = Gtk.VBox() vbox.set_margin_left(30) vbox.set_margin_top(5) @@ -235,102 +234,102 @@ def do_create_configure_widget(self): check.set_active(source in self.settings["active-sources"]) check.connect("toggled", self.source_toggled, source) hbox.pack_start(check, True, True, 3) - + button_up = Gtk.Button('\u2191') button_up.connect("clicked", self.reorder_sources, source, hbox, vbox, "up") hbox.pack_start(button_up, False, False, 3) if self.settings["scanning-order"].index(source) == 0: button_up.set_sensitive(False) - + button_down = Gtk.Button('\u2193') button_down.connect("clicked", self.reorder_sources, source, hbox, vbox, "down") hbox.pack_start(button_down, False, False, 3) if self.settings["scanning-order"].index(source) == len(self.settings["scanning-order"]) - 1: button_down.set_sensitive(False) - + vbox.pack_start(hbox, False, False, 0) - - warn = Gtk.Label("" + - _("Warning: 'External' calls the Rhythmbox built-in lyrics plugin. " - "It can not be guaranteed that the provided engines work properly. " - "If you experience any problems, deactivate this option.") - + "") + + warn = Gtk.Label("" + + _("Warning: 'External' calls the Rhythmbox built-in lyrics plugin. " + "It can not be guaranteed that the provided engines work properly. " + "If you experience any problems, deactivate this option.") + + "") warn.set_alignment(0, 0) warn.set_margin_left(15) warn.set_line_wrap(True) warn.set_use_markup(True) - + vbox2 = Gtk.VBox() vbox2.pack_start(label, False, False, 0) vbox2.pack_start(vbox, False, False, 0) vbox2.pack_start(warn, False, False, 0) - + page2.pack_start(vbox2, False, False, 10) - + # page 3 for appearance settings page3 = Gtk.VBox() - + # switch for hide-label hbox = Gtk.HBox() switch = Gtk.Switch() switch.set_active(self.settings["hide-label"]) switch.connect("notify::active", self.switch_toggled, "hide-label") - + label = Gtk.Label("" + _("Hide sidebar label") + "") label.set_use_markup(True) - + hbox.pack_start(label, False, False, 5) hbox.pack_start(switch, False, False, 5) - + page3.pack_start(hbox, False, False, 10) - + # switch for left-sidebar hbox = Gtk.HBox() switch = Gtk.Switch() switch.set_active(self.settings["left-sidebar"]) switch.connect("notify::active", self.switch_toggled, "left-sidebar") - + label = Gtk.Label("" + _("Show lyrics in left sidebar instead of right one") + "") label.set_use_markup(True) - + descr = Gtk.Label("" + _("You have to disable and re-enable this plugin or restart Rhythmbox " "to apply changes here") + "") descr.set_alignment(0, 0) descr.set_margin_left(15) descr.set_line_wrap(True) descr.set_use_markup(True) - + hbox.pack_start(label, False, False, 5) hbox.pack_start(switch, False, False, 5) vbox = Gtk.VBox() vbox.pack_start(hbox, False, False, 0) vbox.pack_start(descr, False, False, 0) - + page3.pack_start(vbox, False, False, 10) - + # create a notebook as top level container nb = Gtk.Notebook() nb.append_page(page1, Gtk.Label(_("General"))) nb.append_page(page2, Gtk.Label(_("Sources"))) nb.append_page(page3, Gtk.Label(_("Appearance"))) - + nb.show_all() nb.set_size_request(300, -1) - + return nb - + def switch_toggled(self, switch, active, key): self.settings[key] = switch.get_active() - + def source_toggled(self, checkbutton, source): entries = self.settings["active-sources"] if checkbutton.get_active(): entries.append(source) else: entries.remove(source) - + self.settings["active-sources"] = entries - + def reorder_sources(self, button, source, hbox, vbox, direction): rows = vbox.get_children() if direction == "up": @@ -349,20 +348,19 @@ def reorder_sources(self, button, source, hbox, vbox, direction): if new_index == 1: rows[1].get_children()[1].set_sensitive(False) rows[0].get_children()[1].set_sensitive(True) - + vbox.reorder_child(hbox, new_index) - + entries = self.settings["scanning-order"] entries.remove(source) entries.insert(new_index, source) self.settings["scanning-order"] = entries - + def folder_set(self, file_chooser): new_folder = file_chooser.get_current_folder() if self.settings["lyrics-folder"] != new_folder: print("folder changed") self.settings["lyrics-folder"] = new_folder - + def set_folder_default(self, button, file_chooser): file_chooser.set_current_folder(os.path.join(RB.user_cache_dir(), "lyrics")) - \ No newline at end of file diff --git a/lLyrics/DarklyricsParser.py b/lLyrics/DarklyricsParser.py index 227b336..6e32bca 100755 --- a/lLyrics/DarklyricsParser.py +++ b/lLyrics/DarklyricsParser.py @@ -19,19 +19,19 @@ import Util + class Parser(object): - def __init__(self, artist, title): self.artist = artist self.title = title self.lyrics = "" - + def parse(self): # remove unwanted characters from artist and title strings clean_artist = self.artist clean_artist = Util.remove_punctuation(clean_artist) clean_artist = clean_artist.replace(" ", "") - + # create artist Url url = "http://www.darklyrics.com/" + clean_artist[:1] + "/" + clean_artist + ".html" print("darklyrics artist Url " + url) @@ -40,9 +40,9 @@ def parse(self): except: print("could not connect to darklyrics.com") return "" - + resp = Util.bytes_to_string(resp) - + # find title with lyrics url match = re.search("" + self.title + "
", resp, re.I) if match is None: @@ -55,25 +55,26 @@ def parse(self): except: print("could not connect to darklyrics.com") return "" - + resp = Util.bytes_to_string(resp) - - self.track_no = url.split("#")[1] - + + self.track_no = url.split("#")[1] + self.lyrics = self.get_lyrics(resp) self.lyrics = string.capwords(self.lyrics, "\n").strip() - + return self.lyrics - + def get_lyrics(self, resp): # search for the relevant lyrics - match = re.search("

" + self.track_no + "\. " + self.title + "

", resp, re.I) + match = re.search("

" + self.track_no + "\. " + self.title + "

", + resp, re.I) if match is None: print("lyrics start not found") return "" start = match.end() resp = resp[start:] - + end = resp.find("

", "") resp = resp.replace("", "") resp = resp.replace("", "") - + return resp - diff --git a/lLyrics/External.py b/lLyrics/External.py index 2c3fb8f..be606c8 100755 --- a/lLyrics/External.py +++ b/lLyrics/External.py @@ -16,55 +16,55 @@ import threading import string + class Parser(object): - def __init__(self, artist, title): self.artist = artist self.title = title self.lyrics = "" - + self.ext_event = threading.Event() self.ext_event.set() def parse(self): self.ext_event.clear() - + try: import LyricsParse except: print("Error importing LyricsParse module") return "" - + # call the built-in lyrics plugin parser parser = LyricsParse.Parser(self.artist, self.title) parser.get_lyrics(self.receive_lyrics_from_ext_source) - + # wait for received results self.ext_event.wait() - + lyrics = self.lyrics - + if lyrics == "": return lyrics - + lyrics = self.clean_lyrics(lyrics) lyrics = string.capwords(lyrics, "\n").strip() - + return lyrics - + def receive_lyrics_from_ext_source(self, lyrics): if lyrics is None: lyrics = "" - + self.lyrics = lyrics self.ext_event.set() - + def clean_lyrics(self, lyrics): # remove the artist/title header lower = lyrics.lower() title_end = lower.find(self.title) strip_count = len(self.title) - + if title_end == 0: title_end = lower.find(self.artist) strip_count = len(self.artist) @@ -72,7 +72,6 @@ def clean_lyrics(self, lyrics): print("could not remove artist/title, not found") else: lyrics = lyrics[(title_end + strip_count):] - + lyrics = lyrics.strip() return lyrics - diff --git a/lLyrics/GeniusParser.py b/lLyrics/GeniusParser.py index a6c94c2..5b1f91c 100755 --- a/lLyrics/GeniusParser.py +++ b/lLyrics/GeniusParser.py @@ -21,8 +21,8 @@ import Util -class Parser(object): +class Parser(object): def __init__(self, artist, title): self.artist = artist self.title = title @@ -35,14 +35,14 @@ def parse(self): clean_title = Util.remove_punctuation(self.title) # create lyrics Url - url = "http://genius.com/" + clean_artist.replace(" ", "-") + "-" +clean_title.replace(" ", "-") + "-lyrics" + url = "http://genius.com/" + clean_artist.replace(" ", "-") + "-" + clean_title.replace(" ", "-") + "-lyrics" print("rapgenius Url " + url) try: resp = urllib.request.urlopen(Util.add_request_header(url), None, 3).read() except: print("could not connect to genius.com") return "" - + resp = Util.bytes_to_string(resp) self.lyrics = self.get_lyrics(resp) diff --git a/lLyrics/LetrasTerraParser.py b/lLyrics/LetrasTerraParser.py index be5a628..0c7ef22 100755 --- a/lLyrics/LetrasTerraParser.py +++ b/lLyrics/LetrasTerraParser.py @@ -19,60 +19,60 @@ import Util + class Parser(object): - def __init__(self, artist, title): self.artist = artist self.title = title self.lyrics = "" - + def parse(self): self.artist = self.artist.replace("+", "and") artist = urllib.parse.quote(self.artist) title = urllib.parse.quote(self.title) join = urllib.parse.quote(' - ') - + # create artist Url url = "http://letras.mus.br/winamp.php?t=%s%s%s" % (artist, join, title) - + print("letras.terra.com.br Url " + url) try: resp = urllib.request.urlopen(url, None, 3).read() except: print("could not connect to letras.terra.com.br") return "" - + resp = Util.bytes_to_string(resp) - + if not self.verify(resp): return "" - + self.lyrics = self.get_lyrics(resp) self.lyrics = string.capwords(self.lyrics, "\n").strip() - + return self.lyrics - + def get_lyrics(self, resp): # cut HTML source to relevant part start = resp.find("

") if start == -1: print("lyrics start not found") return "" - resp = resp[(start+6):] + resp = resp[(start + 6):] end = resp.find("

") if end == -1: print("lyrics end not found ") return "" resp = resp[:end] - + # replace unwanted parts resp = resp.replace("
", "\n") resp = resp.replace("

", "\n\n") resp = html.unescape(resp) - + return resp - + def verify(self, resp): # verify song artist/title title = resp @@ -80,41 +80,41 @@ def verify(self, resp): if start == -1: print("no title found") return False - title = title[(start+4):] - + title = title[(start + 4):] + start = title.find(">") if start == -1: print("no title start found") return False - title = title[(start+1):] - + title = title[(start + 1):] + end = title.find("") if end == -1: print("no title end found") return False title = html.unescape(title[:end]).lower() - + artist = resp start = artist.find("

") if start == -1: print("no artist found") return False - artist = artist[(start+4):] - + artist = artist[(start + 4):] + start = artist.find(">") if start == -1: print("no artist start found") return False - artist = artist[(start+1):] - + artist = artist[(start + 1):] + end = artist.find("") if end == -1: print("no artist end found") return False artist = html.unescape(artist[:end]).lower() - + if self.artist != artist or self.title != title: print("wrong artist/title! " + artist + " - " + title) return False - + return True diff --git a/lLyrics/LyricsNMusicParser.py b/lLyrics/LyricsNMusicParser.py index eccdf93..90750ca 100755 --- a/lLyrics/LyricsNMusicParser.py +++ b/lLyrics/LyricsNMusicParser.py @@ -21,18 +21,18 @@ API_KEY = "5ad5728ee39ebc05de6b8a7a154202" -class Parser(object): +class Parser(object): def __init__(self, artist, title): self.artist = artist self.title = title self.lyrics = "" - + def parse(self): # remove punctuation from artist/title clean_artist = Util.remove_punctuation(self.artist) clean_title = Util.remove_punctuation(self.title) - + # API request url = "http://api.lyricsnmusic.com/songs?api_key=" + API_KEY + "&artist=" + clean_artist.replace(" ", "+") \ + "&track=" + clean_title.replace(" ", "+") @@ -42,51 +42,51 @@ def parse(self): except: print("could not connect to lyricsnmusic.com API") return "" - + resp = Util.bytes_to_string(resp) if resp == "": return "" - + resp = json.loads(resp) - + if len(resp) == 0: return "" - + resp = self.verify(resp) if resp is None: return "" - + lyrics_url = resp["url"] print("url: " + lyrics_url) - + # open lyrics-URL try: resp = urllib.request.urlopen(Util.add_request_header(lyrics_url), None, 3).read() except: print("could not open lyricsnmusic.com lyrics url") return "" - + resp = Util.bytes_to_string(resp) self.lyrics = self.get_lyrics(resp) self.lyrics = string.capwords(self.lyrics, "\n").strip() - + return self.lyrics - + def get_lyrics(self, resp): # cut HTML source to relevant part start = resp.find("
")
         if start == -1:
             print("lyrics start not found")
             return ""
-        resp = resp[(start+28):]
+        resp = resp[(start + 28):]
         end = resp.find("
") if end == -1: print("lyrics end not found") return "" resp = resp[:end] - + return resp - + def verify(self, resp): for entry in resp: title = entry["title"].lower() @@ -94,6 +94,5 @@ def verify(self, resp): if self.artist == artist and self.title == title: return entry print("wrong artist/title! " + artist + " - " + title) - + return None - \ No newline at end of file diff --git a/lLyrics/LyricsmaniaParser.py b/lLyrics/LyricsmaniaParser.py index 05eaa1b..1895f26 100755 --- a/lLyrics/LyricsmaniaParser.py +++ b/lLyrics/LyricsmaniaParser.py @@ -18,23 +18,23 @@ import Util + class Parser(object): - def __init__(self, artist, title): self.artist = artist self.title = title self.lyrics = "" - + def parse(self): # remove unwanted characters from artist and title strings clean_artist = self.artist.replace("+", "and") clean_artist = Util.remove_punctuation(clean_artist) clean_artist = clean_artist.replace(" ", "_") - + clean_title = self.title clean_title = Util.remove_punctuation(clean_title) clean_title = clean_title.replace(" ", "_") - + # create lyrics Url url = "http://www.lyricsmania.com/" + clean_title + "_lyrics_" + clean_artist + ".html" print("lyricsmania Url " + url) @@ -43,26 +43,26 @@ def parse(self): except: print("could not connect to lyricsmania.com") return "" - + resp = Util.bytes_to_string(resp) self.lyrics = self.get_lyrics(resp) self.lyrics = string.capwords(self.lyrics, "\n").strip() - + return self.lyrics - + def get_lyrics(self, resp): # cut HTML source to relevant part start = resp.find("") if start == -1: print("lyrics start not found") return "" - resp = resp[(start+9):] + resp = resp[(start + 9):] end = resp.find("") if end == -1: print("lyrics end not found ") return "" resp = resp[:end] - + # replace unwanted parts resp = resp.replace("
\n", "\n") resp = resp.replace("\n
", "\n") @@ -73,4 +73,3 @@ def get_lyrics(self, resp): resp = "\n".join(line.strip() for line in resp.split("\n")) return resp - diff --git a/lLyrics/LyricwikiParser.py b/lLyrics/LyricwikiParser.py index 3a7efea..0737b67 100755 --- a/lLyrics/LyricwikiParser.py +++ b/lLyrics/LyricwikiParser.py @@ -19,8 +19,8 @@ import Util -class Parser(object): +class Parser(object): def __init__(self, artist, title): self.artist = artist self.title = title @@ -75,13 +75,13 @@ def get_lyrics(self, resp): if start == -1: print("lyrics start not found") return "" - resp = resp[(start+9):] + resp = resp[(start + 9):] end = resp.find("