From cda3a485db9b440de6aef941420b1f9d2183f0f7 Mon Sep 17 00:00:00 2001 From: tcely Date: Thu, 30 Jan 2025 20:51:22 -0500 Subject: [PATCH] Prettier logged messages --- tubesync/sync/hooks.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tubesync/sync/hooks.py b/tubesync/sync/hooks.py index 2819c6bb..3d397a13 100644 --- a/tubesync/sync/hooks.py +++ b/tubesync/sync/hooks.py @@ -76,8 +76,19 @@ def yt_dlp_postprocessor_hook(event): postprocessor_hook['status'] = PPHookStatus(*event) if 'started' == event['status']: + if 'formats' in event['info_dict']: + del event['info_dict']['formats'] log.debug(repr(event['info_dict'])) - log.info(f'[{event["postprocessor"]}] {event["status"]}') + key = 'Unknown' + name = key + if 'id' in event['info_dict']: + key = event['info_dict']['id'] + title = None + if 'title' in event['info_dict']: + title = event['info_dict']['title'] + name = f'{key}: {title}' + + log.info(f'[{event["postprocessor"]}] {event["status"]} for: {name}') progress_hook = {