From 5b3f843604bf92931985772df820c3e40f204933 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 8 Feb 2013 16:32:46 +0530 Subject: [PATCH] fix folderdepth, video upload --- pandora_client/__init__.py | 6 +++--- pandora_client/extract.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pandora_client/__init__.py b/pandora_client/__init__.py index 3b4c68e..542cea7 100644 --- a/pandora_client/__init__.py +++ b/pandora_client/__init__.py @@ -172,13 +172,13 @@ class Client(object): self.api.DEBUG = DEBUG if self.signin(): self.profile = "%sp.webm" % max(self.api.site['video']['resolutions']) + self.folderdepth = self.api.site.get('folderdepth', 3) def signin(self): if 'username' in self._config: r = self.api.signin(username=self._config['username'], password=self._config['password']) if r['status']['code'] == 200 and not 'errors' in r['data']: self.user = r['data']['user'] - self.folderdepth = r['data']['site'].get('folderdepth', 3) else: self.user = False print '\nlogin failed! check config\n\n' @@ -352,10 +352,10 @@ class Client(object): ignored=[] for f in files: f = f[len(path):] - if len(f.split('/')) == self.folder_depth and not 'Versions' in f or 'Extras' in f: + if len(f.split('/')) != self.folderdepth and not 'Versions' in f or 'Extras' in f: ignored.append(f) if ignored: - example = self.folder_depth == 4 and 'L/Last, First/Title (Year)/Title.avi' or 'T/Title/Title.dv' + example = self.folderdepth == 4 and 'L/Last, First/Title (Year)/Title.avi' or 'T/Title/Title.dv' print 'The following files do not conform to the required folder structure and will be ignored. only files like this are synced:\n\t%s' % example print '\n'.join(ignored) diff --git a/pandora_client/extract.py b/pandora_client/extract.py index cafdcc7..375003f 100644 --- a/pandora_client/extract.py +++ b/pandora_client/extract.py @@ -257,8 +257,8 @@ def video_cmd(video, target, profile, info): return cmd def video(video, target, profile, info): - profile, format = profile.split('.') cmd = video_cmd(video, target, profile, info) + profile, format = profile.split('.') #r = run_command(cmd, -1) p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE) try: