示例#1
0
文件: pages.py 项目: lissyx/weboob
 def iter_lyrics(self, criteria):
     for link in self.parser.select(self.document.getroot(),
                                    'div.box-content td.song-name a'):
         href = link.attrib.get('href', '')
         if criteria == 'artist':
             if len(href.split('/')) != 4:
                 continue
             else:
                 self.browser.location('%s' % href)
                 assert self.browser.is_on_page(
                     ArtistSongsPage) or self.browser.is_on_page(
                         SonglyricsPage)
                 for lyr in self.browser.page.iter_lyrics():
                     yield lyr
         else:
             if len(href.split('/')) != 5:
                 continue
             else:
                 artist = unicode(
                     self.parser.select(
                         link.getparent().getparent().getparent(),
                         'td.song-artist > p', 1).text.strip())
                 title = unicode(link.text)
                 id = unicode(
                     link.attrib.get('href',
                                     '').replace('http://www.paroles.net/',
                                                 ''))
                 lyr = SongLyrics(id, title)
                 lyr.artist = artist
                 yield lyr
示例#2
0
文件: pages.py 项目: Boussadia/weboob
 def iter_lyrics(self):
     artist = unicode(self.parser.select(self.document.getroot(), 'span[itemprop=name]', 1).text)
     for link in self.parser.select(self.document.getroot(), 'td.song-name > p[itemprop=name] > a[itemprop=url]'):
         href = unicode(link.attrib.get('href', ''))
         title = unicode(link.text)
         id = href.replace('http://www.paroles.net/', '')
         songlyrics = SongLyrics(id, title)
         songlyrics.artist = artist
         songlyrics.content = NotLoaded
         yield songlyrics
示例#3
0
文件: pages.py 项目: Boussadia/weboob
 def get_lyrics(self, id):
     artist = NotAvailable
     title = NotAvailable
     content = unicode(self.parser.select(self.document.getroot(), 'div.song-text', 1).text_content().strip())
     artist = unicode(self.parser.select(self.document.getroot(), 'span[property$=artist]', 1).text)
     title = unicode(self.parser.select(self.document.getroot(), 'span[property$=name]', 1).text)
     songlyrics = SongLyrics(id, title)
     songlyrics.artist = artist
     songlyrics.content = content
     return songlyrics
示例#4
0
文件: pages.py 项目: juliaL03/weboob
 def iter_lyrics(self, artist):
     for link in self.parser.select(self.document.getroot(), 'div.cont_catA div.art_scroll a'):
         href = link.attrib.get('href', '')
         if href.startswith('./paroles'):
             title = unicode(link.text)
             id = href.replace('./paroles-', '')
             songlyrics = SongLyrics(id, title)
             songlyrics.artist = artist
             songlyrics.content = NotLoaded
             yield songlyrics
示例#5
0
 def iter_lyrics(self):
     artist = unicode(self.parser.select(self.document.getroot(), 'span[itemprop=name]', 1).text)
     for link in self.parser.select(self.document.getroot(), 'td.song-name > p[itemprop=name] > a[itemprop=url]'):
         href = unicode(link.attrib.get('href', ''))
         title = unicode(link.text)
         id = href.replace('http://www.paroles.net/', '')
         songlyrics = SongLyrics(id, title)
         songlyrics.artist = artist
         songlyrics.content = NotLoaded
         yield songlyrics
示例#6
0
 def get_lyrics(self, id):
     artist = NotAvailable
     title = NotAvailable
     content = unicode(self.parser.select(self.document.getroot(), 'div.song-text', 1).text_content().strip())
     artist = unicode(self.parser.select(self.document.getroot(), 'span[property$=artist]', 1).text)
     title = unicode(self.parser.select(self.document.getroot(), 'span[property$=name]', 1).text)
     songlyrics = SongLyrics(id, title)
     songlyrics.artist = artist
     songlyrics.content = content
     return songlyrics
