From 623f3343b6a1e8781443fd301f5793fc47be7f57 Mon Sep 17 00:00:00 2001 From: Cyberes Date: Sat, 6 May 2023 23:47:50 -0600 Subject: [PATCH] reduce number of CPU cores --- downloader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/downloader.py b/downloader.py index d32bb41..66a83af 100755 --- a/downloader.py +++ b/downloader.py @@ -47,7 +47,7 @@ parser.add_argument('--output', required=False, help='Output directory. Ignored parser.add_argument('--no-update', '-n', action='store_true', help='Don\'t update yt-dlp at launch.') parser.add_argument('--max-size', type=int, default=1100, help='Max allowed size of a video in MB.') parser.add_argument('--rm-cache', '-r', action='store_true', help='Delete the yt-dlp cache on start.') -parser.add_argument('--threads', type=int, default=cpu_count(), help='How many download processes to use.') +parser.add_argument('--threads', type=int, default=(cpu_count() - 1), help=f'How many download processes to use. Default: number of CPU cores (for your machine, {cpu_count()}) - 1 = {cpu_count() - 1}') parser.add_argument('--daemon', '-d', action='store_true', help="Run in daemon mode. Disables progress bars sleeps for the amount of time specified in --sleep.") parser.add_argument('--sleep', type=float, default=60, help='How many minutes to sleep when in daemon mode.') parser.add_argument('--download-cache-file-directory', default=user_data_dir('automated-youtube-dl', 'cyberes'), help='The path to the directory to track downloaded videos. Defaults to your appdata path.') @@ -372,7 +372,7 @@ while True: playlist_ydl_opts = ydl_opts.copy() # playlist_ydl_opts['outtmpl'] = f'{output_path}/{get_output_templ()}' - + if len(download_queue): # Don't mess with multiprocessing if all videos are already downloaded with Pool(processes=args.threads) as pool: if sys.stdout.isatty():