This commit is contained in:
Cyberes 2023-01-21 15:49:05 -07:00
parent c60717e069
commit 0890bf01d1
No known key found for this signature in database
GPG Key ID: 194A1C358AACFC39
1 changed files with 4 additions and 4 deletions

View File

@ -185,7 +185,6 @@ if not args.daemon:
for i, target_url in tqdm(enumerate(url_list), total=len(url_list), position=0, desc='Inputs', disable=args.daemon):
logger.info('Fetching playlist...')
playlist = yt_dlp.playlist_contents(target_url)
download_queue = playlist['entries']
log_info_twice(f"Downloading item: '{playlist['title']}' {target_url}")
@ -193,9 +192,10 @@ for i, target_url in tqdm(enumerate(url_list), total=len(url_list), position=0,
playlist_bar.set_description(playlist['title'])
# Remove already downloaded files from the to-do list.
for p, video in enumerate(download_queue):
if video['id'] in downloaded_videos:
del download_queue[p]
download_queue = []
for p, video in enumerate(playlist['entries']):
if video['id'] not in downloaded_videos:
download_queue.append(video)
playlist_bar.update(len(downloaded_videos))
if len(download_queue): # Don't mess with multiprocessing if all videos are already downloaded