From dd860862bebd4985d3c76ca0dcb39b8ccbaf8b71 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 19 Apr 2012 17:47:51 +0200 Subject: [PATCH] make sure api url ends with / --- bin/pandora_client | 2 +- pandora_client/__init__.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/pandora_client b/bin/pandora_client index c0c5ecd..fd3bbbb 100755 --- a/bin/pandora_client +++ b/bin/pandora_client @@ -46,7 +46,7 @@ if __name__ == '__main__': "username": "", "password": "", "cache": "~/.ox/client.sqlite", - "media": '~/.ox/media', + "media-cache": '~/.ox/media', "volumes": {} }, f, indent=2) pandora_client.DEBUG = opts.debug diff --git a/pandora_client/__init__.py b/pandora_client/__init__.py index ddee8ee..0347e6d 100644 --- a/pandora_client/__init__.py +++ b/pandora_client/__init__.py @@ -69,7 +69,7 @@ class Client(object): def __init__(self, config, offline=False): if isinstance(config, basestring): - self._configfile = config + self._configfile = os.path.expanduser(config) with open(config) as f: try: self._config = json.load(f) @@ -78,7 +78,8 @@ class Client(object): sys.exit(1) else: self._config = config - + if not self._config['url'].endswith('/'): + self._config['url'] = self._config['url'] + '/' self.profile = self._config.get('profile', '480p.webm') if not offline: