From 47bdf3c897fb1e57841bab72420a8a65aa943fb1 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 24 Apr 2015 16:09:31 +0200 Subject: [PATCH] include size for unknown formats --- ox/file.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ox/file.py b/ox/file.py index 775c13b..9791f81 100644 --- a/ox/file.py +++ b/ox/file.py @@ -230,9 +230,6 @@ def ffprobe(filename): info[{ 'bit_rate': 'bitrate' }.get(key, key)] = fix_value(key, ffinfo['format'][key]) - if not 'size' in info: - info['size'] = os.stat(filename).st_size - print('no size in info', filename, ffinfo) info['audio'] = [] info['video'] = [] info['metadata'] = ffinfo['format'].get('tags', {}) @@ -288,6 +285,8 @@ def ffprobe(filename): v['pixel_aspect_ratio'] = '1:1' info['oshash'] = oshash(filename) info['path'] = filename + if not 'size' in info: + info['size'] = os.path.getsize(filename) return info def makedirs(path):