Merge pull request #62 from arabcoders/dev
Fix error when yt-dlp does not provide final filename.
This commit is contained in:
commit
c59ed4d48d
2 changed files with 9 additions and 2 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)
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class DownloadQueue:
|
|||
etype = entry.get('_type') or 'video'
|
||||
if etype == 'playlist':
|
||||
entries = entry['entries']
|
||||
log.info(f'playlist detected with {len(entries)} entries')
|
||||
log.info(f'Found [{len(entries)}] new entries for [{entry.get("id")}: {entry.get("title")}].')
|
||||
playlist_index_digits = len(str(len(entries)))
|
||||
results = []
|
||||
for index, etr in enumerate(entries, start=1):
|
||||
|
|
|
|||
Loading…
Reference in a new issue