mirror of
https://github.com/anatolykopyl/youtube-cdl.git
synced 2026-03-26 12:55:11 +00:00
♻️ Graceful exit
This commit is contained in:
6
main.py
6
main.py
@@ -120,5 +120,11 @@ for ch in all_channels:
|
||||
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
|
||||
Path(os.path.join(output_dir, ch['title'])).mkdir(
|
||||
parents=True, exist_ok=True)
|
||||
try:
|
||||
ydl.download(
|
||||
['https://www.youtube.com/channel/{}'.format(ch["id"])])
|
||||
except KeyboardInterrupt:
|
||||
c.print('\nGoodbye!', style='orange1')
|
||||
c.print(
|
||||
'Start where you left off with "python main.py -i download_list.json"')
|
||||
sys.exit()
|
||||
|
||||
Reference in New Issue
Block a user