mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-25 22:46:34 +00:00
Prefer display_id
and fulltitle
for logs
This commit is contained in:
parent
2b8fea103e
commit
60ee227caa
@ -75,20 +75,28 @@ def yt_dlp_postprocessor_hook(event):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
postprocessor_hook['status'] = PPHookStatus(*event)
|
postprocessor_hook['status'] = PPHookStatus(*event)
|
||||||
|
|
||||||
|
name = key = 'Unknown'
|
||||||
|
if 'display_id' in event['info_dict']:
|
||||||
|
key = event['info_dict']['display_id']
|
||||||
|
elif 'id' in event['info_dict']:
|
||||||
|
key = event['info_dict']['id']
|
||||||
|
|
||||||
|
title = None
|
||||||
|
if 'fulltitle' in event['info_dict']:
|
||||||
|
title = event['info_dict']['fulltitle']
|
||||||
|
elif 'title' in event['info_dict']:
|
||||||
|
title = event['info_dict']['title']
|
||||||
|
|
||||||
|
if title:
|
||||||
|
name = f'{key}: {title}'
|
||||||
|
|
||||||
if 'started' == event['status']:
|
if 'started' == event['status']:
|
||||||
if 'formats' in event['info_dict']:
|
if 'formats' in event['info_dict']:
|
||||||
del event['info_dict']['formats']
|
del event['info_dict']['formats']
|
||||||
if 'automatic_captions' in event['info_dict']:
|
if 'automatic_captions' in event['info_dict']:
|
||||||
del event['info_dict']['automatic_captions']
|
del event['info_dict']['automatic_captions']
|
||||||
log.debug(repr(event['info_dict']))
|
log.debug(repr(event['info_dict']))
|
||||||
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}')
|
log.info(f'[{event["postprocessor"]}] {event["status"]} for: {name}')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user