Пример #1
0
 def downloadtrack(self, track, line, downloadpath):
     t = track.load_track(line)
     print(t['preview'])
     #print t['preview']
     try:
         mp3 = urllib2.urlopen(t['preview'])
         mp3name =  downloadpath + '/' + t['track_id'] + ".mp3"
         with open(mp3name, "wb") as code:
             code.write(mp3.read())
             print(mp3name)              #[DEBUG]
     except urllib2.HTTPError:
         mp3 = get_preview_url.get_preview_from_trackid(t['track_id'])
         print(mp3)
         print "dammit."                 #[DEBUG]
Пример #2
0
 def get_url(self,d7id):
     """ get an url from a 7digital track id """
     url = GETURL.get_preview_from_trackid(d7id)
     print 'Found url:',url
     self.url = url
     self.update_display() # update main display
Пример #3
0
 def get_url(self,d7id):
     """ get an url from a 7digital track id """
     url = GETURL.get_preview_from_trackid(d7id)
     print 'Found url:',url
     self.url = url
     self.update_display() # update main display