Added better error reporting for generation in cli
This commit is contained in:
parent
4119617c6b
commit
a7dd659e22
|
@ -10,6 +10,7 @@ from deemix.settings import load as loadSettings
|
|||
from deemix.utils import getBitrateNumberFromText
|
||||
import deemix.utils.localpaths as localpaths
|
||||
from deemix.downloader import Downloader
|
||||
from deemix.itemgen import GenerationError
|
||||
from deemix.plugins.spotify import Spotify
|
||||
|
||||
class LogListener:
|
||||
|
@ -65,7 +66,11 @@ def download(url, bitrate, portable, path):
|
|||
links.append(link)
|
||||
|
||||
for link in links:
|
||||
try:
|
||||
downloadObject = generateDownloadObject(dz, link, bitrate, plugins, listener)
|
||||
except GenerationError as e:
|
||||
print(f"{e.link}: {e.message}")
|
||||
continue
|
||||
if isinstance(downloadObject, list):
|
||||
for obj in downloadObject:
|
||||
Downloader(dz, obj, settings, listener).start()
|
||||
|
|
Loading…
Reference in New Issue