示例#7
0
 def iter_lyrics(self, artist):
     for link in self.parser.select(self.document.getroot(),
                                    'div.cont_catA div.art_scroll a'):
         href = link.attrib.get('href', '')
         if href.startswith('./paroles'):
             title = unicode(link.text)
             id = href.replace('./paroles-', '')
             songlyrics = SongLyrics(id, title)
             songlyrics.artist = artist
             songlyrics.content = NotLoaded
             yield songlyrics
示例#8
0
文件: pages.py 项目: juliaL03/weboob
 def get_lyrics(self, id):
     artist = NotAvailable
     title = NotAvailable
     content = unicode(self.parser.select(self.document.getroot(), 'div#lyr_scroll', 1).text_content().strip())
     infos = self.parser.select(self.document.getroot(), 'h2.lyrics > font')
     artist = unicode(infos[0].text)
     title = unicode(infos[1].text)
     songlyrics = SongLyrics(id, title)
     songlyrics.artist = artist
     songlyrics.content = content
     return songlyrics
示例#9
0
 def iter_lyrics(self, artist):
     for th in self.parser.select(self.document.getroot(), 'th.text'):
         txt = th.text_content()
         if txt.startswith('Top') and txt.endswith('Lyrics'):
             for link in self.parser.select(th.getparent().getparent(), 'a.tlink'):
                 title = unicode(link.attrib.get('title', '').replace(' Lyrics', ''))
                 id = link.attrib.get('href', '').replace('/lyrics/', '').replace('.html', '')
                 songlyrics = SongLyrics(id, title)
                 songlyrics.artist = artist
                 songlyrics.content = NotLoaded
                 yield songlyrics
示例#10
0
文件: pages.py 项目: juliaL03/weboob
 def iter_lyrics(self, artist):
     for th in self.parser.select(self.document.getroot(), 'th.text'):
         txt = th.text_content()
         if txt.startswith('Top') and txt.endswith('Lyrics'):
             for link in self.parser.select(th.getparent().getparent(), 'a.tlink'):
                 title = unicode(link.attrib.get('title', '').replace(' Lyrics', ''))
                 id = link.attrib.get('href', '').replace('/lyrics/', '').replace('.html', '')
                 songlyrics = SongLyrics(id, title)
                 songlyrics.artist = artist
                 songlyrics.content = NotLoaded
                 yield songlyrics
示例#11
0
文件: pages.py 项目: h4wkmoon/weboob
 def iter_lyrics(self):
     for link in self.parser.select(self.document.getroot(), 'div.elenco div.col-left li a'):
         artist = NotAvailable
         title = unicode(link.text.split(' - ')[0])
         href = link.attrib.get('href', '')
         if href.startswith('/paroles') and not href.endswith('alpha.html'):
             ids = href.replace('/', '').replace('.html', '').split('paroles_')
             id = '%s|%s' % (ids[1], ids[2])
             artist = unicode(link.text.split(' - ')[1])
             songlyrics = SongLyrics(id, title)
             songlyrics.artist = artist
             songlyrics.content = NotLoaded
             yield songlyrics
示例#12
0
文件: pages.py 项目: juliaL03/weboob
 def get_lyrics(self, id):
     artist = NotAvailable
     title = NotAvailable
     l_artitle = self.parser.select(self.document.getroot(), 'table.text td > b > h2')
     if len(l_artitle) > 0:
         artitle = l_artitle[0].text.split(' Lyrics by ')
         artist = unicode(artitle[1])
         title = unicode(artitle[0])
     content = unicode(self.parser.select(self.document.getroot(), 'div#songlyrics', 1).text_content().strip())
     songlyrics = SongLyrics(id, title)
     songlyrics.artist = artist
     songlyrics.content = content
     return songlyrics
示例#13
0
文件: pages.py 项目: lissyx/weboob
 def iter_lyrics(self):
     for link in self.parser.select(self.document.getroot(), 'div#albums a'):
         artist = NotAvailable
         title = unicode(link.text.split(' - ')[0])
         href = link.attrib.get('href', '')
         if href.startswith('/paroles') and not href.endswith('alpha.html'):
             ids = href.replace('/', '').replace('.html', '').split('paroles_')
             id = '%s|%s' % (ids[1], ids[2])
             artist = unicode(link.text.split(' - ')[1])
             songlyrics = SongLyrics(id, title)
             songlyrics.artist = artist
             songlyrics.content = NotLoaded
             yield songlyrics
