make sure api url ends with /
This commit is contained in:
parent
21b4d3cea4
commit
dd860862be
2 changed files with 4 additions and 3 deletions
|
@ -46,7 +46,7 @@ if __name__ == '__main__':
|
||||||
"username": "",
|
"username": "",
|
||||||
"password": "",
|
"password": "",
|
||||||
"cache": "~/.ox/client.sqlite",
|
"cache": "~/.ox/client.sqlite",
|
||||||
"media": '~/.ox/media',
|
"media-cache": '~/.ox/media',
|
||||||
"volumes": {}
|
"volumes": {}
|
||||||
}, f, indent=2)
|
}, f, indent=2)
|
||||||
pandora_client.DEBUG = opts.debug
|
pandora_client.DEBUG = opts.debug
|
||||||
|
|
|
@ -69,7 +69,7 @@ class Client(object):
|
||||||
|
|
||||||
def __init__(self, config, offline=False):
|
def __init__(self, config, offline=False):
|
||||||
if isinstance(config, basestring):
|
if isinstance(config, basestring):
|
||||||
self._configfile = config
|
self._configfile = os.path.expanduser(config)
|
||||||
with open(config) as f:
|
with open(config) as f:
|
||||||
try:
|
try:
|
||||||
self._config = json.load(f)
|
self._config = json.load(f)
|
||||||
|
@ -78,7 +78,8 @@ class Client(object):
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
self._config = config
|
self._config = config
|
||||||
|
if not self._config['url'].endswith('/'):
|
||||||
|
self._config['url'] = self._config['url'] + '/'
|
||||||
self.profile = self._config.get('profile', '480p.webm')
|
self.profile = self._config.get('profile', '480p.webm')
|
||||||
|
|
||||||
if not offline:
|
if not offline:
|
||||||
|
|
Loading…
Reference in a new issue