예제 #1
0
파일: test.py 프로젝트: supr/PyRaaga
 def setUp(self):
     self.raaga = Raaga()
     track1 = Track("Anandha Ragam")
     track1.set_artists(['Susheela'])
     track1.set_music(['Illayaraja'])
     track2 = Track("Navvulalona")
     track2.set_artists(['SP. Balasubramaniam', 'Janaki'])
     track2.set_music(['Illayaraja'])
     self.movie = Movie("Madhura Geetham", [track1, track2], 'A0002038')
예제 #2
0
파일: raaga.py 프로젝트: supr/PyRaaga
 def get_movie_info(self, movie_id):
     URL = "http://www.raaga.com/a/rss.asp?%s"%(movie_id)
     rss = "".join([ line.strip() for line in self.opener.open(URL).readlines() ])
     
     mi_tree = etree.fromstring(rss)
     mi_title = self._parse_movie_title(mi_tree.xpath("/rss/channel/title/text()")[0])
     mi_tracks = mi_tree.xpath("/rss/channel/item")
     tracks = []
     for mi_track in mi_tracks:
         track_title = mi_track.xpath("title/text()")[0]
         track_desc = mi_track.xpath("description/text()")[0]
         track_info = self._parse_artists(track_desc)
         track = Track(track_title)
         track.set_artists(track_info[0])
         track.set_music(track_info[1])
         tracks.append(track)
     return Movie(mi_title, tracks, movie_id)