File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -115,6 +115,7 @@ def main():
115115 mirrorplayback .start ()
116116
117117 if args .download :
118+ failed_download = False
118119 print (f"\033 [32mParsing URL: { args .download } \033 [0m" )
119120 parse_url (args .download )
120121 while not download_queue :
@@ -126,9 +127,14 @@ def main():
126127 for item in download_queue .values ():
127128 if item ['item_status' ] in ('Unavailable' , 'Failed' ):
128129 print (f"\033 [31mItem ID { item ['item_id' ]} { item ['item_status' ]} '\033 [0m" )
130+ failed_download = True
129131
130- print ("\033 [32mDownload Completed. Exiting...\033 [0m" )
131- os ._exit (0 )
132+ if failed_download :
133+ print ("\033 [31mAt least one track download failed. Exiting with failure...\033 [0m" )
134+ os ._exit (1 )
135+ else :
136+ print ("\033 [32mDownload Completed. Exiting...\033 [0m" )
137+ os ._exit (0 )
132138
133139 CLI ().cmdloop ()
134140
You can’t perform that action at this time.
0 commit comments