Advertisement
solaire-off

Untitled

Jul 17th, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. for song in songs :
  2.         n -= 1
  3.         artist = song['artist']
  4.         track = song['title']
  5.         name = artist + ' - ' + track + '.mp3'  
  6.         split_name = split(name)
  7.         if split_name not in music_list :
  8.                 print('download %s, ostalos %s'%(name,str(n)))
  9.                 cache = urlopen(song['url']).read()
  10.                 filename = '/media/solaire-off/4B04F0B93E84428D/1/music/%s'%split_name
  11.                 print(filename)
  12.                 with open(filename,'wb') as file :
  13.                         file.write(cache)
  14.                         file.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement