mirror of
				https://github.com/KevinMidboe/spotify-downloader.git
				synced 2025-10-29 18:00:15 +00:00 
			
		
		
		
	Fix albumart exception in .M4A downloads
This commit is contained in:
		| @@ -74,7 +74,7 @@ def embed_mp3(music_file, meta_tags): | |||||||
|                                  desc=u'Cover', data=albumart.read()) |                                  desc=u'Cover', data=albumart.read()) | ||||||
|         albumart.close() |         albumart.close() | ||||||
|     except IndexError: |     except IndexError: | ||||||
|         albumart = None |         pass | ||||||
|     audiofile.save(v2_version=3) |     audiofile.save(v2_version=3) | ||||||
|     return True |     return True | ||||||
|  |  | ||||||
| @@ -114,9 +114,12 @@ def embed_m4a(music_file, meta_tags): | |||||||
|         audiofile[tags['genre']] = meta_tags['genre'] |         audiofile[tags['genre']] = meta_tags['genre'] | ||||||
|     if meta_tags['copyright']: |     if meta_tags['copyright']: | ||||||
|         audiofile[tags['copyright']] = meta_tags['copyright'] |         audiofile[tags['copyright']] = meta_tags['copyright'] | ||||||
|     albumart = urllib.request.urlopen(meta_tags['album']['images'][0]['url']) |     try: | ||||||
|     audiofile[tags['albumart']] = [MP4Cover( |         albumart = urllib.request.urlopen(meta_tags['album']['images'][0]['url']) | ||||||
|         albumart.read(), imageformat=MP4Cover.FORMAT_JPEG)] |         audiofile[tags['albumart']] = [MP4Cover( | ||||||
|     albumart.close() |             albumart.read(), imageformat=MP4Cover.FORMAT_JPEG)] | ||||||
|  |         albumart.close() | ||||||
|  |     except IndexError: | ||||||
|  |         pass | ||||||
|     audiofile.save() |     audiofile.save() | ||||||
|     return True |     return True | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user