Sometimes yt-dlp does not provide final filename.
This commit is contained in:
parent
3f5a2333a7
commit
68b2c322bc
1 changed files with 8 additions and 1 deletions
|
|
@ -298,6 +298,13 @@ class Download:
|
|||
self.info.eta = status.get('eta')
|
||||
|
||||
if self.info.status == 'finished' and 'filename' in status and self.info.format != 'thumbnail':
|
||||
self.info.file_size = os.path.getsize(status.get('filename'))
|
||||
try:
|
||||
self.info.file_size = os.path.getsize(
|
||||
status.get('filename'))
|
||||
except FileNotFoundError:
|
||||
log.warning(
|
||||
f'File not found: {status.get("filename")}')
|
||||
self.info.file_size = None
|
||||
pass
|
||||
|
||||
await self.notifier.updated(self.info)
|
||||
|
|
|
|||
Loading…
Reference in a new issue