示例#14
0
 def get_lyrics(self, id):
     artist = NotAvailable
     title = NotAvailable
     l_artitle = self.parser.select(self.document.getroot(), 'table.text td > b > h2')
     if len(l_artitle) > 0:
         artitle = l_artitle[0].text.split(' Lyrics by ')
         artist = unicode(artitle[1])
         title = unicode(artitle[0])
     content = unicode(self.parser.select(self.document.getroot(), 'div#songlyrics', 1).text_content().strip())
     songlyrics = SongLyrics(id, title)
     songlyrics.artist = artist
     songlyrics.content = content
     return songlyrics
示例#15
0
 def get_lyrics(self, id):
     artist = NotAvailable
     title = NotAvailable
     content = unicode(
         self.parser.select(self.document.getroot(), 'div#lyr_scroll',
                            1).text_content().strip())
     infos = self.parser.select(self.document.getroot(), 'h2.lyrics > font')
     artist = unicode(infos[0].text)
     title = unicode(infos[1].text)
     songlyrics = SongLyrics(id, title)
     songlyrics.artist = artist
     songlyrics.content = content
     return songlyrics
示例#16
0
文件: pages.py 项目: h4wkmoon/weboob
 def get_lyrics(self, id):
     content = NotAvailable
     artist = NotAvailable
     title = NotAvailable
     lyrdiv = self.parser.select(self.document.getroot(), 'div.lyrics-body')
     if len(lyrdiv) > 0:
         content = unicode(lyrdiv[0].text_content().strip())
     infos = self.parser.select(self.document.getroot(), 'head > title', 1).text
     artist = unicode(infos.split(' - ')[1])
     title = unicode(infos.split(' - ')[0].replace('Paroles ', ''))
     songlyrics = SongLyrics(id, title)
     songlyrics.artist = artist
     songlyrics.content = content
     return songlyrics
示例#17
0
文件: pages.py 项目: h4wkmoon/weboob
 def iter_lyrics(self, artist=None):
     if artist is None:
         artist = self.parser.select(self.document.getroot(), 'head > title', 1).text.replace('Paroles ', '')
     for link in self.parser.select(self.document.getroot(), 'div#albums a'):
         href = link.attrib.get('href', '')
         titleattrib = link.attrib.get('title', '')
         if href.startswith('/paroles') and not href.endswith('alpha.html') and titleattrib.startswith('Paroles '):
             title = unicode(link.text)
             ids = href.replace('/', '').replace('.html', '').split('paroles_')
             id = '%s|%s' % (ids[1], ids[2])
             songlyrics = SongLyrics(id, title)
             songlyrics.artist = artist
             songlyrics.content = NotLoaded
             yield songlyrics
示例#18
0
文件: pages.py 项目: lissyx/weboob
 def get_lyrics(self, id):
     content = NotAvailable
     artist = NotAvailable
     title = NotAvailable
     lyrdiv = self.parser.select(self.document.getroot(), 'div#songlyrics_h')
     if len(lyrdiv) > 0:
         content = unicode(lyrdiv[0].text_content().strip())
     infos = self.parser.select(self.document.getroot(), 'head > title', 1).text
     artist = unicode(infos.split(' - ')[1])
     title = unicode(infos.split(' - ')[0].replace('Paroles ', ''))
     songlyrics = SongLyrics(id, title)
     songlyrics.artist = artist
     songlyrics.content = content
     return songlyrics
示例#19
0
文件: pages.py 项目: lissyx/weboob
 def iter_lyrics(self, artist=None):
     if artist is None:
         artist = self.parser.select(self.document.getroot(), 'head > title', 1).text.replace('Paroles ', '')
     for link in self.parser.select(self.document.getroot(), 'div#albums a'):
         href = link.attrib.get('href', '')
         titleattrib = link.attrib.get('title', '')
         if href.startswith('/paroles') and not href.endswith('alpha.html') and titleattrib.startswith('Paroles '):
             title = unicode(link.text)
             ids = href.replace('/', '').replace('.html', '').split('paroles_')
             id = '%s|%s' % (ids[1], ids[2])
             songlyrics = SongLyrics(id, title)
             songlyrics.artist = artist
             songlyrics.content = NotLoaded
             yield songlyrics
