- if ctx['fragment_index'] > 0 and resume_len == 0:
- self.report_error(
- 'Inconsistent state of incomplete fragment download. '
- 'Restarting from the beginning...')
+ is_corrupt = ctx.get('ytdl_corrupt') is True
+ is_inconsistent = ctx['fragment_index'] > 0 and resume_len == 0
+ if is_corrupt or is_inconsistent:
+ message = (
+ '.ytdl file is corrupt' if is_corrupt else
+ 'Inconsistent state of incomplete fragment download')
+ self.report_warning(
+ '%s. Restarting from the beginning...' % message)