From 4392df067827c61f88919b8120df8aa5b57b5b41 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 5 Jun 2012 15:55:56 +0200 Subject: [PATCH] fix utf8 filenames, better -map --- pandora_client/__init__.py | 6 +++--- pandora_client/extract.py | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pandora_client/__init__.py b/pandora_client/__init__.py index f4dee0d..8581718 100644 --- a/pandora_client/__init__.py +++ b/pandora_client/__init__.py @@ -232,9 +232,9 @@ class Client(object): path = [filename] for p in path: if os.path.exists(p): - cmd = encode_cmd(p, self.media_cache(), self.profile, None) - cmd = [' ' in c and '"%s"' % c or c for c in cmd] - print ' '.join(cmd) + cmd = encode_cmd(p.decode('utf-8'), self.media_cache(), self.profile, None) + cmd = [' ' in c and u'"%s"' % c or c for c in cmd] + print (u' '.join(cmd)).encode('utf-8') def save_config(self): if not self._configfile: diff --git a/pandora_client/extract.py b/pandora_client/extract.py index 3858fec..5e49198 100644 --- a/pandora_client/extract.py +++ b/pandora_client/extract.py @@ -169,14 +169,13 @@ def video_cmd(video, target, profile, info): '-lag-in-frames', '16', '-auto-alt-ref', '1', ] + video_settings += ['-map', '0:%s,0'%info['video'][0]['id']] else: video_settings = ['-vn'] if info['audio']: + video_settings += ['-map', '0:%s,1'%info['audio'][0]['id']] audio_settings = ['-ar', str(audiorate), '-aq', str(audioquality)] - if len(info['audio'][0]) > 1 and info['video']: - audio_settings += ['-map', '0:0'] - audio_settings += ['-map', '0:1'] ac = info['audio'][0].get('channels', audiochannels) ac = min(ac, audiochannels) audio_settings += ['-ac', str(ac)]