示例#20
0
文件: pages.py 项目: juliaL03/weboob
 def iter_lyrics(self):
     first = True
     for tr in self.parser.select(self.document.getroot(), 'div.cont_cat table tr'):
         if first:
             first = False
             continue
         artist = NotAvailable
         links = self.parser.select(tr, 'a.std')
         title = unicode(links[0].text)
         id = links[0].attrib.get('href', '').replace('/paroles-', '')
         artist = unicode(links[1].text)
         songlyrics = SongLyrics(id, title)
         songlyrics.artist = artist
         songlyrics.content = NotLoaded
         yield songlyrics
示例#21
0
 def iter_lyrics(self):
     first = True
     for tr in self.parser.select(self.document.getroot(),
                                  'div.cont_cat table tr'):
         if first:
             first = False
             continue
         artist = NotAvailable
         links = self.parser.select(tr, 'a.std')
         title = unicode(links[0].text)
         id = links[0].attrib.get('href', '').replace('/paroles-', '')
         artist = unicode(links[1].text)
         songlyrics = SongLyrics(id, title)
         songlyrics.artist = artist
         songlyrics.content = NotLoaded
         yield songlyrics
示例#22
0
文件: pages.py 项目: juliaL03/weboob
 def iter_lyrics(self):
     first = True
     for tr in self.parser.select(self.document.getroot(), 'table[title~=Results] tr'):
         if first:
             first = False
             continue
         artist = NotAvailable
         tds = self.parser.select(tr, 'td')
         assert len(tds) > 2
         title = unicode(tds[1].text_content())
         link = self.parser.select(tds[1], 'a', 1)
         id = link.attrib.get('href', '').replace('/lyrics/', '').replace('.html', '')
         aartist = self.parser.select(tr, 'a')[-1]
         artist = unicode(aartist.text)
         songlyrics = SongLyrics(id, title)
         songlyrics.artist = artist
         songlyrics.content = NotLoaded
         yield songlyrics
示例#23
0
 def iter_lyrics(self):
     first = True
     for tr in self.parser.select(self.document.getroot(), 'table[title~=Results] tr'):
         if first:
             first = False
             continue
         artist = NotAvailable
         tds = self.parser.select(tr, 'td')
         assert len(tds) > 2
         title = unicode(tds[1].text_content())
         link = self.parser.select(tds[1], 'a', 1)
         id = link.attrib.get('href', '').replace('/lyrics/', '').replace('.html', '')
         aartist = self.parser.select(tr, 'a')[-1]
         artist = unicode(aartist.text)
         songlyrics = SongLyrics(id, title)
         songlyrics.artist = artist
         songlyrics.content = NotLoaded
         yield songlyrics
示例#24
0
文件: pages.py 项目: Boussadia/weboob
 def iter_lyrics(self, criteria):
     for link in self.parser.select(self.document.getroot(), 'div.box-content td.song-name a'):
         href = link.attrib.get('href','')
         if criteria == 'artist':
             if len(href.split('/')) != 4:
                 continue
             else:
                 self.browser.location('%s' % href)
                 assert self.browser.is_on_page(ArtistSongsPage) or self.browser.is_on_page(SonglyricsPage)
                 for lyr in self.browser.page.iter_lyrics():
                     yield lyr
         else:
             if len(href.split('/')) != 5:
                 continue
             else:
                 artist = unicode(self.parser.select(link.getparent().getparent().getparent(), 'td.song-artist > p', 1).text.strip())
                 title = unicode(link.text)
                 id = unicode(link.attrib.get('href', '').replace('http://www.paroles.net/',''))
                 lyr = SongLyrics(id, title)
                 lyr.artist = artist
                 yield lyr