don't fail if hieght is None
This commit is contained in:
parent
95485f3e4b
commit
19bb7e3b83
1 changed files with 2 additions and 2 deletions
|
@ -404,7 +404,7 @@ class File(models.Model):
|
||||||
config = settings.CONFIG['video']
|
config = settings.CONFIG['video']
|
||||||
height = self.info['video'][0]['height'] if self.info.get('video') else None
|
height = self.info['video'][0]['height'] if self.info.get('video') else None
|
||||||
max_resolution = max(config['resolutions'])
|
max_resolution = max(config['resolutions'])
|
||||||
if height <= max_resolution and self.extension in ('mov', 'mkv', 'mp4', 'm4v'):
|
if height and height <= max_resolution and self.extension in ('mov', 'mkv', 'mp4', 'm4v'):
|
||||||
vcodec = self.get_codec('video')
|
vcodec = self.get_codec('video')
|
||||||
acodec = self.get_codec('audio')
|
acodec = self.get_codec('audio')
|
||||||
if vcodec in self.MP4_VCODECS and acodec in self.MP4_ACODECS:
|
if vcodec in self.MP4_VCODECS and acodec in self.MP4_ACODECS:
|
||||||
|
@ -415,7 +415,7 @@ class File(models.Model):
|
||||||
config = settings.CONFIG['video']
|
config = settings.CONFIG['video']
|
||||||
height = self.info['video'][0]['height'] if self.info.get('video') else None
|
height = self.info['video'][0]['height'] if self.info.get('video') else None
|
||||||
max_resolution = max(config['resolutions'])
|
max_resolution = max(config['resolutions'])
|
||||||
if height <= max_resolution and config['formats'][0] == self.extension:
|
if height and height <= max_resolution and config['formats'][0] == self.extension:
|
||||||
vcodec = self.get_codec('video')
|
vcodec = self.get_codec('video')
|
||||||
acodec = self.get_codec('audio')
|
acodec = self.get_codec('audio')
|
||||||
if self.extension in ['mp4', 'm4v'] and vcodec in self.MP4_VCODECS and acodec in self.MP4_ACODECS:
|
if self.extension in ['mp4', 'm4v'] and vcodec in self.MP4_VCODECS and acodec in self.MP4_ACODECS:
|
||||||
|
|
Loading…
Reference in a new issue