#1 Le 07/10/2007, à 09:24
- tnntwister
Lyrics français sous Rhythmbox
Je me suis remis à Rhythmbox après avoir à nouveau eu des problèmes avec Amarok (meme si KDE est son environnement natif, je me demande si ca excuse tout), et je suis de plus en plus surpris par l'intelligence de Rhythmbox. Au final, meme pour la gestion des collections je le trouve plus efficace que la plupart.
Une des fonctions qui m'épate le plus, c'est cette détection de paroles qui est vraiment super efficace, que ce soit sur le répertoire international ou meme sur de la Jpop !
Mais le truc qui me chiffonne c'est qu'il n'arrive à trouver aucune parole française. J'aurais aimé savoir si on peut changer les trois flux de base, et si oui, lesquels mettre pour avoir des paroles françaises, et sinon, comment faire pour les intégrer progressivement à une base quelconque.
merci pour vos éclaircissements.
Hors ligne
#2 Le 07/02/2008, à 10:14
- tnntwister
Re : Lyrics français sous Rhythmbox
pas de solutions ?
Hors ligne
#3 Le 30/03/2008, à 14:55
- ProfGoron
Re : Lyrics français sous Rhythmbox
Bonjour,
J'ai le même problème... Est-il possible (à la limite en trifouillant un fichier de conf) de rajouter des flux pour chercher des paroles ?
Hors ligne
#4 Le 07/01/2009, à 09:18
- tnntwister
Re : Lyrics français sous Rhythmbox
up ?
Hors ligne
#5 Le 25/03/2009, à 19:14
- marcz
Re : Lyrics français sous Rhythmbox
$ gconf-editor
dans apps/rhythmbox/plugins/lyrics
pour changer la clé engines, souris clic droit ->edit/key et changer les sites ou les lyrics sont cherchés
#6 Le 25/03/2009, à 19:40
- marcz
Re : Lyrics français sous Rhythmbox
Mon conseil précédent n'est pas bon, pour les lyrics il faut un parser, dans /usr/lib/rhythmbox/plugins/lyrics/
donc il faut en plus en réécrire un en se basant sur un existant comme modèle par exemple
/usr/lib/rhythmbox/plugins/lyrics/LeoslyricsParser.py
ensuite il faut modifier /usr/lib/rhythmbox/plugins/lyrics/LyricsParse.py pour importer le nouveau parser et modifier le dictionnaire engines_map.
Pour les paresseux, chercher à la main le lyric et le mettre dans ~/.lyrics/<artiste>/<chanson.lyric>
Marc
#7 Le 05/05/2009, à 18:16
- Zahrun
Re : Lyrics français sous Rhythmbox
Euh je ne sais pas quoi mettre comme parser ...
Si quelqu'un aurait l'amabilité d'uploader son fichier .py pour avoir les paroles en français, ce serait cool
Hors ligne
#8 Le 09/05/2009, à 00:41
- Zahrun
Re : Lyrics français sous Rhythmbox
Up
Hors ligne
#9 Le 22/03/2010, à 14:02
- tnntwister
Re : Lyrics français sous Rhythmbox
oh oui, une réponse serait bienvenue
Hors ligne
#10 Le 27/08/2010, à 13:36
- emi_lien
Re : Lyrics français sous Rhythmbox
Je me permets de "upper" (je viens de l'inventer) car le sujet m'intéresse...
Comment ajouter une nouvelle source (comme LyricsWiki par exemple) et pouvoir sélectionner cette source directement depuis Rhythmbox ??
Hors ligne
#11 Le 10/01/2011, à 17:13
- marsu082000
Re : Lyrics français sous Rhythmbox
bonjour,
pour ajouter une nouvelle source, il faut écrire un "parser" et modifier le fichier /usr/lib/rhythmbox/plugins/lyrics/LyricsSites.py
exemple pour le site LyricWiki, il existe un déjà un "parser" LyricWikiParser.py, pour l'activer il faut faire :
cd /usr/lib/rhythmbox/plugins/lyrics
sudo gedit LyricsSites.py
et ajouter dans le fichier les lignes concernant LyricWikiParser en se basant sur un autre parser, pour obtenir une fin de fichier qui ressemble à ça :
from LyrcParser import LyrcParser
from LyricWikiParser import LyricWikiParser
from AstrawebParser import AstrawebParser
from LeoslyricsParser import LeoslyricsParser
from WinampcnParser import WinampcnParser
from TerraParser import TerraParser
lyrics_sites = [
{ 'id': 'lyricwiki.org', 'class': LyricWikiParser, 'name': _("LyricWiki (www.lyricwiki.org)") },
{ 'id': 'lyrc.com.ar', 'class': LyrcParser, 'name': _("Lyrc (lyrc.com.ar)") },
{ 'id': 'astraweb.com', 'class': AstrawebParser, 'name': _("Astraweb (www.astraweb.com)") },
{ 'id': 'leoslyrics.com', 'class': LeoslyricsParser, 'name': _("Leo's Lyrics (www.leoslyrics.com)") },
{ 'id': 'winampcn.com', 'class': WinampcnParser, 'name': _("WinampCN (www.winampcn.com)") },
{ 'id': 'terra.com.br', 'class': TerraParser, 'name': _("TerraBrasil (terra.com.br)") }
]
Pour activer le site : dans RhythmBox, aller dans Édition-->Greffons, cliquer sur la ligne "Paroles de la chanson" (qui doit être cochée), cliquer sur le bouton Configurer et cocher la ligner LyricWiki.
maintenant, comme le "parser" utilise les api fournies par LyricWiki, qui depuis plusieurs années ne fournissent plus que le début des chansons, on va modifier le parser pour avoir les paroles complètes :
sudo apt-get install python-zsi
sudo wsdl2py --complexType http://lyrics.wikia.com/server.php?wsdl
sudo gedit LyricWikiParser.py
et y coller le code suivant :
# -*- Mode: python; coding: utf-8; tab-width: 8; indent-tabs-mode: t; -*-
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
# prerequisite :
# package python-zsi
# scripts LyricWiki created with :
# wsdl2py --complexType http://lyrics.wikia.com/server.php?wsdl
import urllib
import rb
import xml.parsers.expat
from xml.dom import minidom
from LyricWiki_client import *
def unescape(s):
want_unicode = False
if isinstance(s, unicode):
s = s.encode("utf-8")
want_unicode = True
list = []
# create and initialize a parser object
p = xml.parsers.expat.ParserCreate("utf-8")
p.buffer_text = True
p.returns_unicode = want_unicode
p.CharacterDataHandler = list.append
# parse the data wrapped in a dummy element
# (needed so the "document" is well-formed)
p.Parse("<e>", 0)
p.Parse(s, 0)
p.Parse("</e>", 1)
# join the extracted strings and return
es = ""
if want_unicode:
es = u""
return es.join(list)
class LyricWikiParser(object):
def __init__(self, artist, title):
self.artist = artist
self.title = title
def search(self, callback, *data):
artist = urllib.quote(self.artist.replace(' ', '_'))
title = urllib.quote(self.title.replace(' ', '_'))
soap = LyricWikiBindingSOAP("http://lyrics.wikia.com/server.php")
song = getSongRequest()
song.Artist = artist
song.Song = title
resultsong = soap.getSong(song)
loader = rb.Loader()
loader.get_url (resultsong.Return.Url, self.got_lyrics, callback, *data)
def got_lyrics(self, result, callback, *data):
if result is None or result == "Not found":
callback (None, *data)
return
indice1 = result.find("</a></div>&#")
indice1 += 10
indice2 = result.find("<!",indice1)
lyrics = result[indice1:indice2]
lyrics = lyrics.replace("<br />","\n")
lyrics = lyrics.replace(" "," ")
lyrics = unescape(lyrics)
lyrics += "\n\nLyrics provided by lyricwiki.org"
callback (lyrics, *data)
Dernière modification par marsu082000 (Le 10/01/2011, à 19:01)
Hors ligne
#12 Le 10/01/2011, à 21:13
- Inso
Re : Lyrics français sous Rhythmbox
Merci pour le déterrage !
C'est quand même top de pouvoir espérer des réponses après si longtemps
Merci Marsu
Hors ligne
#13 Le 03/08/2011, à 14:31
- Okanda
Re : Lyrics français sous Rhythmbox
Merci beaucoup Marsu.
Hors ligne
#14 Le 28/03/2012, à 19:36
- krzyzstof
Re : Lyrics français sous Rhythmbox
Un grand MERCI Marsu !!! )
Portable 1 : DELL Latitude 5320 Kubuntu 22.04.1 / Windows 10 pro (64 bits / 32 Go RAM / 1 To SSD)
Portable 2 : HP EliteBook 840 G4 - Kubuntu 20.04 / Windows 10 pro (64 bits / 32 Go RAM / 512 Go SSD)
Portable 3 : Samsung N220 - Linux Mint 18.3 Mate (32 bits)
Fixe : Custom (carte mère Asus A7V333 + carte graphique ATI Radeon 9600 XT) - Linux Mint 18.1 Mate (32 bits)
Hors ligne
#15 Le 31/05/2012, à 14:15
- krzyzstof
Re : Lyrics français sous Rhythmbox
Salut,
J'ai l'impression que cela ne fonctionne plus.
J'ai donc voulu recommencer la manip' (au cas où d'un crash quelconque) et j'obtiens maintenant un message d'erreur avec Python :
christophe@PCDell:/usr/lib/rhythmbox/plugins/lyrics$ sudo wsdl2py --complexType http://lyrics.wikia.com/server.php?wsdl
/usr/lib/pymodules/python2.6/ZSI/resolvers.py:7: DeprecationWarning: the multifile module has been deprecated since Python 2.5
import multifile, mimetools, urllib
/usr/lib/pymodules/python2.6/ZSI/wstools/XMLSchema.py:3103: DeprecationWarning: object.__init__() takes no parameters
tuple.__init__(self, args)
Portable 1 : DELL Latitude 5320 Kubuntu 22.04.1 / Windows 10 pro (64 bits / 32 Go RAM / 1 To SSD)
Portable 2 : HP EliteBook 840 G4 - Kubuntu 20.04 / Windows 10 pro (64 bits / 32 Go RAM / 512 Go SSD)
Portable 3 : Samsung N220 - Linux Mint 18.3 Mate (32 bits)
Fixe : Custom (carte mère Asus A7V333 + carte graphique ATI Radeon 9600 XT) - Linux Mint 18.1 Mate (32 bits)
Hors ligne