Exemple #1
0
	def generate():
		for song in tracks:
			result_dict = download(song['url'], song['artist'], song['track'])
			print 'successfully downloaded ' 
			print result_dict

			saveTrack(playlist_id, song['track'], song['artist'], owner)
			yield 'data:' + song['artist'] + ' - ' + song['track'] + '\n\n'

		print 'here handlePlaylistDownload'
		playlistURL = generatePlaylistURL(owner, playlist_id)
		yield 'data:' + playlistURL
Exemple #2
0
    def generate():
        for song in tracks:
            result_dict = download(song['url'], song['artist'], song['track'])
            print 'successfully downloaded '
            print result_dict

            saveTrack(playlist_id, song['track'], song['artist'], owner)
            yield 'data:' + song['artist'] + ' - ' + song['track'] + '\n\n'

        print 'here handlePlaylistDownload'
        playlistURL = generatePlaylistURL(owner, playlist_id)
        yield 'data:' + playlistURL
Exemple #3
0
def handleSingleTrackDownload():	
	youtubeURL = request.args.get('youtubeURL')
	artistName = request.args.get('artistName')
	trackName = request.args.get('trackName')
	playlist_id = ''

	result_dict = saveTrack(youtubeURL, playlist_id, trackName, artistName)
	return jsonify(result_dict)
Exemple #4
0
def handleSingleTrackDownload():
    youtubeURL = request.args.get('youtubeURL')
    artistName = request.args.get('artistName')
    trackName = request.args.get('trackName')
    playlist_id = ''

    result_dict = saveTrack(youtubeURL, playlist_id, trackName, artistName)
    return jsonify(result_dict)
Exemple #5
0
def handlePlaylistDownload():
    playlist = request.get_json()
    tracks = playlist['tracks']
    playlist_name = playlist['name'].replace("'", '')
    message = playlist['message'].replace("'", '')
    owner = playlist['user']

    playlist_id = int(time.time())

    # create playlist
    createNewPlaylist(playlist_id, playlist_name, message, owner)

    for song in tracks:
        saveTrack(song['url'], playlist_id, song['track'], song['artist'])

    playlistURL = generatePlaylistURL(owner, playlist_id)

    return jsonify({'playlistURL': playlistURL})
Exemple #6
0
def handlePlaylistDownload():
	playlist = request.get_json()
	tracks = playlist['tracks']
	playlist_name = playlist['name'].replace("'",'')
	message = playlist['message'].replace("'",'')
	owner = playlist['user']

	playlist_id = int(time.time())

	# create playlist
	createNewPlaylist(playlist_id, playlist_name, message, owner)

	for song in tracks:
		saveTrack(song['url'], playlist_id, song['track'], song['artist'])


	playlistURL = generatePlaylistURL(owner, playlist_id)

	return jsonify({'playlistURL':playlistURL})