diff --git a/pandora_client/extract.py b/pandora_client/extract.py index 03f3189..9fde8eb 100644 --- a/pandora_client/extract.py +++ b/pandora_client/extract.py @@ -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: diff --git a/pandora_client/server.py b/pandora_client/server.py index d2f2730..efde2a9 100644 --- a/pandora_client/server.py +++ b/pandora_client/server.py @@ -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)