mirror of
				https://github.com/KevinMidboe/spotify-downloader.git
				synced 2025-10-29 18:00:15 +00:00 
			
		
		
		
	WARN if encoder not found
This commit is contained in:
		
							
								
								
									
										17
									
								
								spotdl.py
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								spotdl.py
									
									
									
									
									
								
							| @@ -439,13 +439,24 @@ def grab_single(raw_song, number=None): | ||||
|             input_song = file_name + args.input_ext | ||||
|             output_song = file_name + args.output_ext | ||||
|             print('') | ||||
|             convert.song(input_song, output_song, args.folder, | ||||
|                          avconv=args.avconv) | ||||
|  | ||||
|             try: | ||||
|                 convert.song(input_song, output_song, args.folder, | ||||
|                              avconv=args.avconv) | ||||
|             except FileNotFoundError: | ||||
|                 if args.avconv: | ||||
|                     encoder = 'avconv' | ||||
|                 else: | ||||
|                     encoder = 'ffmpeg' | ||||
|                 log.warning('Could not find {0}, skipping conversion'.format(encoder)) | ||||
|                 args.output_ext = args.input_ext | ||||
|                 output_song = file_name + args.output_ext | ||||
|  | ||||
|             if not args.input_ext == args.output_ext: | ||||
|                 os.remove(os.path.join(args.folder, input_song)) | ||||
|  | ||||
|             if not args.no_metadata: | ||||
|                 metadata.embed(os.path.join(args.folder, output_song), meta_tags) | ||||
|  | ||||
|         else: | ||||
|             log.error('No audio streams available') | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user