pax_global_header 0000666 0000000 0000000 00000000064 13436457030 0014517 g ustar 00root root 0000000 0000000 52 comment=3863a14eedf17551743a8bbccf0237874d7f4a16
woob-3863a14eedf17551743a8bbccf0237874d7f4a16-modules-parolesmania/ 0000775 0000000 0000000 00000000000 13436457030 0023531 5 ustar 00root root 0000000 0000000 woob-3863a14eedf17551743a8bbccf0237874d7f4a16-modules-parolesmania/modules/ 0000775 0000000 0000000 00000000000 13436457030 0025201 5 ustar 00root root 0000000 0000000 woob-3863a14eedf17551743a8bbccf0237874d7f4a16-modules-parolesmania/modules/parolesmania/ 0000775 0000000 0000000 00000000000 13436457030 0027654 5 ustar 00root root 0000000 0000000 woob-3863a14eedf17551743a8bbccf0237874d7f4a16-modules-parolesmania/modules/parolesmania/__init__.py 0000664 0000000 0000000 00000001523 13436457030 0031766 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
# Copyright(C) 2013 Julien Veyssier
#
# This file is part of a weboob module.
#
# This weboob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This weboob module 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this weboob module. If not, see .
from .module import ParolesmaniaModule
__all__ = ['ParolesmaniaModule']
woob-3863a14eedf17551743a8bbccf0237874d7f4a16-modules-parolesmania/modules/parolesmania/browser.py 0000664 0000000 0000000 00000004567 13436457030 0031725 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
# Copyright(C) 2013 Julien Veyssier
#
# This file is part of a weboob module.
#
# This weboob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This weboob module 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this weboob module. If not, see .
from weboob.browser.exceptions import BrowserHTTPNotFound
from weboob.browser import PagesBrowser
from weboob.browser.url import URL
from weboob.browser.profiles import Firefox
from .pages import SearchSongPage, LyricsPage, SearchArtistPage, ArtistSongsPage
import itertools
__all__ = ['ParolesmaniaBrowser']
class ParolesmaniaBrowser(PagesBrowser):
PROFILE = Firefox()
TIMEOUT = 30
BASEURL = 'http://www.parolesmania.com/'
searchSong = URL('recherche.php\?c=title&k=(?P[^/]*).*',
SearchSongPage)
searchArtist = URL('recherche.php\?c=artist&k=(?P[^/]*).*',
SearchArtistPage)
songLyrics = URL('paroles_(?P[^/]*)/paroles_(?P[^/]*)\.html',
LyricsPage)
artistSongs = URL('paroles_(?P[^/]*)\.html',
ArtistSongsPage)
def iter_lyrics(self, criteria, pattern):
if criteria == 'artist':
artist_ids = self.searchArtist.go(pattern=pattern).get_artist_ids()
it = []
# we just take the 3 first artists to avoid too many page loadings
for aid in artist_ids[:3]:
it = itertools.chain(it, self.artistSongs.go(artistid=aid).iter_lyrics())
return it
elif criteria == 'song':
return self.searchSong.go(pattern=pattern).iter_lyrics()
def get_lyrics(self, id):
ids = id.split('|')
try:
self.songLyrics.go(artistid=ids[0], songid=ids[1])
songlyrics = self.page.get_lyrics()
return songlyrics
except BrowserHTTPNotFound:
return
woob-3863a14eedf17551743a8bbccf0237874d7f4a16-modules-parolesmania/modules/parolesmania/favicon.png 0000664 0000000 0000000 00000012143 13436457030 0032010 0 ustar 00root root 0000000 0000000 PNG
IHDR @ @ iq sRGB bKGD pHYs tIME5w~s IDATx՛itu3,͒˶dY6%6+!
%Є4-Iڐ&) mB 큞'
YZI Iz oF6b.:, 1̝y̝6۶ Ð+{!{q[i\?