From c58e66f61e999d33b22ccf046bab14376a917d1d Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 2 Jan 2014 19:55:07 +0530 Subject: [PATCH] upload url is relative now --- pandora_client/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pandora_client/__init__.py b/pandora_client/__init__.py index df58e3a..0eeda85 100644 --- a/pandora_client/__init__.py +++ b/pandora_client/__init__.py @@ -16,6 +16,7 @@ import sqlite3 import sys import time import pkg_resources +from urlparse import urlparse import ox @@ -890,6 +891,9 @@ class API(ox.API): result_url = data.get('url') if 'uploadUrl' in data: uploadUrl = data['uploadUrl'] + if uploadUrl.startswith('/'): + u = urlparse(url) + uploadUrl = '%s//%s%s' (u.scheme, u.netloc, uploadUrl) f = open(filename) fsize = os.stat(filename).st_size done = 0