comparison core/magnatagatune/fm_retrieve_album.py @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 # gets data from the last.fm webservice and
2
3 import pylast
4 import sys
5 import fm_network
6
7 network = fm_network.get_network()
8
9 # now you can use that object every where
10 srch = network.search_for_artist(sys.argv[1])
11
12
13 # did we find any ?
14 if (int(srch.get_total_result_count()) == False):
15 print('-1, None')
16
17 else:
18
19 #print first 200 results
20 albums = srch.get_next_page()
21 for album in albums:
22 mbid = unicode(album.get_mbid())
23 print(album.get_name().encode('utf-8','ignore') + ', ' + mbid.encode('utf-8','ignore'))