Skip to content

Commit

Permalink
[cleanup] Add color to download-archive message (#5138)
Browse files Browse the repository at this point in the history
Authored by: aaruni96, Grub4K, pukkandan
Closes #4913
  • Loading branch information
aaruni96 committed Jul 15, 2023
1 parent 131d132 commit 2b029ca
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions yt_dlp/YoutubeDL.py
Expand Up @@ -1492,7 +1492,10 @@ def check_filter():
return ret

if self.in_download_archive(info_dict):
reason = '%s has already been recorded in the archive' % video_title
reason = ''.join((
format_field(info_dict, 'id', f'{self._format_screen("%s", self.Styles.ID)}: '),
format_field(info_dict, 'title', f'{self._format_screen("%s", self.Styles.EMPHASIS)} '),
'has already been recorded in the archive'))
break_opt, break_err = 'break_on_existing', ExistingVideoReached
else:
try:
Expand Down Expand Up @@ -1553,7 +1556,8 @@ def extract_info(self, url, download=True, ie_key=None, extra_info=None,

temp_id = ie.get_temp_id(url)
if temp_id is not None and self.in_download_archive({'id': temp_id, 'ie_key': key}):
self.to_screen(f'[{key}] {temp_id}: has already been recorded in the archive')
self.to_screen(f'[download] {self._format_screen(temp_id, self.Styles.ID)}: '
'has already been recorded in the archive')
if self.params.get('break_on_existing', False):
raise ExistingVideoReached()
break
Expand Down

0 comments on commit 2b029ca

Please sign in to comment.