mirror of
				https://github.com/THIS-IS-NOT-A-BACKUP/zspotify.git
				synced 2025-11-03 21:10:34 +00:00 
			
		
		
		
	revised playlist id parsing logic in playlist.download_from_user_playlist
This commit is contained in:
		
							parent
							
								
									8bab8a03c5
								
							
						
					
					
						commit
						01c8dd49fd
					
				@ -71,17 +71,14 @@ def download_from_user_playlist():
 | 
				
			|||||||
    print('> SELECT A RANGE BY ADDING A DASH BETWEEN BOTH ID\'s')
 | 
					    print('> SELECT A RANGE BY ADDING A DASH BETWEEN BOTH ID\'s')
 | 
				
			||||||
    print('> For example, typing 10 to get one playlist or 10-20 to get\nevery playlist from 10-20 (inclusive)\n')
 | 
					    print('> For example, typing 10 to get one playlist or 10-20 to get\nevery playlist from 10-20 (inclusive)\n')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    playlist_choices = input('ID(s): ').split('-')
 | 
					    playlist_choices = map(int, input('ID(s): ').split('-'))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if len(playlist_choices) == 1:
 | 
					    start = next(playlist_choices) - 1
 | 
				
			||||||
        download_playlist(playlists, playlist_choices[0])
 | 
					    end = next(playlist_choices, start + 1)
 | 
				
			||||||
    else:
 | 
					 | 
				
			||||||
        start = int(playlist_choices[0])
 | 
					 | 
				
			||||||
        end = int(playlist_choices[1]) + 1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        print(f'Downloading from {start} to {end}...')
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for playlist_number in range(start, end):
 | 
					    for playlist_number in range(start, end):
 | 
				
			||||||
            download_playlist(playlists, playlist_number)
 | 
					        playlist = playlists[playlist_number]
 | 
				
			||||||
 | 
					        print(f'Downloading {playlist[NAME].strip()}')
 | 
				
			||||||
 | 
					        download_playlist(playlist)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    print('\n**All playlists have been downloaded**\n')
 | 
					    print('\n**All playlists have been downloaded**\n')
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user