make sure api url ends with /

This commit is contained in:
j 2012-04-19 17:47:51 +02:00
parent 21b4d3cea4
commit dd860862be
2 changed files with 4 additions and 3 deletions

View file

@ -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

View file

@ -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: