mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-23 13:36:35 +00:00
Merge pull request #1060 from tcely/patch-4
Use `filter_response` to clean up the debug logs
This commit is contained in:
commit
8b33b4c99a
@ -2,6 +2,7 @@ import os
|
||||
|
||||
from common.logger import log
|
||||
from common.utils import remove_enclosed
|
||||
from sync.utils import filter_response
|
||||
|
||||
|
||||
progress_hook = {
|
||||
@ -212,11 +213,15 @@ def yt_dlp_postprocessor_hook(event):
|
||||
status.media_name = name
|
||||
|
||||
if 'started' == event['status']:
|
||||
if 'formats' in event['info_dict']:
|
||||
del event['info_dict']['formats']
|
||||
if 'automatic_captions' in event['info_dict']:
|
||||
del event['info_dict']['automatic_captions']
|
||||
log.debug(repr(event['info_dict']))
|
||||
remove_keys = frozenset({
|
||||
'formats',
|
||||
'automatic_captions',
|
||||
})
|
||||
logged_dict = filter_response(event['info_dict'], True)
|
||||
found_keys = set(logged_dict.keys()).intersection(remove_keys)
|
||||
for key in found_keys:
|
||||
del logged_dict[key]
|
||||
log.debug(repr(logged_dict))
|
||||
|
||||
if 'Unknown' != key:
|
||||
status.media_key = key
|
||||
|
Loading…
Reference in New Issue
Block a user