fix audio only files

This commit is contained in:
j 2013-04-30 14:17:45 +02:00
parent b1fb45f333
commit 68426aaa6a
2 changed files with 2 additions and 5 deletions

View File

@ -156,7 +156,7 @@ def video_cmd(video, target, profile, info):
audiobitrate = '22k'
audiochannels = 1
if info['video'] and 'display_aspect_ratio' in info['video'][0]:
if 'video' in info and info['video'] and 'display_aspect_ratio' in info['video'][0]:
dar = AspectRatio(info['video'][0]['display_aspect_ratio'])
fps = AspectRatio(info['video'][0]['framerate'])
width = int(dar * height)
@ -232,7 +232,7 @@ def video_cmd(video, target, profile, info):
else:
video_settings = ['-vn']
if info['audio']:
if 'audio' in info and info['audio']:
if video_settings == ['-vn'] or not info['video']:
n = 0
else:

View File

@ -128,9 +128,6 @@ class Server(Resource):
if os.path.exists(f):
response['oshash'] = oshash
info = self.client.info(oshash)
if not 'video' in info:
print oshash, f, 'not media file skipped'
continue
url = 'http://%s:%s/get/%s' % (request.host.host, request.host.port, oshash)
output = '/tmp/%s.%s' % (oshash, self.client.profile)
response['cmd'] = extract.video_cmd(url, output, self.client.profile, info)