mirror of
				https://github.com/KevinMidboe/spotify-downloader.git
				synced 2025-10-29 18:00:15 +00:00 
			
		
		
		
	Message on unavailable local tracks
This commit is contained in:
		
							
								
								
									
										11
									
								
								core/misc.py
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								core/misc.py
									
									
									
									
									
								
							@@ -64,6 +64,17 @@ def is_spotify(raw_song):
 | 
			
		||||
    else:
 | 
			
		||||
        return False
 | 
			
		||||
 | 
			
		||||
# write tracks into list file
 | 
			
		||||
def feed_tracks(file, tracks):
 | 
			
		||||
    with open(file, 'a') as fout:
 | 
			
		||||
        for item in tracks['items']:
 | 
			
		||||
            track = item['track']
 | 
			
		||||
            try:
 | 
			
		||||
                fout.write(track['external_urls']['spotify'] + '\n')
 | 
			
		||||
            except KeyError:
 | 
			
		||||
                title = track['name'] + ' by '+ track['artists'][0]['name']
 | 
			
		||||
                print('Skipping track ' + title + ' (local only?)')
 | 
			
		||||
 | 
			
		||||
# generate filename of the song to be downloaded
 | 
			
		||||
def generate_filename(title):
 | 
			
		||||
    raw_title = title.replace(' ', '_')
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user