示例#1
0
if len(sys.argv) > 1:
	uartist = sys.argv[1]
	ualbum = sys.argv[2]
	utrack = sys.argv[3]
else:
	exit(0)

if not itunes.is_caching_enabled():
	itunes.enable_caching('/tmp/itunes_cache')

score = 0
url = {'itunes':''}

try:
	artist = itunes.search_artist(uartist)[0]
	if uartist == artist.get_name() or cjb.simple_compare(uartist, artist.get_name(), .90):
		url['itunes'] = artist.get_url()

		for album in artist.get_albums():
			albumscore = 0
		
			if ualbum == album.get_name():
				albumscore += 32
			elif cjb.simple_compare(ualbum, album.get_name(), .80):
				albumscore += 20
		
			for track in album.get_tracks():
				trackscore = 0
				if utrack == track.get_name():
					trackscore += 10
				elif cjb.simple_compare(utrack, track.get_name(), .90):
示例#2
0
    ualbum = sys.argv[2]
    utrack = sys.argv[3]
else:
    exit(0)

score = 0
url = {"Amazon": ""}

api = API(AWS_KEY, SECRET_KEY, "us")
node = api.item_search("Music", Artist=uartist, Title=ualbum, Track=utrack, ResponseGroup="Large")
for item in node.Items.Item:
    if not hasattr(item, "Tracks"):
        continue

    if uartist != item.ItemAttributes.Artist.pyval and not cjb.simple_compare(
        uartist, item.ItemAttributes.Artist.pyval, 0.90
    ):
        continue

    albumscore = 0
    if ualbum == item.ItemAttributes.Title:
        albumscore += 32
    elif cjb.simple_compare(ualbum, item.ItemAttributes.Title.pyval, 0.80):
        albumscore += 20

    for disc in item.Tracks.Disc:
        for track in disc.Track:
            trackscore = 0
            if utrack == track.pyval:
                trackscore += 10
            elif cjb.simple_compare(utrack, track.pyval, 0.90):
示例#3
0
if len(sys.argv) > 1:
    uartist = sys.argv[1]
    ualbum = sys.argv[2]
    utrack = sys.argv[3]
else:
    exit(0)

if not itunes.is_caching_enabled():
    itunes.enable_caching('/tmp/itunes_cache')

score = 0
url = {'itunes': ''}

try:
    artist = itunes.search_artist(uartist)[0]
    if uartist == artist.get_name() or cjb.simple_compare(
            uartist, artist.get_name(), .90):
        url['itunes'] = artist.get_url()

        for album in artist.get_albums():
            albumscore = 0

            if ualbum == album.get_name():
                albumscore += 32
            elif cjb.simple_compare(ualbum, album.get_name(), .80):
                albumscore += 20

            for track in album.get_tracks():
                trackscore = 0
                if utrack == track.get_name():
                    trackscore += 10
                elif cjb.simple_compare(utrack, track.get_name(), .90):
示例#4
0
    exit(0)

score = 0
url = {'Amazon': ''}

api = API(AWS_KEY, SECRET_KEY, 'us')
node = api.item_search('Music',
                       Artist=uartist,
                       Title=ualbum,
                       Track=utrack,
                       ResponseGroup="Large")
for item in node.Items.Item:
    if not hasattr(item, 'Tracks'):
        continue

    if uartist != item.ItemAttributes.Artist.pyval and not cjb.simple_compare(
            uartist, item.ItemAttributes.Artist.pyval, .90):
        continue

    albumscore = 0
    if ualbum == item.ItemAttributes.Title:
        albumscore += 32
    elif cjb.simple_compare(ualbum, item.ItemAttributes.Title.pyval, .80):
        albumscore += 20

    for disc in item.Tracks.Disc:
        for track in disc.Track:
            trackscore = 0
            if utrack == track.pyval:
                trackscore += 10
            elif cjb.simple_compare(utrack, track.pyval, .90):
                trackscore += 20