This commit is contained in:
RemixDev 2020-09-30 09:33:14 +02:00
parent 250682ea18
commit effa746b27

View file

@ -20,7 +20,7 @@ from deemix.api.deezer import USER_AGENT_HEADER
from deemix.utils.taggers import tagID3, tagFLAC from deemix.utils.taggers import tagID3, tagFLAC
from Cryptodome.Cipher import Blowfish from Cryptodome.Cipher import Blowfish
from mutagen.flac import FLACNoHeaderError from mutagen.flac import FLACNoHeaderError, error as FLACError
import logging import logging
logging.basicConfig(level=logging.INFO) logging.basicConfig(level=logging.INFO)
@ -564,7 +564,7 @@ class DownloadJob:
elif track.selectedFormat == 9: elif track.selectedFormat == 9:
try: try:
tagFLAC(writepath, track, self.settings['tags']) tagFLAC(writepath, track, self.settings['tags'])
except FLACNoHeaderError: except (FLACNoHeaderError, FLACError):
if writepath.is_file(): writepath.unlink() if writepath.is_file(): writepath.unlink()
logger.warn(f"[{track.mainArtist['name']} - {track.title}] Track not available in FLAC, falling back if necessary") logger.warn(f"[{track.mainArtist['name']} - {track.title}] Track not available in FLAC, falling back if necessary")
self.removeTrackPercentage() self.removeTrackPercentage()